Merge lp:~vthompson/music-app/proceeds-to-next into lp:music-app/trusty

Proposed by Victor Thompson
Status: Work in progress
Proposed branch: lp:~vthompson/music-app/proceeds-to-next
Merge into: lp:music-app/trusty
Diff against target: 40 lines (+33/-0)
1 file modified
tests/autopilot/music_app/tests/test_music.py (+33/-0)
To merge this branch: bzr merge lp:~vthompson/music-app/proceeds-to-next
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nicholas Skaggs Pending
Review via email: mp+211851@code.launchpad.net

Commit message

Add a test for app suspension issues.

Description of the change

This adds a test for both music stopping upon app suspension and music stopping when going to next track when app is already suspended.

DO NOT APPROVE UNTIL THE ISSUE IN LP:1292306 IS FIXED!!!!

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

I wonder if there is a way in autopilot to turn off the screen, as add a wait of 65 and 80 seconds will really slow down the tests.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

bug 1292306 fix should be landing in a Utopic image soon, so we should merge this soon also.

Revision history for this message
Victor Thompson (vthompson) wrote :

The fix for lp:1292306 was NOT included in the 14.10 r2 image available in the "ubuntu-touch/utopic-proposed" channel. Just in case anyone else was going to attempt to verify.

Revision history for this message
Victor Thompson (vthompson) wrote :

Bug fix was released in the 14.10 image #7. This branch is ready for review and landing.

387. By Victor Thompson

Merge and resolve conflict

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Just run this on device twice

Ran 18 tests in 1199.034s
OK

First run I had the screen display locked on, second run on auto however once the test finished I manually turned it back on for the next test. I will now run without manually turning the screen on and report the result.

As suggested by Victor, would moving the test to the last position be the best option, so that you can see what the other tests are doing?

Revision history for this message
Victor Thompson (vthompson) wrote :

I'll move the tests to the end for now, as I assume it's the best answer. One thing we need to figure out is whether this will work once the media-hub's tracklist implementation lands. When the song switches to the next track everything will be handled in the media hub. We need to determine if 1) media hub will alert the app when the song changes and 2) can autopilot retrieve app components and properties when the app is suspended.

388. By Victor Thompson

re-order tests

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

OK just run without manually turning the screen on.

Ran 18 tests in 1183.432s
OK

review: Approve
Revision history for this message
Victor Thompson (vthompson) wrote :

Setting this as a WIP because the responsibility of testing track management will be done, and done thoroughly, in the media-hub. If the implementation of the media-hub's tracklist functionality and AP allow it, we may eventually land this test, or a similar test, for the app itself.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

I think I saw a ping about this from you -- if you have a ?, leave it here for me, I'll try and help ;-)

Unmerged revisions

388. By Victor Thompson

re-order tests

387. By Victor Thompson

Merge and resolve conflict

386. By Victor Thompson

Add test for both music stopping on app suspend and music stopping when going to next track when app is suspended.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/music_app/tests/test_music.py'
2--- tests/autopilot/music_app/tests/test_music.py 2014-04-12 14:31:22 +0000
3+++ tests/autopilot/music_app/tests/test_music.py 2014-05-02 00:57:36 +0000
4@@ -667,3 +667,36 @@
5 actual_title = lambda: self.player.currentMetaTitle
6 self.assertThat(actual_title, Eventually(Equals(self.LAST_TITLE)))
7 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
8+
9+ def test_lifecycle_next_track(self):
10+ """ Test that app suspension doesn't prevent playback """
11+
12+ # populate queue
13+ first_genre_item = self.main_view.get_first_genre_item()
14+ self.pointing_device.click_object(first_genre_item)
15+ trackTitle = "Foss Yeaaaah! (Radio Edit)"
16+ song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
17+ self.pointing_device.click_object(song)
18+
19+ if not self.player.repeat:
20+ repeatbutton = self.main_view.get_repeat_button()
21+ logger.debug("Turning on repeat")
22+ self.pointing_device.click_object(repeatbutton)
23+
24+ title = lambda: self.player.currentMetaTitle
25+ artist = lambda: self.player.currentMetaArtist
26+
27+ orgTitle = self.player.currentMetaTitle
28+ orgArtist = self.player.currentMetaArtist
29+
30+ """ Sleep 65 seconds and check next song, should be next song """
31+ time.sleep(65)
32+ self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
33+ self.assertThat(title, Eventually(NotEquals(orgTitle)))
34+ self.assertThat(artist, Eventually(NotEquals(orgArtist)))
35+
36+ """ Sleep 80 seconds and check next song, should be first song """
37+ time.sleep(80)
38+ self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
39+ self.assertThat(title, Eventually(Equals(orgTitle)))
40+ self.assertThat(artist, Eventually(Equals(orgArtist)))

Subscribers

People subscribed via source and target branches

to status/vote changes: