Merge lp:~schwann/gallery-app/gallery-uitk-emulators into lp:gallery-app
- gallery-uitk-emulators
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Günter Schwann |
Approved revision: | 797 |
Merged at revision: | 798 |
Proposed branch: | lp:~schwann/gallery-app/gallery-uitk-emulators |
Merge into: | lp:gallery-app |
Diff against target: |
508 lines (+77/-120) 12 files modified
debian/control (+1/-0) rc/qml/MainScreen.qml (+1/-0) tests/autopilot/gallery_app/emulators/events_view.py (+0/-28) tests/autopilot/gallery_app/emulators/main_screen.py (+12/-0) tests/autopilot/gallery_app/tests/__init__.py (+12/-20) tests/autopilot/gallery_app/tests/test_album_editor.py (+1/-1) tests/autopilot/gallery_app/tests/test_album_view.py (+3/-3) tests/autopilot/gallery_app/tests/test_albums_view.py (+1/-1) tests/autopilot/gallery_app/tests/test_events_view.py (+27/-33) tests/autopilot/gallery_app/tests/test_photo_viewer.py (+18/-26) tests/autopilot/gallery_app/tests/test_photos_view.py (+1/-5) tests/autopilot/gallery_app/tests/test_picker_mode.py (+0/-3) |
To merge this branch: | bzr merge lp:~schwann/gallery-app/gallery-uitk-emulators |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Olivier Tilloy | Approve | ||
Omer Akram | Pending | ||
Review via email: mp+178330@code.launchpad.net |
Commit message
Start to use the UITK emulators
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:793
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:793
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:793
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:793
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:794
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
298 + # TODO: find a better way to wait for dialog being closed
299 + sleep(1)
When the dialog is closed, it is being destroyed, right? So something like that should work (not tested):
self.
Olivier Tilloy (osomon) wrote : | # |
265 + # TODO: test to be in select mode
Testing the value of organicEventVie
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:795
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
Output of pyflakes on this branch:
tests/autopilot
tests/autopilot
tests/autopilot
tests/autopilot
tests/autopilot
tests/autopilot
tests/autopilot
Not all of those warnings were introduced by changes in this branch, but at least a couple of them were, so they should be addressed. And if you choose to address them all here, I won’t mind.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:796
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:797
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:797
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
> 797. By Günter Schwann 1 hour ago
> Fix test
This fix is suspicious. It works but I don’t really understand why. Can you please try to fix it in another way (it’s ok if you do that in a separate MR, let’s get this one merged for now).
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:797
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'debian/control' | |||
2 | --- debian/control 2013-07-30 22:58:47 +0000 | |||
3 | +++ debian/control 2013-08-08 12:38:17 +0000 | |||
4 | @@ -44,6 +44,7 @@ | |||
5 | 44 | gallery-app (>= ${source:Version}), | 44 | gallery-app (>= ${source:Version}), |
6 | 45 | libautopilot-qt, | 45 | libautopilot-qt, |
7 | 46 | libqt5test5, | 46 | libqt5test5, |
8 | 47 | ubuntu-ui-toolkit-autopilot, | ||
9 | 47 | Description: Autopilot tests for the photo gallery for Ubuntu | 48 | Description: Autopilot tests for the photo gallery for Ubuntu |
10 | 48 | gallery-app is a photo gallery for the Ubuntu platform. This package contains | 49 | gallery-app is a photo gallery for the Ubuntu platform. This package contains |
11 | 49 | autopilot tests for it. | 50 | autopilot tests for it. |
12 | 50 | 51 | ||
13 | === modified file 'rc/qml/MainScreen.qml' | |||
14 | --- rc/qml/MainScreen.qml 2013-06-28 17:43:13 +0000 | |||
15 | +++ rc/qml/MainScreen.qml 2013-08-08 12:38:17 +0000 | |||
16 | @@ -54,6 +54,7 @@ | |||
17 | 54 | } | 54 | } |
18 | 55 | 55 | ||
19 | 56 | Tab { | 56 | Tab { |
20 | 57 | objectName: "albumsTab" | ||
21 | 57 | title: i18n.tr("Albums") | 58 | title: i18n.tr("Albums") |
22 | 58 | page: Loader { | 59 | page: Loader { |
23 | 59 | id: albumsCheckerboardLoader | 60 | id: albumsCheckerboardLoader |
24 | 60 | 61 | ||
25 | === removed file 'tests/autopilot/gallery_app/emulators/events_view.py' | |||
26 | --- tests/autopilot/gallery_app/emulators/events_view.py 2013-07-04 08:37:56 +0000 | |||
27 | +++ tests/autopilot/gallery_app/emulators/events_view.py 1970-01-01 00:00:00 +0000 | |||
28 | @@ -1,28 +0,0 @@ | |||
29 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
30 | 2 | # Copyright 2012 Canonical | ||
31 | 3 | # | ||
32 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
33 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
34 | 6 | # by the Free Software Foundation. | ||
35 | 7 | |||
36 | 8 | from gallery_utils import GalleryUtils | ||
37 | 9 | |||
38 | 10 | |||
39 | 11 | class EventsView(GalleryUtils): | ||
40 | 12 | """An emulator class that makes it easy to interact with the event view of | ||
41 | 13 | gallery.""" | ||
42 | 14 | |||
43 | 15 | def __init__(self, app): | ||
44 | 16 | self.app = app | ||
45 | 17 | |||
46 | 18 | def get_toolbar_camera_button(self): | ||
47 | 19 | """Returns the camera button of the toolbar in the event view""" | ||
48 | 20 | return self.get_toolbar_named_toolbarbutton("cameraButton") | ||
49 | 21 | |||
50 | 22 | def get_toolbar_select_button(self): | ||
51 | 23 | """Returns the select button of the toolbar in the event view""" | ||
52 | 24 | return self.get_toolbar_named_toolbarbutton("selectButton") | ||
53 | 25 | |||
54 | 26 | def get_toolbar_delete_button(self): | ||
55 | 27 | """Returns the delete button of the toolbar in the event view""" | ||
56 | 28 | return self.get_toolbar_named_toolbarbutton("deleteButton") | ||
57 | 29 | 0 | ||
58 | === added file 'tests/autopilot/gallery_app/emulators/main_screen.py' | |||
59 | --- tests/autopilot/gallery_app/emulators/main_screen.py 1970-01-01 00:00:00 +0000 | |||
60 | +++ tests/autopilot/gallery_app/emulators/main_screen.py 2013-08-08 12:38:17 +0000 | |||
61 | @@ -0,0 +1,12 @@ | |||
62 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
63 | 2 | # Copyright 2013 Canonical | ||
64 | 3 | # | ||
65 | 4 | # This program is free software: you can redistribute it and/or modify it | ||
66 | 5 | # under the terms of the GNU General Public License version 3, as published | ||
67 | 6 | # by the Free Software Foundation. | ||
68 | 7 | |||
69 | 8 | from ubuntuuitoolkit import emulators as toolkit_emulators | ||
70 | 9 | |||
71 | 10 | |||
72 | 11 | class MainScreen(toolkit_emulators.MainView): | ||
73 | 12 | """An emulator class that makes it easy to interact with the gallery app""" | ||
74 | 0 | 13 | ||
75 | === modified file 'tests/autopilot/gallery_app/tests/__init__.py' | |||
76 | --- tests/autopilot/gallery_app/tests/__init__.py 2013-07-09 05:21:41 +0000 | |||
77 | +++ tests/autopilot/gallery_app/tests/__init__.py 2013-08-08 12:38:17 +0000 | |||
78 | @@ -16,6 +16,8 @@ | |||
79 | 16 | from autopilot.testcase import AutopilotTestCase | 16 | from autopilot.testcase import AutopilotTestCase |
80 | 17 | from testtools.matchers import Equals, GreaterThan | 17 | from testtools.matchers import Equals, GreaterThan |
81 | 18 | 18 | ||
82 | 19 | from ubuntuuitoolkit import emulators as toolkit_emulators | ||
83 | 20 | from gallery_app.emulators import main_screen | ||
84 | 19 | from gallery_app.emulators.gallery_utils import GalleryUtils | 21 | from gallery_app.emulators.gallery_utils import GalleryUtils |
85 | 20 | 22 | ||
86 | 21 | from time import sleep | 23 | from time import sleep |
87 | @@ -51,6 +53,10 @@ | |||
88 | 51 | def gallery_utils(self): | 53 | def gallery_utils(self): |
89 | 52 | return GalleryUtils(self.app) | 54 | return GalleryUtils(self.app) |
90 | 53 | 55 | ||
91 | 56 | @property | ||
92 | 57 | def main_view(self): | ||
93 | 58 | return self.app.select_single("MainScreen") | ||
94 | 59 | |||
95 | 54 | def setUp(self): | 60 | def setUp(self): |
96 | 55 | self.pointing_device = Pointer(self.input_device_class.create()) | 61 | self.pointing_device = Pointer(self.input_device_class.create()) |
97 | 56 | super(GalleryTestCase, self).setUp() | 62 | super(GalleryTestCase, self).setUp() |
98 | @@ -93,14 +99,16 @@ | |||
99 | 93 | self.ARGS.append(self.sample_destination_dir) | 99 | self.ARGS.append(self.sample_destination_dir) |
100 | 94 | self.app = self.launch_test_application( | 100 | self.app = self.launch_test_application( |
101 | 95 | self.local_location, | 101 | self.local_location, |
103 | 96 | *self.ARGS) | 102 | *self.ARGS, |
104 | 103 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | ||
105 | 97 | 104 | ||
106 | 98 | def launch_test_installed(self): | 105 | def launch_test_installed(self): |
107 | 99 | if model() == 'Desktop': | 106 | if model() == 'Desktop': |
108 | 100 | self.ARGS.append(self.sample_destination_dir) | 107 | self.ARGS.append(self.sample_destination_dir) |
109 | 101 | self.app = self.launch_test_application( | 108 | self.app = self.launch_test_application( |
110 | 102 | "gallery-app", | 109 | "gallery-app", |
112 | 103 | *self.ARGS) | 110 | *self.ARGS, |
113 | 111 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | ||
114 | 104 | else: | 112 | else: |
115 | 105 | self.ARGS.append("--desktop_file_hint=" | 113 | self.ARGS.append("--desktop_file_hint=" |
116 | 106 | "/usr/share/applications/gallery-app.desktop") | 114 | "/usr/share/applications/gallery-app.desktop") |
117 | @@ -108,7 +116,8 @@ | |||
118 | 108 | self.app = self.launch_test_application( | 116 | self.app = self.launch_test_application( |
119 | 109 | "gallery-app", | 117 | "gallery-app", |
120 | 110 | *self.ARGS, | 118 | *self.ARGS, |
122 | 111 | app_type='qt') | 119 | app_type='qt', |
123 | 120 | emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase) | ||
124 | 112 | 121 | ||
125 | 113 | def ui_update(self): | 122 | def ui_update(self): |
126 | 114 | """ Gives the program the time to update the UI""" | 123 | """ Gives the program the time to update the UI""" |
127 | @@ -134,23 +143,6 @@ | |||
128 | 134 | sleep(1) | 143 | sleep(1) |
129 | 135 | self.pointing_device.release() | 144 | self.pointing_device.release() |
130 | 136 | 145 | ||
131 | 137 | def reveal_toolbar(self): | ||
132 | 138 | toolbar = self.gallery_utils.get_toolbar() | ||
133 | 139 | self.assertThat(toolbar.animating, Eventually(Equals(False))) | ||
134 | 140 | |||
135 | 141 | if toolbar.active: | ||
136 | 142 | # Toolbar already open | ||
137 | 143 | return | ||
138 | 144 | |||
139 | 145 | main_view = self.gallery_utils.get_qml_view() | ||
140 | 146 | x, y, w, h = toolbar.globalRect | ||
141 | 147 | x_line = main_view.x + main_view.width * 0.5 | ||
142 | 148 | start_y = main_view.y + main_view.height - 1 | ||
143 | 149 | stop_y = start_y - 2 * h | ||
144 | 150 | |||
145 | 151 | self.pointing_device.drag(x_line, start_y, x_line, stop_y) | ||
146 | 152 | self.assertThat(toolbar.state, Eventually(Equals("spread"))) | ||
147 | 153 | |||
148 | 154 | def ensure_at_least_one_event(self): | 146 | def ensure_at_least_one_event(self): |
149 | 155 | """The event view has to have at least one event | 147 | """The event view has to have at least one event |
150 | 156 | In case gallery is not yet fully loaded wait a while and test again""" | 148 | In case gallery is not yet fully loaded wait a while and test again""" |
151 | 157 | 149 | ||
152 | === modified file 'tests/autopilot/gallery_app/tests/test_album_editor.py' | |||
153 | --- tests/autopilot/gallery_app/tests/test_album_editor.py 2013-06-26 09:02:33 +0000 | |||
154 | +++ tests/autopilot/gallery_app/tests/test_album_editor.py 2013-08-08 12:38:17 +0000 | |||
155 | @@ -125,7 +125,7 @@ | |||
156 | 125 | self.open_first_album() | 125 | self.open_first_album() |
157 | 126 | num_photos_start = self.album_view.number_of_photos() | 126 | num_photos_start = self.album_view.number_of_photos() |
158 | 127 | self.assertThat(num_photos_start, Equals(1)) | 127 | self.assertThat(num_photos_start, Equals(1)) |
160 | 128 | self.reveal_toolbar() | 128 | self.main_view.open_toolbar() |
161 | 129 | back = self.album_view.get_toolbar_back_icon() | 129 | back = self.album_view.get_toolbar_back_icon() |
162 | 130 | self.click_item(back) | 130 | self.click_item(back) |
163 | 131 | self.ensure_album_viewer_is_fully_closed() | 131 | self.ensure_album_viewer_is_fully_closed() |
164 | 132 | 132 | ||
165 | === modified file 'tests/autopilot/gallery_app/tests/test_album_view.py' | |||
166 | --- tests/autopilot/gallery_app/tests/test_album_view.py 2013-06-26 09:02:33 +0000 | |||
167 | +++ tests/autopilot/gallery_app/tests/test_album_view.py 2013-08-08 12:38:17 +0000 | |||
168 | @@ -61,7 +61,7 @@ | |||
169 | 61 | self.assertThat(num_photos_start, Equals(1)) | 61 | self.assertThat(num_photos_start, Equals(1)) |
170 | 62 | 62 | ||
171 | 63 | # open media selector but cancel | 63 | # open media selector but cancel |
173 | 64 | self.reveal_toolbar() | 64 | self.main_view.open_toolbar() |
174 | 65 | add_button = self.album_view.get_toolbar_add_button() | 65 | add_button = self.album_view.get_toolbar_add_button() |
175 | 66 | self.click_item(add_button) | 66 | self.click_item(add_button) |
176 | 67 | self.ensure_media_selector_is_fully_open() | 67 | self.ensure_media_selector_is_fully_open() |
177 | @@ -74,7 +74,7 @@ | |||
178 | 74 | self.assertThat(num_photos, Equals(num_photos_start)) | 74 | self.assertThat(num_photos, Equals(num_photos_start)) |
179 | 75 | 75 | ||
180 | 76 | # open media selector and add a photo | 76 | # open media selector and add a photo |
182 | 77 | self.reveal_toolbar() | 77 | self.main_view.open_toolbar() |
183 | 78 | add_button = self.album_view.get_toolbar_add_button() | 78 | add_button = self.album_view.get_toolbar_add_button() |
184 | 79 | self.click_item(add_button) | 79 | self.click_item(add_button) |
185 | 80 | self.ensure_media_selector_is_fully_open() | 80 | self.ensure_media_selector_is_fully_open() |
186 | @@ -89,7 +89,7 @@ | |||
187 | 89 | Eventually(Equals(num_photos_start + 1))) | 89 | Eventually(Equals(num_photos_start + 1))) |
188 | 90 | 90 | ||
189 | 91 | def test_add_photo_to_new_album(self): | 91 | def test_add_photo_to_new_album(self): |
191 | 92 | self.reveal_toolbar() | 92 | self.main_view.open_toolbar() |
192 | 93 | add_button = self.albums_view.get_toolbar_add_button() | 93 | add_button = self.albums_view.get_toolbar_add_button() |
193 | 94 | self.click_item(add_button) | 94 | self.click_item(add_button) |
194 | 95 | self.ui_update() | 95 | self.ui_update() |
195 | 96 | 96 | ||
196 | === modified file 'tests/autopilot/gallery_app/tests/test_albums_view.py' | |||
197 | --- tests/autopilot/gallery_app/tests/test_albums_view.py 2013-06-26 08:59:08 +0000 | |||
198 | +++ tests/autopilot/gallery_app/tests/test_albums_view.py 2013-08-08 12:38:17 +0000 | |||
199 | @@ -43,7 +43,7 @@ | |||
200 | 43 | 2""" | 43 | 2""" |
201 | 44 | self.compare_number_of_albums(1) | 44 | self.compare_number_of_albums(1) |
202 | 45 | 45 | ||
204 | 46 | self.reveal_toolbar() | 46 | self.main_view.open_toolbar() |
205 | 47 | add_button = self.albums_view.get_toolbar_add_button() | 47 | add_button = self.albums_view.get_toolbar_add_button() |
206 | 48 | self.click_item(add_button) | 48 | self.click_item(add_button) |
207 | 49 | 49 | ||
208 | 50 | 50 | ||
209 | === modified file 'tests/autopilot/gallery_app/tests/test_events_view.py' | |||
210 | --- tests/autopilot/gallery_app/tests/test_events_view.py 2013-07-04 08:37:56 +0000 | |||
211 | +++ tests/autopilot/gallery_app/tests/test_events_view.py 2013-08-08 12:38:17 +0000 | |||
212 | @@ -10,10 +10,9 @@ | |||
213 | 10 | 10 | ||
214 | 11 | from __future__ import absolute_import | 11 | from __future__ import absolute_import |
215 | 12 | 12 | ||
217 | 13 | from testtools.matchers import Equals | 13 | from testtools.matchers import Equals, Is |
218 | 14 | from autopilot.matchers import Eventually | 14 | from autopilot.matchers import Eventually |
219 | 15 | 15 | ||
220 | 16 | from gallery_app.emulators.events_view import EventsView | ||
221 | 17 | from gallery_app.tests import GalleryTestCase | 16 | from gallery_app.tests import GalleryTestCase |
222 | 18 | 17 | ||
223 | 19 | from os.path import exists | 18 | from os.path import exists |
224 | @@ -22,10 +21,6 @@ | |||
225 | 22 | class TestEventsView(GalleryTestCase): | 21 | class TestEventsView(GalleryTestCase): |
226 | 23 | """Tests the main gallery features""" | 22 | """Tests the main gallery features""" |
227 | 24 | 23 | ||
228 | 25 | @property | ||
229 | 26 | def events_view(self): | ||
230 | 27 | return EventsView(self.app) | ||
231 | 28 | |||
232 | 29 | def setUp(self): | 24 | def setUp(self): |
233 | 30 | self.ARGS = [] | 25 | self.ARGS = [] |
234 | 31 | # This is needed to wait for the application to start. | 26 | # This is needed to wait for the application to start. |
235 | @@ -35,16 +30,15 @@ | |||
236 | 35 | def tearDown(self): | 30 | def tearDown(self): |
237 | 36 | super(TestEventsView, self).tearDown() | 31 | super(TestEventsView, self).tearDown() |
238 | 37 | 32 | ||
239 | 33 | def get_events_view(self): | ||
240 | 34 | return self.gallery_utils.select_single_retry("EventsOverview", | ||
241 | 35 | objectName="organicEventView") | ||
242 | 36 | |||
243 | 38 | def enable_select_mode(self): | 37 | def enable_select_mode(self): |
250 | 39 | self.reveal_toolbar() | 38 | self.main_view.open_toolbar().click_button("selectButton") |
245 | 40 | self.click_select_icon() | ||
246 | 41 | |||
247 | 42 | def click_select_icon(self): | ||
248 | 43 | select_icon = self.events_view.get_toolbar_select_button() | ||
249 | 44 | self.click_item(select_icon) | ||
251 | 45 | 39 | ||
252 | 46 | def click_first_photo(self): | 40 | def click_first_photo(self): |
254 | 47 | first_photo = self.events_view.get_first_image_in_event_view() | 41 | first_photo = self.gallery_utils.get_first_image_in_event_view() |
255 | 48 | self.click_item(first_photo) | 42 | self.click_item(first_photo) |
256 | 49 | 43 | ||
257 | 50 | def get_delete_dialog(self): | 44 | def get_delete_dialog(self): |
258 | @@ -52,51 +46,51 @@ | |||
259 | 52 | self.assertThat(delete_dialog.opacity, Eventually(Equals(1))) | 46 | self.assertThat(delete_dialog.opacity, Eventually(Equals(1))) |
260 | 53 | return delete_dialog | 47 | return delete_dialog |
261 | 54 | 48 | ||
262 | 55 | def click_delete_action(self): | ||
263 | 56 | trash_button = self.events_view.get_toolbar_delete_button() | ||
264 | 57 | self.click_item(trash_button) | ||
265 | 58 | |||
266 | 59 | def test_select_button_cancel(self): | 49 | def test_select_button_cancel(self): |
267 | 60 | """Clicking the cancel button after clicking the select button must | 50 | """Clicking the cancel button after clicking the select button must |
268 | 61 | hide the toolbar automatically.""" | 51 | hide the toolbar automatically.""" |
269 | 52 | events_view = self.get_events_view() | ||
270 | 53 | self.assertFalse(events_view.inSelectionMode) | ||
271 | 54 | |||
272 | 62 | self.enable_select_mode() | 55 | self.enable_select_mode() |
273 | 56 | self.assertTrue(events_view.inSelectionMode) | ||
274 | 63 | 57 | ||
276 | 64 | cancel_icon = self.events_view.get_toolbar_cancel_icon() | 58 | cancel_icon = self.gallery_utils.get_toolbar_cancel_icon() |
277 | 65 | self.click_item(cancel_icon) | 59 | self.click_item(cancel_icon) |
278 | 66 | 60 | ||
281 | 67 | toolbar = self.events_view.get_toolbar() | 61 | toolbar = self.main_view.get_toolbar() |
282 | 68 | self.assertThat(toolbar.active, Eventually(Equals(False))) | 62 | self.assertThat(toolbar.opened, Eventually(Equals(False))) |
283 | 63 | self.assertFalse(events_view.inSelectionMode) | ||
284 | 69 | 64 | ||
285 | 70 | def test_delete_a_photo(self): | 65 | def test_delete_a_photo(self): |
286 | 71 | """Selecting a photo must make the delete button clickable.""" | 66 | """Selecting a photo must make the delete button clickable.""" |
288 | 72 | number_of_photos = self.events_view.number_of_photos_in_events() | 67 | number_of_photos = self.gallery_utils.number_of_photos_in_events() |
289 | 73 | self.enable_select_mode() | 68 | self.enable_select_mode() |
290 | 74 | self.click_first_photo() | 69 | self.click_first_photo() |
296 | 75 | self.click_delete_action() | 70 | self.main_view.open_toolbar().click_button("deleteButton") |
297 | 76 | 71 | ||
298 | 77 | delete_dialog = self.get_delete_dialog() | 72 | cancel_item = self.gallery_utils.get_delete_dialog_cancel_button() |
294 | 78 | |||
295 | 79 | cancel_item = self.events_view.get_delete_dialog_cancel_button() | ||
299 | 80 | self.click_item(cancel_item) | 73 | self.click_item(cancel_item) |
300 | 81 | 74 | ||
301 | 82 | self.assertThat(lambda: exists(self.sample_file), | 75 | self.assertThat(lambda: exists(self.sample_file), |
302 | 83 | Eventually(Equals(True))) | 76 | Eventually(Equals(True))) |
303 | 84 | 77 | ||
305 | 85 | new_number_of_photos = self.events_view.number_of_photos_in_events() | 78 | new_number_of_photos = self.gallery_utils.number_of_photos_in_events() |
306 | 86 | self.assertThat(new_number_of_photos, Equals(number_of_photos)) | 79 | self.assertThat(new_number_of_photos, Equals(number_of_photos)) |
307 | 87 | 80 | ||
313 | 88 | self.click_delete_action() | 81 | self.assertThat(lambda: self.gallery_utils.get_delete_dialog(), |
314 | 89 | 82 | Eventually(Is(None))) | |
315 | 90 | delete_dialog = self.get_delete_dialog() | 83 | |
316 | 91 | 84 | self.main_view.open_toolbar().click_button("deleteButton") | |
317 | 92 | delete_item = self.events_view.get_delete_dialog_delete_button() | 85 | |
318 | 86 | delete_item = self.gallery_utils.get_delete_dialog_delete_button() | ||
319 | 93 | self.click_item(delete_item) | 87 | self.click_item(delete_item) |
320 | 94 | 88 | ||
321 | 95 | self.assertThat(lambda: exists(self.sample_file), | 89 | self.assertThat(lambda: exists(self.sample_file), |
322 | 96 | Eventually(Equals(False))) | 90 | Eventually(Equals(False))) |
323 | 97 | 91 | ||
324 | 98 | self.ui_update() | 92 | self.ui_update() |
326 | 99 | new_number_of_photos = self.events_view.number_of_photos_in_events() | 93 | new_number_of_photos = self.gallery_utils.number_of_photos_in_events() |
327 | 100 | self.assertThat(new_number_of_photos, Equals(number_of_photos - 1)) | 94 | self.assertThat(new_number_of_photos, Equals(number_of_photos - 1)) |
328 | 101 | 95 | ||
329 | 102 | def test_adding_a_video(self): | 96 | def test_adding_a_video(self): |
330 | 103 | 97 | ||
331 | === modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py' | |||
332 | --- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-07-04 12:03:51 +0000 | |||
333 | +++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-08-08 12:38:17 +0000 | |||
334 | @@ -34,7 +34,7 @@ | |||
335 | 34 | self.ARGS = [] | 34 | self.ARGS = [] |
336 | 35 | super(TestPhotoViewerBase, self).setUp() | 35 | super(TestPhotoViewerBase, self).setUp() |
337 | 36 | self.open_first_photo() | 36 | self.open_first_photo() |
339 | 37 | self.reveal_toolbar() | 37 | self.main_view.open_toolbar() |
340 | 38 | 38 | ||
341 | 39 | def open_first_photo(self): | 39 | def open_first_photo(self): |
342 | 40 | self.assertThat(lambda: self.photo_viewer.number_of_photos_in_events(), | 40 | self.assertThat(lambda: self.photo_viewer.number_of_photos_in_events(), |
343 | @@ -75,32 +75,26 @@ | |||
344 | 75 | self.pointing_device.move_to_object(trash_button) | 75 | self.pointing_device.move_to_object(trash_button) |
345 | 76 | self.pointing_device.click() | 76 | self.pointing_device.click() |
346 | 77 | 77 | ||
347 | 78 | delete_dialog = self.get_delete_dialog() | ||
348 | 79 | |||
349 | 80 | cancel_item = self.photo_viewer.get_delete_popover_cancel_item() | 78 | cancel_item = self.photo_viewer.get_delete_popover_cancel_item() |
350 | 81 | self.click_item(cancel_item) | 79 | self.click_item(cancel_item) |
351 | 82 | 80 | ||
352 | 83 | self.assertThat(lambda: exists(self.sample_file), | 81 | self.assertThat(lambda: exists(self.sample_file), |
353 | 84 | Eventually(Equals(True))) | 82 | Eventually(Equals(True))) |
354 | 85 | 83 | ||
356 | 86 | self.reveal_toolbar() | 84 | self.main_view.open_toolbar() |
357 | 87 | 85 | ||
358 | 88 | self.pointing_device.move_to_object(trash_button) | 86 | self.pointing_device.move_to_object(trash_button) |
359 | 89 | self.pointing_device.click() | 87 | self.pointing_device.click() |
360 | 90 | 88 | ||
361 | 91 | delete_dialog = self.get_delete_dialog() | ||
362 | 92 | |||
363 | 93 | delete_item = self.photo_viewer.get_delete_popover_delete_item() | 89 | delete_item = self.photo_viewer.get_delete_popover_delete_item() |
364 | 94 | self.click_item(delete_item) | 90 | self.click_item(delete_item) |
365 | 95 | 91 | ||
366 | 96 | self.assertThat(lambda: exists(self.sample_file), | 92 | self.assertThat(lambda: exists(self.sample_file), |
367 | 97 | Eventually(Equals(False))) | 93 | Eventually(Equals(False))) |
368 | 98 | 94 | ||
370 | 99 | self.reveal_toolbar() | 95 | self.main_view.open_toolbar() |
371 | 100 | self.pointing_device.click_object(trash_button) | 96 | self.pointing_device.click_object(trash_button) |
372 | 101 | 97 | ||
373 | 102 | delete_dialog = self.get_delete_dialog() | ||
374 | 103 | |||
375 | 104 | delete_item = self.photo_viewer.get_delete_popover_delete_item() | 98 | delete_item = self.photo_viewer.get_delete_popover_delete_item() |
376 | 105 | self.click_item(delete_item) | 99 | self.click_item(delete_item) |
377 | 106 | 100 | ||
378 | @@ -240,7 +234,7 @@ | |||
379 | 240 | is_landscape = opened_photo.paintedWidth > opened_photo.paintedHeight | 234 | is_landscape = opened_photo.paintedWidth > opened_photo.paintedHeight |
380 | 241 | self.assertThat(is_landscape, Equals(False)) | 235 | self.assertThat(is_landscape, Equals(False)) |
381 | 242 | 236 | ||
383 | 243 | self.reveal_toolbar() | 237 | self.main_view.open_toolbar() |
384 | 244 | self.click_edit_button() | 238 | self.click_edit_button() |
385 | 245 | self.click_undo_item() | 239 | self.click_undo_item() |
386 | 246 | 240 | ||
387 | @@ -249,7 +243,7 @@ | |||
388 | 249 | is_landscape = opened_photo.paintedWidth > opened_photo.paintedHeight | 243 | is_landscape = opened_photo.paintedWidth > opened_photo.paintedHeight |
389 | 250 | self.assertThat(is_landscape, Equals(True)) | 244 | self.assertThat(is_landscape, Equals(True)) |
390 | 251 | 245 | ||
392 | 252 | self.reveal_toolbar() | 246 | self.main_view.open_toolbar() |
393 | 253 | self.click_edit_button() | 247 | self.click_edit_button() |
394 | 254 | self.click_redo_item() | 248 | self.click_redo_item() |
395 | 255 | 249 | ||
396 | @@ -258,10 +252,10 @@ | |||
397 | 258 | is_landscape = opened_photo.paintedWidth > opened_photo.paintedHeight | 252 | is_landscape = opened_photo.paintedWidth > opened_photo.paintedHeight |
398 | 259 | self.assertThat(is_landscape, Equals(False)) | 253 | self.assertThat(is_landscape, Equals(False)) |
399 | 260 | 254 | ||
401 | 261 | self.reveal_toolbar() | 255 | self.main_view.open_toolbar() |
402 | 262 | self.click_edit_button() | 256 | self.click_edit_button() |
403 | 263 | self.click_rotate_item() | 257 | self.click_rotate_item() |
405 | 264 | self.reveal_toolbar() | 258 | self.main_view.open_toolbar() |
406 | 265 | self.click_edit_button() | 259 | self.click_edit_button() |
407 | 266 | self.click_revert_item() | 260 | self.click_revert_item() |
408 | 267 | 261 | ||
409 | @@ -287,7 +281,7 @@ | |||
410 | 287 | 281 | ||
411 | 288 | self.click_rotate_item() | 282 | self.click_rotate_item() |
412 | 289 | 283 | ||
414 | 290 | self.reveal_toolbar() | 284 | self.main_view.open_toolbar() |
415 | 291 | self.click_edit_button() | 285 | self.click_edit_button() |
416 | 292 | undo_item = self.photo_viewer.get_undo_menu_item() | 286 | undo_item = self.photo_viewer.get_undo_menu_item() |
417 | 293 | redo_item = self.photo_viewer.get_redo_menu_item() | 287 | redo_item = self.photo_viewer.get_redo_menu_item() |
418 | @@ -299,7 +293,7 @@ | |||
419 | 299 | 293 | ||
420 | 300 | self.click_undo_item() | 294 | self.click_undo_item() |
421 | 301 | 295 | ||
423 | 302 | self.reveal_toolbar() | 296 | self.main_view.open_toolbar() |
424 | 303 | self.click_edit_button() | 297 | self.click_edit_button() |
425 | 304 | undo_item = self.photo_viewer.get_undo_menu_item() | 298 | undo_item = self.photo_viewer.get_undo_menu_item() |
426 | 305 | redo_item = self.photo_viewer.get_redo_menu_item() | 299 | redo_item = self.photo_viewer.get_redo_menu_item() |
427 | @@ -311,7 +305,7 @@ | |||
428 | 311 | 305 | ||
429 | 312 | self.click_redo_item() | 306 | self.click_redo_item() |
430 | 313 | 307 | ||
432 | 314 | self.reveal_toolbar() | 308 | self.main_view.open_toolbar() |
433 | 315 | self.click_edit_button() | 309 | self.click_edit_button() |
434 | 316 | undo_item = self.photo_viewer.get_undo_menu_item() | 310 | undo_item = self.photo_viewer.get_undo_menu_item() |
435 | 317 | redo_item = self.photo_viewer.get_redo_menu_item() | 311 | redo_item = self.photo_viewer.get_redo_menu_item() |
436 | @@ -323,7 +317,7 @@ | |||
437 | 323 | 317 | ||
438 | 324 | self.click_revert_item() | 318 | self.click_revert_item() |
439 | 325 | 319 | ||
441 | 326 | self.reveal_toolbar() | 320 | self.main_view.open_toolbar() |
442 | 327 | self.click_edit_button() | 321 | self.click_edit_button() |
443 | 328 | undo_item = self.photo_viewer.get_undo_menu_item() | 322 | undo_item = self.photo_viewer.get_undo_menu_item() |
444 | 329 | redo_item = self.photo_viewer.get_redo_menu_item() | 323 | redo_item = self.photo_viewer.get_redo_menu_item() |
445 | @@ -333,12 +327,10 @@ | |||
446 | 333 | self.assertThat(redo_item.enabled, Eventually(Equals(False))) | 327 | self.assertThat(redo_item.enabled, Eventually(Equals(False))) |
447 | 334 | self.assertThat(revert_item.enabled, Eventually(Equals(False))) | 328 | self.assertThat(revert_item.enabled, Eventually(Equals(False))) |
448 | 335 | 329 | ||
458 | 336 | # disabled the test, as with the current implementation the UI is | 330 | self.click_enhance_item() |
459 | 337 | # blocked. This causes troubles on jenkins | 331 | |
460 | 338 | #self.click_enhance_item() | 332 | self.main_view.open_toolbar() |
461 | 339 | 333 | self.click_edit_button() | |
462 | 340 | #self.reveal_toolbar() | 334 | |
463 | 341 | #self.click_edit_button() | 335 | revert_item = self.photo_viewer.get_revert_menu_item() |
464 | 342 | 336 | self.assertThat(lambda: revert_item.enabled, Eventually(Equals(True))) | |
456 | 343 | #revert_item = self.photo_viewer.get_revert_menu_item() | ||
457 | 344 | #self.assertThat(lambda: revert_item.enabled, Eventually(Equals(True))) | ||
465 | 345 | 337 | ||
466 | === modified file 'tests/autopilot/gallery_app/tests/test_photos_view.py' | |||
467 | --- tests/autopilot/gallery_app/tests/test_photos_view.py 2013-07-02 08:47:23 +0000 | |||
468 | +++ tests/autopilot/gallery_app/tests/test_photos_view.py 2013-08-08 12:38:17 +0000 | |||
469 | @@ -45,7 +45,7 @@ | |||
470 | 45 | self.ensure_tabs_dont_move() | 45 | self.ensure_tabs_dont_move() |
471 | 46 | 46 | ||
472 | 47 | def enable_select_mode(self): | 47 | def enable_select_mode(self): |
474 | 48 | self.reveal_toolbar() | 48 | self.main_view.open_toolbar() |
475 | 49 | self.click_select_icon() | 49 | self.click_select_icon() |
476 | 50 | 50 | ||
477 | 51 | def click_select_icon(self): | 51 | def click_select_icon(self): |
478 | @@ -88,8 +88,6 @@ | |||
479 | 88 | self.click_first_photo() | 88 | self.click_first_photo() |
480 | 89 | self.click_delete_action() | 89 | self.click_delete_action() |
481 | 90 | 90 | ||
482 | 91 | delete_dialog = self.get_delete_dialog() | ||
483 | 92 | |||
484 | 93 | cancel_item = self.photos_view.get_delete_dialog_cancel_button() | 91 | cancel_item = self.photos_view.get_delete_dialog_cancel_button() |
485 | 94 | self.click_item(cancel_item) | 92 | self.click_item(cancel_item) |
486 | 95 | 93 | ||
487 | @@ -101,8 +99,6 @@ | |||
488 | 101 | 99 | ||
489 | 102 | self.click_delete_action() | 100 | self.click_delete_action() |
490 | 103 | 101 | ||
491 | 104 | delete_dialog = self.get_delete_dialog() | ||
492 | 105 | |||
493 | 106 | delete_item = self.photos_view.get_delete_dialog_delete_button() | 102 | delete_item = self.photos_view.get_delete_dialog_delete_button() |
494 | 107 | self.click_item(delete_item) | 103 | self.click_item(delete_item) |
495 | 108 | 104 | ||
496 | 109 | 105 | ||
497 | === modified file 'tests/autopilot/gallery_app/tests/test_picker_mode.py' | |||
498 | --- tests/autopilot/gallery_app/tests/test_picker_mode.py 2013-06-26 08:59:08 +0000 | |||
499 | +++ tests/autopilot/gallery_app/tests/test_picker_mode.py 2013-08-08 12:38:17 +0000 | |||
500 | @@ -16,9 +16,6 @@ | |||
501 | 16 | from gallery_app.emulators.picker_mode import PickerMode | 16 | from gallery_app.emulators.picker_mode import PickerMode |
502 | 17 | from gallery_app.tests import GalleryTestCase | 17 | from gallery_app.tests import GalleryTestCase |
503 | 18 | 18 | ||
504 | 19 | from os.path import exists | ||
505 | 20 | from time import sleep | ||
506 | 21 | |||
507 | 22 | 19 | ||
508 | 23 | class TestPickerMode(GalleryTestCase): | 20 | class TestPickerMode(GalleryTestCase): |
509 | 24 | 21 |
FAILED: Continuous integration, rev:793 jenkins. qa.ubuntu. com/job/ gallery- app-ci/ 378/ jenkins. qa.ubuntu. com/job/ gallery- app-saucy- amd64-ci/ 188 jenkins. qa.ubuntu. com/job/ gallery- app-saucy- armhf-ci/ 188 jenkins. qa.ubuntu. com/job/ gallery- app-saucy- armhf-ci/ 188/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ gallery- app-saucy- i386-ci/ 188 jenkins. qa.ubuntu. com/job/ generic- mediumtests- saucy/1848 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1853 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- saucy/1853/ artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- mediumtests- runner- saucy/1580
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ gallery- app-ci/ 378/rebuild
http://