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
=== modified file 'tests/autopilot/music_app/tests/test_music.py'
--- tests/autopilot/music_app/tests/test_music.py 2014-04-12 14:31:22 +0000
+++ tests/autopilot/music_app/tests/test_music.py 2014-05-02 00:57:36 +0000
@@ -667,3 +667,36 @@
667 actual_title = lambda: self.player.currentMetaTitle667 actual_title = lambda: self.player.currentMetaTitle
668 self.assertThat(actual_title, Eventually(Equals(self.LAST_TITLE)))668 self.assertThat(actual_title, Eventually(Equals(self.LAST_TITLE)))
669 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))669 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
670
671 def test_lifecycle_next_track(self):
672 """ Test that app suspension doesn't prevent playback """
673
674 # populate queue
675 first_genre_item = self.main_view.get_first_genre_item()
676 self.pointing_device.click_object(first_genre_item)
677 trackTitle = "Foss Yeaaaah! (Radio Edit)"
678 song = self.main_view.get_album_sheet_listview_tracktitle(trackTitle)
679 self.pointing_device.click_object(song)
680
681 if not self.player.repeat:
682 repeatbutton = self.main_view.get_repeat_button()
683 logger.debug("Turning on repeat")
684 self.pointing_device.click_object(repeatbutton)
685
686 title = lambda: self.player.currentMetaTitle
687 artist = lambda: self.player.currentMetaArtist
688
689 orgTitle = self.player.currentMetaTitle
690 orgArtist = self.player.currentMetaArtist
691
692 """ Sleep 65 seconds and check next song, should be next song """
693 time.sleep(65)
694 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
695 self.assertThat(title, Eventually(NotEquals(orgTitle)))
696 self.assertThat(artist, Eventually(NotEquals(orgArtist)))
697
698 """ Sleep 80 seconds and check next song, should be first song """
699 time.sleep(80)
700 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
701 self.assertThat(title, Eventually(Equals(orgTitle)))
702 self.assertThat(artist, Eventually(Equals(orgArtist)))

Subscribers

People subscribed via source and target branches

to status/vote changes: