Merge lp:~canonical-platform-qa/camera-app/fix-1514408-swipe-to-gallery into lp:camera-app

Proposed by Richard Huddie on 2015-11-09
Status: Merged
Approved by: Florian Boucault on 2015-11-20
Approved revision: 595
Merged at revision: 600
Proposed branch: lp:~canonical-platform-qa/camera-app/fix-1514408-swipe-to-gallery
Merge into: lp:camera-app
Diff against target: 72 lines (+15/-8)
3 files modified
camera-app.qml (+1/-0)
tests/autopilot/camera_app/emulators/main_window.py (+11/-5)
tests/autopilot/camera_app/tests/test_options.py (+3/-3)
To merge this branch: bzr merge lp:~canonical-platform-qa/camera-app/fix-1514408-swipe-to-gallery
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-11-20
Ubuntu Phablet Team 2015-11-09 Pending
Review via email: mp+276993@code.launchpad.net

Commit Message

Fix for https://bugs.launchpad.net/camera-app/+bug/1514408

Use the x, y, width and height properties of main_window, rather than globalRect property which does not exist.

To post a comment you must log in.
Florian Boucault (fboucault) wrote :

Additional tests are failing for similar reasons. I will be providing more fixes ASAP.

595. By Richard Huddie on 2015-11-20

Merge additional fixes from lp:~fboucault/camera-app/fix-1514408-swipe-to-gallery

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'camera-app.qml'
2--- camera-app.qml 2015-11-03 14:23:10 +0000
3+++ camera-app.qml 2015-11-20 15:11:10 +0000
4@@ -73,6 +73,7 @@
5
6 Flickable {
7 id: viewSwitcher
8+ objectName: "viewSwitcher"
9 anchors.fill: parent
10 flickableDirection: state == "PORTRAIT" ? Flickable.HorizontalFlick : Flickable.VerticalFlick
11 boundsBehavior: Flickable.StopAtBounds
12
13=== modified file 'tests/autopilot/camera_app/emulators/main_window.py'
14--- tests/autopilot/camera_app/emulators/main_window.py 2015-10-26 15:02:19 +0000
15+++ tests/autopilot/camera_app/emulators/main_window.py 2015-11-20 15:11:10 +0000
16@@ -24,6 +24,10 @@
17 """Returns the root QML Item"""
18 return self.app.wait_select_single(objectName="main")
19
20+ def get_view_switcher(self):
21+ """Returns the switcher Flickable"""
22+ return self.app.wait_select_single(objectName="viewSwitcher")
23+
24 def get_viewfinder(self):
25 """Returns the viewfinder view"""
26 return self.app.wait_select_single("ViewFinderView")
27@@ -136,8 +140,9 @@
28 return None
29
30 def swipe_to_gallery(self, testCase):
31- main_view = self.get_root()
32- x, y, w, h = main_view.globalRect
33+ view_switcher = self.get_view_switcher()
34+ x, y = view_switcher.x, view_switcher.y
35+ w, h = view_switcher.width, view_switcher.height
36
37 tx = x + (w // 2)
38 ty = y + (h // 2)
39@@ -147,13 +152,14 @@
40 testCase.assertThat(viewfinder.inView, Eventually(Equals(False)))
41
42 def swipe_to_viewfinder(self, testCase):
43- main_view = self.get_root()
44- x, y, w, h = main_view.globalRect
45+ view_switcher = self.get_view_switcher()
46+ x, y = view_switcher.x, view_switcher.y
47+ w, h = view_switcher.width, view_switcher.height
48
49 tx = x + (w // 2)
50 ty = y + (h // 2)
51
52 self.app.pointing_device.drag(
53- tx, ty, (tx + main_view.width // 2), ty, rate=1)
54+ tx, ty, (tx + view_switcher.width // 2), ty, rate=1)
55 viewfinder = self.get_viewfinder()
56 testCase.assertThat(viewfinder.inView, Eventually(Equals(True)))
57
58=== modified file 'tests/autopilot/camera_app/tests/test_options.py'
59--- tests/autopilot/camera_app/tests/test_options.py 2015-04-29 15:56:44 +0000
60+++ tests/autopilot/camera_app/tests/test_options.py 2015-11-20 15:11:10 +0000
61@@ -33,9 +33,9 @@
62 self.assertThat(bottom_edge.opened, Eventually(Equals(True)))
63
64 # tap to close overlay
65- root = self.main_window.get_root()
66- x = root.globalRect.x + root.width / 2.0
67- y = root.globalRect.y + root.height / 4.0
68+ viewfinder = self.main_window.get_viewfinder()
69+ x = viewfinder.globalRect.x + viewfinder.width / 2.0
70+ y = viewfinder.globalRect.y + viewfinder.height / 4.0
71 self.pointing_device.move(x, y)
72 self.pointing_device.click()
73

Subscribers

People subscribed via source and target branches