Merge lp:~om26er/gallery-app/fix_tests_on_phones into lp:gallery-app

Proposed by Omer Akram
Status: Merged
Approved by: Günter Schwann
Approved revision: 705
Merged at revision: 712
Proposed branch: lp:~om26er/gallery-app/fix_tests_on_phones
Merge into: lp:gallery-app
Diff against target: 37 lines (+18/-1)
2 files modified
tests/autopilot/gallery_app/emulators/gallery_utils.py (+6/-0)
tests/autopilot/gallery_app/tests/__init__.py (+12/-1)
To merge this branch: bzr merge lp:~om26er/gallery-app/fix_tests_on_phones
Reviewer Review Type Date Requested Status
Günter Schwann (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+168907@code.launchpad.net

Commit message

fixes a few autopilot tests on the phone devices.

Description of the change

When using a phone in portrait autopilot cannot switch to the albums tab because the albums tab item goes outside of the visible area, now we drag the tab a bit to the left before moving.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Günter Schwann (schwann) wrote :

looks ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/gallery_app/emulators/gallery_utils.py'
2--- tests/autopilot/gallery_app/emulators/gallery_utils.py 2013-05-03 00:44:25 +0000
3+++ tests/autopilot/gallery_app/emulators/gallery_utils.py 2013-06-12 10:32:49 +0000
4@@ -135,3 +135,9 @@
5 albums = self.select_many_retry("CheckerboardDelegate",
6 objectName="checkerboardDelegate")
7 return albums[-1]
8+
9+ def get_tabs_bar_absolute_width(self):
10+ return self.app.select_single("QQuickPathView").width
11+
12+ def get_tabs_bar_potential_width(self):
13+ return self.app.select_single("NewTabBar").width
14
15=== modified file 'tests/autopilot/gallery_app/tests/__init__.py'
16--- tests/autopilot/gallery_app/tests/__init__.py 2013-06-10 15:31:00 +0000
17+++ tests/autopilot/gallery_app/tests/__init__.py 2013-06-12 10:32:49 +0000
18@@ -148,7 +148,18 @@
19
20 def switch_to_albums_tab(self):
21 tabs_bar = self.gallery_utils.get_tabs_bar()
22- self.click_item(tabs_bar)
23+ tabs_bar_abs_width = self.gallery_utils.get_tabs_bar_absolute_width()
24+ tabs_bar_potential_width = self.gallery_utils.get_tabs_bar_potential_width()
25+
26+ if tabs_bar_abs_width == tabs_bar_potential_width:
27+ x, y, w, h = tabs_bar.globalRect
28+
29+ tx = x + (w / 1.5)
30+ ty = y + (h / 2)
31+
32+ self.pointing_device.drag(tx, ty, tx / 8, ty)
33+ else:
34+ self.click_item(tabs_bar)
35
36 albums_tab_button = self.gallery_utils.get_albums_tab_button()
37 # Due to some timing issues sometimes mouse moves to the location a bit

Subscribers

People subscribed via source and target branches