Merge lp:~vthompson/music-app/fix-1332570-test_next_previous into lp:music-app/trusty

Proposed by Victor Thompson
Status: Merged
Approved by: Victor Thompson
Approved revision: 501
Merged at revision: 499
Proposed branch: lp:~vthompson/music-app/fix-1332570-test_next_previous
Merge into: lp:music-app/trusty
Diff against target: 47 lines (+15/-0)
3 files modified
MusicToolbar.qml (+1/-0)
tests/autopilot/music_app/emulators.py (+11/-0)
tests/autopilot/music_app/tests/test_music.py (+3/-0)
To merge this branch: bzr merge lp:~vthompson/music-app/fix-1332570-test_next_previous
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+223985@code.launchpad.net

Commit message

* Update test_next_previous to seek to 0 before selecting previous

Description of the change

This appears to fail because the song isn't being paused quick enough after hitting the Next button. Thus, when Previous is being selected the time the track has been playing is over 5 seconds so the track starts over. This change causes the track to pause immediately (or close to immediately).

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)
500. By Victor Thompson

Seek to 0 prior to selecting previous

501. By Victor Thompson

Fix pep8

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
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 :

Hopefully should resolve the issue :)

And passes on mako locally for me:
00:17:28.789 INFO testresult:46 - OK: music_app.tests.test_music.TestMainWindow.test_next_previous(with touch)

Ran 1 test in 78.110s
OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicToolbar.qml'
2--- MusicToolbar.qml 2014-05-23 15:00:21 +0000
3+++ MusicToolbar.qml 2014-06-20 21:49:43 +0000
4@@ -550,6 +550,7 @@
5 /* Progress bar */
6 Rectangle {
7 id: musicToolbarFullProgressBarContainer
8+ objectName: "progressBarShape"
9 anchors.left: musicToolbarFullPositionLabel.right
10 anchors.leftMargin: units.gu(2)
11 anchors.right: musicToolbarFullDurationLabel.left
12
13=== modified file 'tests/autopilot/music_app/emulators.py'
14--- tests/autopilot/music_app/emulators.py 2014-05-23 15:00:21 +0000
15+++ tests/autopilot/music_app/emulators.py 2014-06-20 21:49:43 +0000
16@@ -39,6 +39,17 @@
17 sleep(2)
18 self.pointing_device.release()
19
20+ def seek_to_0(self):
21+ # Get the progress bar object
22+ progressBar = self.wait_select_single(
23+ "*", objectName="progressBarShape")
24+
25+ # Move to the progress bar and get the position
26+ self.pointing_device.move_to_object(progressBar)
27+ x1, y1 = self.pointing_device.position()
28+
29+ self.pointing_device.drag(x1, y1, x1 - (progressBar.width / 2) + 1, y1)
30+
31 def show_toolbar(self):
32 # Get the toolbar object and create a mouse
33 toolbar = self.get_toolbar()
34
35=== modified file 'tests/autopilot/music_app/tests/test_music.py'
36--- tests/autopilot/music_app/tests/test_music.py 2014-06-18 23:32:17 +0000
37+++ tests/autopilot/music_app/tests/test_music.py 2014-06-20 21:49:43 +0000
38@@ -203,6 +203,9 @@
39 nextArtist = self.player.currentMetaArtist
40 logger.debug("Next Song %s, %s" % (nextTitle, nextArtist))
41
42+ """ Seek to 0 """
43+ self.main_view.seek_to_0()
44+
45 """ Select previous """
46 previousbutton = self.main_view.get_previous_button()
47 self.pointing_device.click_object(previousbutton)

Subscribers

People subscribed via source and target branches

to status/vote changes: