Merge lp:~ahayzen/music-app/fix-1613328-autopilot-tests into lp:music-app
- fix-1613328-autopilot-tests
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alan Pope πΊπ§π± π¦ | ||||
Approved revision: | 1018 | ||||
Merged at revision: | 1014 | ||||
Proposed branch: | lp:~ahayzen/music-app/fix-1613328-autopilot-tests | ||||
Merge into: | lp:music-app | ||||
Diff against target: |
484 lines (+89/-19) 13 files modified
app/components/HeadState/EmptyHeadState.qml (+4/-0) app/components/HeadState/PlaylistHeadState.qml (+5/-0) app/components/HeadState/PlaylistsHeadState.qml (+5/-0) app/components/HeadState/QueueHeadState.qml (+4/-0) app/components/HeadState/SearchableHeadState.qml (+4/-0) app/components/MusicPage.qml (+2/-0) app/components/NowPlayingSidebar.qml (+2/-0) app/music-app.qml (+14/-4) app/ui/NowPlaying.qml (+3/-0) app/ui/Recent.qml (+4/-0) debian/changelog (+2/-0) tests/autopilot/music_app/__init__.py (+34/-12) tests/autopilot/music_app/tests/test_music.py (+6/-3) |
||||
To merge this branch: | bzr merge lp:~ahayzen/music-app/fix-1613328-autopilot-tests | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Peeters (community) | Approve | ||
Zoltan Balogh (community) | Approve | ||
Jenkins Bot | continuous-integration | Approve | |
Andrew Hayzen | Abstain | ||
Review via email: mp+302955@code.launchpad.net |
Commit message
* Fix for autopilot using switch_to_tab instead of leadingActionBar
* Fix for duplicate Toolbars being created, confusing autopilot
Description of the change
* Fix for autopilot using switch_to_tab instead of leadingActionBar
* Fix for duplicate Toolbars being created, confusing autopilot
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:1013
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1014. By Andrew Hayzen
-
* Further fixes for ActionBar changes
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:1014
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1015. By Andrew Hayzen
-
* Fix for loading not unloading when using active, instead set source to empty string as per docs
- 1016. By Andrew Hayzen
-
* Update changelog
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:1015
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Andrew Hayzen (ahayzen) wrote : | # |
This is now passing autopilot \o/
adt-run [23:42:32]: test autopilot: - - - - - - - - - - results - - - - - - - - - -
autopilot PASS
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:1016
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1017. By Andrew Hayzen
-
* Fix for some console errors
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:1017
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 1018. By Andrew Hayzen
-
* Fix for flaky test
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:1018
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Zoltan Balogh (bzoltan) wrote : | # |
Pushed this patch to krillin and run the tests ->
$ phablet-test-run music_app
Loading tests from: /home/phablet/
Tests running...
Ran 20 tests in 520.130s
O
Tim Peeters (tpeeters) wrote : | # |
Nice!
Thanks for the quick update.
Preview Diff
1 | === modified file 'app/components/HeadState/EmptyHeadState.qml' |
2 | --- app/components/HeadState/EmptyHeadState.qml 2016-03-28 09:50:01 +0000 |
3 | +++ app/components/HeadState/EmptyHeadState.qml 2016-08-15 23:35:51 +0000 |
4 | @@ -30,8 +30,11 @@ |
5 | tabs.tabActions |
6 | } else if (mainPageStack.depth > 1) { |
7 | backActionComponent |
8 | + } else { |
9 | + null |
10 | } |
11 | } |
12 | + objectName: "tabsLeadingActionBar" |
13 | } |
14 | title: thisPage.title |
15 | visible: thisPage.state === "default" |
16 | @@ -39,6 +42,7 @@ |
17 | Action { |
18 | id: backActionComponent |
19 | iconName: "back" |
20 | + objectName: "backAction" |
21 | onTriggered: mainPageStack.pop() |
22 | } |
23 | |
24 | |
25 | === modified file 'app/components/HeadState/PlaylistHeadState.qml' |
26 | --- app/components/HeadState/PlaylistHeadState.qml 2016-03-28 09:50:01 +0000 |
27 | +++ app/components/HeadState/PlaylistHeadState.qml 2016-08-15 23:35:51 +0000 |
28 | @@ -32,8 +32,11 @@ |
29 | tabs.tabActions |
30 | } else if (mainPageStack.depth > 1) { |
31 | backActionComponent |
32 | + } else { |
33 | + null |
34 | } |
35 | } |
36 | + objectName: "tabsLeadingActionBar" |
37 | } |
38 | title: thisPage.title |
39 | trailingActionBar { |
40 | @@ -55,12 +58,14 @@ |
41 | } |
42 | } |
43 | ] |
44 | + objectName: "playlistTrailingActionBar" |
45 | } |
46 | visible: thisPage.state === "playlist" |
47 | |
48 | Action { |
49 | id: backActionComponent |
50 | iconName: "back" |
51 | + objectName: "backAction" |
52 | onTriggered: mainPageStack.pop() |
53 | } |
54 | |
55 | |
56 | === modified file 'app/components/HeadState/PlaylistsHeadState.qml' |
57 | --- app/components/HeadState/PlaylistsHeadState.qml 2016-03-28 09:50:01 +0000 |
58 | +++ app/components/HeadState/PlaylistsHeadState.qml 2016-08-15 23:35:51 +0000 |
59 | @@ -34,8 +34,11 @@ |
60 | tabs.tabActions |
61 | } else if (mainPageStack.depth > 1) { |
62 | backActionComponent |
63 | + } else { |
64 | + null |
65 | } |
66 | } |
67 | + objectName: "tabsLeadingActionBar" |
68 | } |
69 | title: thisPage.title |
70 | trailingActionBar { |
71 | @@ -58,12 +61,14 @@ |
72 | } |
73 | } |
74 | ] |
75 | + objectName: "playlistTrailingActionBar" |
76 | } |
77 | visible: thisPage.state === "default" |
78 | |
79 | Action { |
80 | id: backActionComponent |
81 | iconName: "back" |
82 | + objectName: "backAction" |
83 | onTriggered: mainPageStack.pop() |
84 | } |
85 | |
86 | |
87 | === modified file 'app/components/HeadState/QueueHeadState.qml' |
88 | --- app/components/HeadState/QueueHeadState.qml 2016-04-06 02:18:12 +0000 |
89 | +++ app/components/HeadState/QueueHeadState.qml 2016-08-15 23:35:51 +0000 |
90 | @@ -35,8 +35,11 @@ |
91 | tabs.tabActions |
92 | } else if (mainPageStack.depth > 1) { |
93 | backActionComponent |
94 | + } else { |
95 | + null |
96 | } |
97 | } |
98 | + objectName: "tabsLeadingActionBar" |
99 | } |
100 | title: thisPage.title |
101 | trailingActionBar { |
102 | @@ -72,6 +75,7 @@ |
103 | Action { |
104 | id: backActionComponent |
105 | iconName: "back" |
106 | + objectName: "backAction" |
107 | onTriggered: mainPageStack.pop() |
108 | } |
109 | |
110 | |
111 | === modified file 'app/components/HeadState/SearchableHeadState.qml' |
112 | --- app/components/HeadState/SearchableHeadState.qml 2016-03-04 04:28:21 +0000 |
113 | +++ app/components/HeadState/SearchableHeadState.qml 2016-08-15 23:35:51 +0000 |
114 | @@ -33,8 +33,11 @@ |
115 | tabs.tabActions |
116 | } else if (mainPageStack.depth > 1) { |
117 | backActionComponent |
118 | + } else { |
119 | + null |
120 | } |
121 | } |
122 | + objectName: "tabsLeadingActionBar" |
123 | } |
124 | title: thisPage.title |
125 | trailingActionBar { |
126 | @@ -54,6 +57,7 @@ |
127 | Action { |
128 | id: backActionComponent |
129 | iconName: "back" |
130 | + objectName: "backAction" |
131 | onTriggered: mainPageStack.pop() |
132 | } |
133 | |
134 | |
135 | === modified file 'app/components/MusicPage.qml' |
136 | --- app/components/MusicPage.qml 2016-03-28 09:02:31 +0000 |
137 | +++ app/components/MusicPage.qml 2016-08-15 23:35:51 +0000 |
138 | @@ -53,6 +53,7 @@ |
139 | null |
140 | } |
141 | } |
142 | + objectName: "tabsLeadingActionBar" |
143 | } |
144 | title: thisPage.title |
145 | |
146 | @@ -64,6 +65,7 @@ |
147 | Action { |
148 | id: backActionComponent |
149 | iconName: "back" |
150 | + objectName: "backAction" |
151 | onTriggered: mainPageStack.pop() |
152 | } |
153 | } |
154 | |
155 | === modified file 'app/components/NowPlayingSidebar.qml' |
156 | --- app/components/NowPlayingSidebar.qml 2016-03-04 03:14:29 +0000 |
157 | +++ app/components/NowPlayingSidebar.qml 2016-08-15 23:35:51 +0000 |
158 | @@ -34,6 +34,7 @@ |
159 | thisHeader { |
160 | leadingActionBar { |
161 | actions: [] // hide tab bar |
162 | + objectName: "sideLeadingActionBar" |
163 | } |
164 | z: 100 // put on top of content |
165 | } |
166 | @@ -61,6 +62,7 @@ |
167 | id: pageHeader |
168 | leadingActionBar { |
169 | actions: nowPlayingSidebar.head.backAction |
170 | + objectName: "sideLeadingActionBar" |
171 | } |
172 | flickable: queue |
173 | trailingActionBar { |
174 | |
175 | === modified file 'app/music-app.qml' |
176 | --- app/music-app.qml 2016-08-03 21:15:31 +0000 |
177 | +++ app/music-app.qml 2016-08-15 23:35:51 +0000 |
178 | @@ -640,6 +640,7 @@ |
179 | property list<Action> tabActions: [ |
180 | Action { |
181 | enabled: recentTabRepeater.count > 0 |
182 | + objectName: "recentTabAction" |
183 | text: enabled ? recentTabRepeater.itemAt(0).title : "" |
184 | visible: enabled |
185 | |
186 | @@ -650,22 +651,27 @@ |
187 | } |
188 | }, |
189 | Action { |
190 | + objectName: "artistsTabAction" |
191 | text: artistsTab.title |
192 | onTriggered: tabs.selectedTabIndex = artistsTab.index |
193 | }, |
194 | Action { |
195 | + objectName: "albumsTabAction" |
196 | text: albumsTab.title |
197 | onTriggered: tabs.selectedTabIndex = albumsTab.index |
198 | }, |
199 | Action { |
200 | + objectName: "genresTabAction" |
201 | text: genresTab.title |
202 | onTriggered: tabs.selectedTabIndex = genresTab.index |
203 | }, |
204 | Action { |
205 | + objectName: "songsTabAction" |
206 | text: songsTab.title |
207 | onTriggered: tabs.selectedTabIndex = songsTab.index |
208 | }, |
209 | Action { |
210 | + objectName: "playlistsTabAction" |
211 | text: playlistsTab.title |
212 | onTriggered: tabs.selectedTabIndex = playlistsTab.index |
213 | } |
214 | @@ -890,7 +896,6 @@ |
215 | |
216 | Loader { |
217 | id: nowPlayingSidebarLoader |
218 | - active: shown || anchors.leftMargin < 0 |
219 | anchors { // start offscreen |
220 | bottom: parent.bottom |
221 | left: parent.right |
222 | @@ -898,7 +903,10 @@ |
223 | top: parent.top |
224 | } |
225 | asynchronous: true |
226 | - source: "components/NowPlayingSidebar.qml" |
227 | + // use source as empty string instead of active false otherwise item |
228 | + // isn't fully unloaded and appears in autopilot twice |
229 | + // http://doc.qt.io/qt-5/qml-qtquick-loader.html#source-prop |
230 | + source: shown || anchors.leftMargin < 0 ? "components/NowPlayingSidebar.qml" : "" |
231 | visible: width > 0 |
232 | width: units.gu(40) |
233 | |
234 | @@ -913,7 +921,6 @@ |
235 | |
236 | Loader { |
237 | id: musicToolbar |
238 | - active: !wideAspect || anchors.topMargin < 0 |
239 | anchors { |
240 | left: parent.left |
241 | right: parent.right |
242 | @@ -921,7 +928,10 @@ |
243 | topMargin: !wideAspect && status === Loader.Ready ? -height : 0 |
244 | } |
245 | asynchronous: true |
246 | - source: "components/MusicToolbar.qml" |
247 | + // use source as empty string instead of active false otherwise item |
248 | + // isn't fully unloaded and appears in autopilot twice |
249 | + // http://doc.qt.io/qt-5/qml-qtquick-loader.html#source-prop |
250 | + source: !wideAspect || anchors.topMargin < 0 ? "components/MusicToolbar.qml" : "" |
251 | visible: (mainPageStack.currentPage && (mainPageStack.currentPage.showToolbar || mainPageStack.currentPage.showToolbar === undefined)) && |
252 | !firstRun && |
253 | !noMusic && |
254 | |
255 | === modified file 'app/ui/NowPlaying.qml' |
256 | --- app/ui/NowPlaying.qml 2016-04-06 02:18:12 +0000 |
257 | +++ app/ui/NowPlaying.qml 2016-08-15 23:35:51 +0000 |
258 | @@ -50,6 +50,7 @@ |
259 | thisHeader { |
260 | extension: Sections { |
261 | model: defaultStateSections.model |
262 | + objectName: "nowPlayingSections" |
263 | selectedIndex: 0 |
264 | |
265 | onSelectedIndexChanged: { |
266 | @@ -67,6 +68,7 @@ |
267 | thisHeader { |
268 | extension: Sections { |
269 | model: defaultStateSections.model |
270 | + objectName: "nowPlayingSections" |
271 | selectedIndex: 1 |
272 | |
273 | onSelectedIndexChanged: { |
274 | @@ -87,6 +89,7 @@ |
275 | thisHeader { |
276 | extension: Sections { |
277 | model: defaultStateSections.model |
278 | + objectName: "nowPlayingSections" |
279 | selectedIndex: 1 |
280 | |
281 | onSelectedIndexChanged: { |
282 | |
283 | === modified file 'app/ui/Recent.qml' |
284 | --- app/ui/Recent.qml 2016-03-07 20:01:22 +0000 |
285 | +++ app/ui/Recent.qml 2016-08-15 23:35:51 +0000 |
286 | @@ -39,8 +39,11 @@ |
287 | tabs.tabActions |
288 | } else if (mainPageStack.depth > 1) { |
289 | backActionComponent |
290 | + } else { |
291 | + null |
292 | } |
293 | } |
294 | + objectName: "tabsLeadingActionBar" |
295 | } |
296 | title: recentPage.title |
297 | trailingActionBar { |
298 | @@ -59,6 +62,7 @@ |
299 | Action { |
300 | id: backActionComponent |
301 | iconName: "back" |
302 | + objectName: "backAction" |
303 | onTriggered: mainPageStack.pop() |
304 | } |
305 | |
306 | |
307 | === modified file 'debian/changelog' |
308 | --- debian/changelog 2016-08-03 21:15:31 +0000 |
309 | +++ debian/changelog 2016-08-15 23:35:51 +0000 |
310 | @@ -2,6 +2,8 @@ |
311 | |
312 | * Release 2.4 and start 2.5 |
313 | * Remove gstreamer0.10-fluendo-mp3 plugin from control as 1.0 should instead be used |
314 | + * Fix for autopilot using switch_to_tab instead of leadingActionBar (LP: #1613328). |
315 | + * Fix for duplicate Toolbars being created, confusing autopilot |
316 | |
317 | -- Andrew Hayzen <ahayzen@gmail.com> Wed, 03 Aug 2016 21:57:36 +0100 |
318 | |
319 | |
320 | === modified file 'tests/autopilot/music_app/__init__.py' |
321 | --- tests/autopilot/music_app/__init__.py 2016-01-18 16:16:27 +0000 |
322 | +++ tests/autopilot/music_app/__init__.py 2016-08-15 23:35:51 +0000 |
323 | @@ -60,7 +60,7 @@ |
324 | objectName="addToPlaylistPage") |
325 | |
326 | def get_albums_page(self): |
327 | - self.main_view.switch_to_tab('albumsTab') |
328 | + self.main_view.switch_to_tab_wrapper('albumsTabAction') |
329 | |
330 | return self.main_view.wait_select_single( |
331 | Albums, objectName='albumsPage') |
332 | @@ -70,7 +70,7 @@ |
333 | ArtistView, objectName='artistViewPage') |
334 | |
335 | def get_artists_page(self): |
336 | - self.main_view.switch_to_tab('artistsTab') |
337 | + self.main_view.switch_to_tab_wrapper('artistsTabAction') |
338 | |
339 | return self.main_view.wait_select_single( |
340 | Artists, objectName='artistsPage') |
341 | @@ -88,7 +88,7 @@ |
342 | objectName="nowPlayingPage") |
343 | |
344 | def get_playlists_page(self): |
345 | - self.main_view.switch_to_tab('playlistsTab') |
346 | + self.main_view.switch_to_tab_wrapper('playlistsTabAction') |
347 | |
348 | return self.main_view.wait_select_single( |
349 | Playlists, objectName='playlistsPage') |
350 | @@ -100,11 +100,12 @@ |
351 | return self.app.wait_select_single(SongsView, objectName="songsPage") |
352 | |
353 | def get_toolbar(self): |
354 | - return self.app.wait_select_single(MusicToolbar, |
355 | - objectName="musicToolbarObject") |
356 | + return self.app.wait_select_single( |
357 | + MusicToolbar, objectName="musicToolbarObject", visible=True, |
358 | + ) |
359 | |
360 | def get_songs_page(self): |
361 | - self.main_view.switch_to_tab('songsTab') |
362 | + self.main_view.switch_to_tab_wrapper('songsTabAction') |
363 | |
364 | return self.main_view.wait_select_single( |
365 | Songs, objectName='songsPage') |
366 | @@ -228,8 +229,9 @@ |
367 | "MusicGridView", objectName="playlistsGridView").count |
368 | |
369 | def click_new_playlist_action(self): |
370 | - self.main_view.get_header( |
371 | - ).click_action_button("newPlaylistButton") |
372 | + self.wait_select_single( |
373 | + "ActionBar", objectName="playlistTrailingActionBar", visible=True, |
374 | + ).click_action_button("newPlaylistButton") |
375 | |
376 | @click_object |
377 | def click_playlist(self, i): |
378 | @@ -248,7 +250,9 @@ |
379 | self.visible.wait_for(True) |
380 | |
381 | def click_new_playlist_action(self): |
382 | - self.main_view.get_header().click_action_button("newPlaylistButton") |
383 | + self.wait_select_single( |
384 | + "ActionBar", objectName="playlistTrailingActionBar", visible=True, |
385 | + ).click_action_button("newPlaylistButton") |
386 | |
387 | @click_object |
388 | def click_playlist(self, i): |
389 | @@ -284,7 +288,7 @@ |
390 | return self.wait_select_single("*", objectName="forwardShape") |
391 | |
392 | def click_full_view(self): |
393 | - self.main_view.get_header().switch_to_section_by_index(0) |
394 | + self.get_sections().click_section_button(0) |
395 | |
396 | @ensure_now_playing_full |
397 | @click_object |
398 | @@ -297,7 +301,7 @@ |
399 | return self.wait_select_single("*", objectName="previousShape") |
400 | |
401 | def click_queue_view(self): |
402 | - self.main_view.get_header().switch_to_section_by_index(1) |
403 | + self.get_sections().click_section_button(1) |
404 | |
405 | @ensure_now_playing_full |
406 | @click_object |
407 | @@ -313,6 +317,11 @@ |
408 | def click_track(self, i): |
409 | return self.get_track(i) |
410 | |
411 | + def get_sections(self): |
412 | + return self.wait_select_single( |
413 | + "Sections", objectName="nowPlayingSections", visible=True, |
414 | + ) |
415 | + |
416 | @ensure_now_playing_list |
417 | def get_track(self, i): |
418 | return (self.wait_select_single(MusicListItem, |
419 | @@ -375,7 +384,9 @@ |
420 | self.visible.wait_for(True) |
421 | |
422 | def click_delete_playlist_action(self): |
423 | - self.main_view.get_header().click_action_button("deletePlaylist") |
424 | + self.wait_select_single( |
425 | + "ActionBar", objectName="playlistTrailingActionBar", visible=True, |
426 | + ).click_action_button("deletePlaylist") |
427 | |
428 | @click_object |
429 | def click_track(self, i): |
430 | @@ -463,3 +474,14 @@ |
431 | spinner = self.wait_select_single("ActivityIndicator", |
432 | objectName="LoadingSpinner") |
433 | spinner.running.wait_for(False) |
434 | + |
435 | + def go_back_wrapper(self): |
436 | + self.wait_select_single( |
437 | + "ActionBar", objectName="tabsLeadingActionBar", visible=True, |
438 | + ).click_action_button("backAction") |
439 | + |
440 | + def switch_to_tab_wrapper(self, objectName): |
441 | + # We use leadingActionBar instead of Tabs so create wrapper |
442 | + self.wait_select_single( |
443 | + "ActionBar", objectName="tabsLeadingActionBar", visible=True, |
444 | + ).click_action_button(objectName) |
445 | |
446 | === modified file 'tests/autopilot/music_app/tests/test_music.py' |
447 | --- tests/autopilot/music_app/tests/test_music.py 2016-01-26 00:01:12 +0000 |
448 | +++ tests/autopilot/music_app/tests/test_music.py 2016-08-15 23:35:51 +0000 |
449 | @@ -123,7 +123,7 @@ |
450 | Equals(self.tracks[0]["title"])) |
451 | |
452 | # click on close button to close the page and now playing page |
453 | - self.app.main_view.go_back() |
454 | + self.app.main_view.go_back_wrapper() |
455 | |
456 | # click the play button (toolbar) to start playing |
457 | toolbar.click_play_button() |
458 | @@ -310,7 +310,7 @@ |
459 | Eventually(Equals(tracks[0]["artist"]))) |
460 | |
461 | # click on close button to close songs page |
462 | - self.app.main_view.go_back() |
463 | + self.app.main_view.go_back_wrapper() |
464 | |
465 | # check that the albums page is now visible |
466 | self.assertThat(albums_page.visible, Eventually(Equals(True))) |
467 | @@ -358,7 +358,7 @@ |
468 | Equals(tracks[0]["title"])) |
469 | |
470 | # click on close button to close nowplaying page |
471 | - self.app.main_view.go_back() |
472 | + self.app.main_view.go_back_wrapper() |
473 | |
474 | # check that the songs page is now visible |
475 | self.assertThat(songs_page.visible, Eventually(Equals(True))) |
476 | @@ -468,6 +468,9 @@ |
477 | # select playlist to add song to |
478 | add_to_playlist_page.click_playlist(0) |
479 | |
480 | + # wait for tracks page to become visible |
481 | + tracks_page.visible.wait_for(True) |
482 | + |
483 | # open playlists page |
484 | playlists_page = self.app.get_playlists_page() |
485 |
Still need to do a full run of this, as I need to move my music and rescan mediascanner2, will try this later :-)