Merge lp:~rhuddie/gallery-app/dashboard-bug-fix-1419849 into lp:gallery-app

Proposed by Richard Huddie
Status: Merged
Approved by: Bill Filler
Approved revision: 1149
Merged at revision: 1148
Proposed branch: lp:~rhuddie/gallery-app/dashboard-bug-fix-1419849
Merge into: lp:gallery-app
Diff against target: 176 lines (+31/-13)
6 files modified
tests/autopilot/gallery_app/emulators/album_view.py (+4/-3)
tests/autopilot/gallery_app/emulators/photo_viewer.py (+4/-2)
tests/autopilot/gallery_app/tests/test_album_view.py (+1/-1)
tests/autopilot/gallery_app/tests/test_albums_view.py (+18/-0)
tests/autopilot/gallery_app/tests/test_photo_viewer.py (+3/-6)
tests/autopilot/gallery_app/tests/test_picker_mode.py (+1/-1)
To merge this branch: bzr merge lp:~rhuddie/gallery-app/dashboard-bug-fix-1419849
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+249098@code.launchpad.net

Commit message

Fixes for dashboard failures, bug lp:1419849

Description of the change

Fixes for dashboard failures, bug lp:1419849

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1146. By Richard Huddie

slow down the drag to make it more reliable

1147. By Richard Huddie

slow down speed of album page turns to make them more reliable

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1148. By Richard Huddie

test_share_button fix, ensure cancel button is visible before pressing

1149. By Richard Huddie

merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

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/album_view.py'
2--- tests/autopilot/gallery_app/emulators/album_view.py 2014-09-04 12:27:15 +0000
3+++ tests/autopilot/gallery_app/emulators/album_view.py 2015-02-11 11:27:47 +0000
4@@ -68,7 +68,8 @@
5 def get_plus_icon_empty_album(self):
6 """Returns the plus icon visible in empty albums"""
7 return self.app.select_single("QQuickImage",
8- objectName="addButton", visible=True)
9+ objectName="albumCoverAddPhotosImage",
10+ visible=True)
11
12 def ensure_animated_fully_closed(self):
13 """Ensure the animated album view is fully closed"""
14@@ -100,7 +101,7 @@
15 self.pointing_device.drag(
16 mid_x, mid_y, # Start
17 x + w, mid_y, # Finish
18- rate=3
19+ rate=1
20 )
21
22 elif 'right' == direction:
23@@ -108,7 +109,7 @@
24 self.pointing_device.drag(
25 mid_x, mid_y, # Start
26 x, mid_y, # Finish
27- rate=3
28+ rate=1
29 )
30 else:
31 raise GalleryAppException(
32
33=== modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py'
34--- tests/autopilot/gallery_app/emulators/photo_viewer.py 2014-09-16 17:41:40 +0000
35+++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2015-02-11 11:27:47 +0000
36@@ -32,12 +32,14 @@
37 def get_content_peer_picker_cancel_button(self):
38 """Returns the ContentPeerPicker cancel button."""
39 return self.get_share_peer_picker().wait_select_single("Button",
40- objectName="contentPeerPickerCancelButton")
41+ objectName="contentPeerPickerCancelButton",
42+ visible=True)
43
44 def get_share_peer_picker(self):
45 """Returns the photo viewer share picker."""
46 return self.app.wait_select_single("ContentPeerPicker10",
47- objectName="sharePicker")
48+ objectName="sharePicker",
49+ visible=True)
50
51 def get_photo_edit_dialog(self):
52 """Returns the photo edit dialog."""
53
54=== modified file 'tests/autopilot/gallery_app/tests/test_album_view.py'
55--- tests/autopilot/gallery_app/tests/test_album_view.py 2014-09-03 21:13:03 +0000
56+++ tests/autopilot/gallery_app/tests/test_album_view.py 2015-02-11 11:27:47 +0000
57@@ -185,7 +185,6 @@
58 editor.ensure_fully_open()
59 editor.close()
60
61- self.open_first_album()
62 num_photos_start = self.album_view.number_of_photos()
63 self.assertThat(num_photos_start, Equals(0))
64
65@@ -197,6 +196,7 @@
66 self.click_item(photo)
67 self.main_view.get_header().click_action_button("addButton")
68
69+ self.open_first_album()
70 self.assertThat(
71 lambda: self.album_view.number_of_photos(),
72 Eventually(Equals(num_photos_start + 1)))
73
74=== modified file 'tests/autopilot/gallery_app/tests/test_albums_view.py'
75--- tests/autopilot/gallery_app/tests/test_albums_view.py 2014-10-13 10:31:53 +0000
76+++ tests/autopilot/gallery_app/tests/test_albums_view.py 2015-02-11 11:27:47 +0000
77@@ -14,7 +14,9 @@
78 from autopilot.introspection.dbus import StateNotFoundError
79
80 from gallery_app.tests import GalleryTestCase
81+from gallery_app.emulators.album_view import AlbumView
82 from gallery_app.emulators.albums_view import AlbumsView
83+from gallery_app.emulators.media_selector import MediaSelector
84 from gallery_app.emulators import album_editor
85
86 from os import environ as env
87@@ -24,9 +26,17 @@
88 envDesktopMode = None
89
90 @property
91+ def album_view(self):
92+ return AlbumView(self.app)
93+
94+ @property
95 def albums_view(self):
96 return AlbumsView(self.app)
97
98+ @property
99+ def media_selector(self):
100+ return MediaSelector(self.app)
101+
102 def setUp(self):
103 self.ARGS = []
104
105@@ -61,6 +71,14 @@
106 """Add one album, and checks if the number of albums went up by one"""
107 albums = self.albums_view.number_of_albums_in_albums_view()
108 self.main_view.get_header().click_action_button("addButton")
109+ # a photo must be added to the album for it to be saved
110+ plus = self.album_view.get_plus_icon_empty_album()
111+ self.click_item(plus)
112+ self.media_selector.ensure_fully_open()
113+ photo = self.media_selector.get_second_photo()
114+ self.click_item(photo)
115+ self.main_view.get_header().click_action_button("addButton")
116+
117 self.assertThat(
118 lambda: self.albums_view.number_of_albums_in_albums_view(),
119 Eventually(Equals(albums+1))
120
121=== modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py'
122--- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2014-09-03 00:14:45 +0000
123+++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2015-02-11 11:27:47 +0000
124@@ -41,8 +41,6 @@
125 super(TestPhotoViewerBase, self).setUp()
126 self.main_view.switch_to_tab("eventsTab")
127 self.open_first_photo()
128- # Need to click on the photo to toggle header
129- self.pointing_device.click()
130
131 def open_first_photo(self):
132 self.assertThat(
133@@ -111,7 +109,6 @@
134 @skipIf(model() == 'Desktop', 'Share not supported on desktop')
135 def test_share_button(self):
136 """Clicking the share button must show the ContentPeerPicker."""
137- photo_viewer = self.photo_viewer.get_main_photo_viewer()
138 self.main_view.get_header().click_action_button("shareButton")
139 share_picker = self.photo_viewer.get_share_peer_picker()
140 self.assertThat(share_picker.visible, Eventually(Equals(True)))
141@@ -182,19 +179,19 @@
142 x, y, w, h = list.globalRect
143 mid_y = y + h // 2
144 mid_x = x + w // 2
145- self.pointing_device.drag(mid_x, mid_y, x + 10, mid_y)
146+ self.pointing_device.drag(mid_x, mid_y, x + 10, mid_y, rate=5)
147
148 self.assertThat(list.moving, Eventually(Equals(False)))
149 self.assertThat(list.currentIndex, Eventually(Equals(1)))
150
151 # Slide right should get us back to the start
152- self.pointing_device.drag(mid_x, mid_y, x + w - 10, mid_y)
153+ self.pointing_device.drag(mid_x, mid_y, x + w - 10, mid_y, rate=5)
154
155 self.assertThat(list.moving, Eventually(Equals(False)))
156 self.assertThat(list.currentIndex, Eventually(Equals(0)))
157
158 # Slide right again shouldn't go anywhere
159- self.pointing_device.drag(mid_x, mid_y, x + w - 10, mid_y)
160+ self.pointing_device.drag(mid_x, mid_y, x + w - 10, mid_y, rate=5)
161
162 self.assertThat(list.moving, Eventually(Equals(False)))
163 self.assertThat(list.currentIndex, Eventually(Equals(0)))
164
165=== modified file 'tests/autopilot/gallery_app/tests/test_picker_mode.py'
166--- tests/autopilot/gallery_app/tests/test_picker_mode.py 2014-07-15 09:16:18 +0000
167+++ tests/autopilot/gallery_app/tests/test_picker_mode.py 2015-02-11 11:27:47 +0000
168@@ -72,7 +72,7 @@
169 image_path = 'image://thumbnailer/{}/sample02.jpg'.format(
170 self.sample_destination_dir)
171 photos_page.click_named_photo(image_path)
172- self.assertTrue(pick_button.enabled)
173+ self.assertThat(pick_button.enabled, Eventually(Equals(True)))
174 self.picker_view.click_pick_button()
175
176 def test_selection_synchronisation(self):

Subscribers

People subscribed via source and target branches