Merge lp:~nskaggs/music-app/fix-shuffle-test into lp:music-app/trusty
- fix-shuffle-test
- Merge into trusty
Status: | Merged |
---|---|
Approved by: | Nicholas Skaggs |
Approved revision: | 286 |
Merged at revision: | 273 |
Proposed branch: | lp:~nskaggs/music-app/fix-shuffle-test |
Merge into: | lp:music-app/trusty |
Diff against target: |
293 lines (+156/-71) 1 file modified
tests/autopilot/music_app/tests/test_music.py (+156/-71) |
To merge this branch: | bzr merge lp:~nskaggs/music-app/fix-shuffle-test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Victor Thompson | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Andrew Hayzen | Approve | ||
Review via email: mp+198485@code.launchpad.net |
Commit message
Simplify shuffle test and make it consistent, fix next and previous as well -- don't force order
Description of the change
Change the shuffle test to be much simpler. Test now checks to see that we cycle at least one song and that song was not the 'next' song in the queue order to prove shuffle is random.
fix next and previous as well -- don't force order or use specific song names
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:273
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
Shuffle is failing on the dashboard, and this should make it more consistent. I'm not sure if there is indeed more you wish to test, but the current iteration isn't useful
Andrew Hayzen (ahayzen) wrote : | # |
Not sure how useful this is, but I ran autopilot with this branch on a Nexus 4 five times and got the following results.
First run:
Ran 8 tests in 200.609s
OK
Second run:
Traceback (most recent call last):
File "/home/
self.assertThat
File "/usr/lib/
raise MismatchError(
MismatchError: After 10.0 seconds test failed: 'TestMP3Title' != u'Swansong'
Ran 8 tests in 214.126s
FAILED (failures=1)
Third run:
Traceback (most recent call last):
File "/home/
self.assertThat
File "/usr/lib/
raise MismatchError(
MismatchError: After 10.0 seconds test on MainView.random failed: True != dbus.Boolean(False, variant_level=1)
Ran 8 tests in 199.545s
FAILED (failures=1)
Fourth run:
Ran 8 tests in 199.184s
OK
Fifth run:
Traceback (most recent call last):
File "/home/
self.assertThat
File "/usr/lib/
raise MismatchError(
MismatchError: After 10.0 seconds test on MainView.random failed: True != dbus.Boolean(False, variant_level=1)
Ran 8 tests in 201.106s
FAILED (failures=1)
If you need any more information please let me know.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:274
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:275
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
Can you explain the shuffle test changes? It looks like you're checking just to see if the song has changed to confirm that your "shuffled" variable is true. This is incorrect--hitting next when shuffle is off also changes the currently playing song. We need to confirm that the next track is NOT what would have otherwise came next. Then it looks like you keep hitting forward until you get to the original track. What does that prove?
maybe a decent strategy would be to hit forward, turn off shuffle, hit back, if the current track is the original track then shuffle hasn't been verified so we try again (currently up to 100 times).
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:276
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
Victor, thanks for commenting. I knew you would probably find an issue with the implementation which is why I asked. I must admit shuffle has been a source of confusion for me with the music app :-)
"We need to confirm that the next track is NOT what would have otherwise came next. "
^^ This is a good point. Your view of what I'm doing is correct. It's possible the original implementation would work now with the tweaks made, but I like your idea of hitting next and previous while toggling shuffle. I'll implement that and see what it looks like.
Andrew Hayzen (ahayzen) wrote : | # |
As a note, I haven't had the latest code fail, *yet*.
Nicholas Skaggs (nskaggs) wrote : | # |
Victor, having Andrew review. Made the changes you requested, and it seems to verify fine. I ran it enough times that it sometimes had to cycle a bit to "prove" the randomness. I think all is well.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:277
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:277
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:278
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:279
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrew Hayzen (ahayzen) wrote : | # |
Looks good, ran 5 times on Nexus 4 without fail :)
'Ran 9 tests in 258.209s
OK'
Victor Thompson (vthompson) wrote : | # |
I don't know if I agree with the next and previous changes. It looks like you attempted to harden then against failure, but at the same time it looks like you've made it almost impossible for the tests to fail. IMO it should not loop through 10 times and hit the forward/back button until it hits it's target. These are not randomized like shuffle so if it doesn't work the first try the test should fail. Or am I missing something?
Nicholas Skaggs (nskaggs) wrote : | # |
Victor I was just looking at them again. I think I could tweak them a bit further. The trouble is I didn't like enforcing which track was the first -- it was gimicky. Instead, we should do the same as shuffle. Hit next, check song, hit previous and make sure it's the original song (and of course that the "next" song != original). Repeat once and I'd say we've confirmed it eh? The only thing is you wanted to ensure you tested an mp3 playback as well, so that might be trickier. Can you hop on IRC?
- 280. By Nicholas Skaggs
-
revamped next, previous tests and tweaked mp3 test
- 281. By Nicholas Skaggs
-
pep8 and pyflakes :-)
- 282. By Nicholas Skaggs
-
tweak comments
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:282
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
The test_next_previous looks good. I'm not so sure with the test_mp3 1) maybe ensure shuffle is off outside the loop, 2) it's possible to break out of the loop because of the count--so I think you need to assert that the file actually ends with .mp3 just as you assert that it is playing.
- 283. By Nicholas Skaggs
-
tweaks for mp3 test, endswith check fails
- 284. By Nicholas Skaggs
-
mp3 test fixed
- 285. By Nicholas Skaggs
-
fix mp3 test and add debug line
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:283
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 286. By Nicholas Skaggs
-
make queue size dynamic (read size)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:286
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
Did a few runs on the device. LGTM.
Preview Diff
1 | === modified file 'tests/autopilot/music_app/tests/test_music.py' | |||
2 | --- tests/autopilot/music_app/tests/test_music.py 2013-12-06 17:04:38 +0000 | |||
3 | +++ tests/autopilot/music_app/tests/test_music.py 2013-12-12 19:26:51 +0000 | |||
4 | @@ -9,6 +9,8 @@ | |||
5 | 9 | 9 | ||
6 | 10 | from __future__ import absolute_import | 10 | from __future__ import absolute_import |
7 | 11 | 11 | ||
8 | 12 | import time | ||
9 | 13 | import logging | ||
10 | 12 | from autopilot.matchers import Eventually | 14 | from autopilot.matchers import Eventually |
11 | 13 | from testtools.matchers import Equals, Is, Not, LessThan, NotEquals | 15 | from testtools.matchers import Equals, Is, Not, LessThan, NotEquals |
12 | 14 | from testtools.matchers import GreaterThan | 16 | from testtools.matchers import GreaterThan |
13 | @@ -16,6 +18,8 @@ | |||
14 | 16 | 18 | ||
15 | 17 | from music_app.tests import MusicTestCase | 19 | from music_app.tests import MusicTestCase |
16 | 18 | 20 | ||
17 | 21 | logger = logging.getLogger(__name__) | ||
18 | 22 | |||
19 | 19 | 23 | ||
20 | 20 | class TestMainWindow(MusicTestCase): | 24 | class TestMainWindow(MusicTestCase): |
21 | 21 | 25 | ||
22 | @@ -86,63 +90,117 @@ | |||
23 | 86 | self.pointing_device.click_object(playbutton) | 90 | self.pointing_device.click_object(playbutton) |
24 | 87 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | 91 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) |
25 | 88 | 92 | ||
27 | 89 | def test_next(self): | 93 | def test_next_previous(self): |
28 | 90 | """ Test going to next track (Music Library must exist) """ | 94 | """ Test going to next track (Music Library must exist) """ |
29 | 91 | 95 | ||
30 | 92 | # populate queue | 96 | # populate queue |
31 | 93 | first_genre_item = self.main_view.get_first_genre_item() | 97 | first_genre_item = self.main_view.get_first_genre_item() |
32 | 94 | self.pointing_device.click_object(first_genre_item) | 98 | self.pointing_device.click_object(first_genre_item) |
33 | 95 | 99 | ||
35 | 96 | forwardbutton = self.main_view.get_forward_button() | 100 | playbutton = self.main_view.get_now_playing_play_button() |
36 | 101 | shufflebutton = self.main_view.get_shuffle_button() | ||
37 | 97 | 102 | ||
38 | 98 | title = lambda: self.main_view.currentTracktitle | 103 | title = lambda: self.main_view.currentTracktitle |
39 | 99 | artist = lambda: self.main_view.currentArtist | 104 | artist = lambda: self.main_view.currentArtist |
46 | 100 | self.assertThat(title, | 105 | |
47 | 101 | Eventually(Equals("Foss Yeaaaah! (Radio Edit)"))) | 106 | orgTitle = self.main_view.currentTracktitle |
48 | 102 | self.assertThat(artist, Eventually(Equals("Benjamin Kerensa"))) | 107 | orgArtist = self.main_view.currentArtist |
49 | 103 | 108 | ||
50 | 104 | """ Track is playing""" | 109 | #check original track |
51 | 105 | self.assertThat(self.main_view.isPlaying, Equals(True)) | 110 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) |
52 | 111 | logger.debug("Original Song %s, %s" % (orgTitle, orgArtist)) | ||
53 | 112 | |||
54 | 113 | """ Pause track """ | ||
55 | 114 | self.pointing_device.click_object(playbutton) | ||
56 | 115 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(False))) | ||
57 | 116 | |||
58 | 117 | #ensure shuffle is off | ||
59 | 118 | if self.main_view.random: | ||
60 | 119 | logger.debug("Turning off shuffle") | ||
61 | 120 | self.pointing_device.click_object(shufflebutton) | ||
62 | 121 | else: | ||
63 | 122 | logger.debug("Shuffle already off") | ||
64 | 123 | self.assertThat(self.main_view.random, Eventually(Equals(False))) | ||
65 | 124 | |||
66 | 125 | """ Select next """ | ||
67 | 126 | #goal is to go back and forth and ensure 2 different songs | ||
68 | 127 | forwardbutton = self.main_view.get_forward_button() | ||
69 | 106 | self.pointing_device.click_object(forwardbutton) | 128 | self.pointing_device.click_object(forwardbutton) |
70 | 107 | |||
71 | 108 | """ Track is playing""" | ||
72 | 109 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | 129 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) |
85 | 110 | self.assertThat(title, Eventually(Equals("Swansong"))) | 130 | |
86 | 111 | self.assertThat(artist, Eventually(Equals("Josh Woodward"))) | 131 | #ensure different song |
87 | 112 | 132 | self.assertThat(title, Eventually(NotEquals(orgTitle))) | |
88 | 113 | def test_previous_and_mp3(self): | 133 | self.assertThat(artist, Eventually(NotEquals(orgArtist))) |
89 | 114 | """ Test going to previous track, last item must be an MP3 | 134 | nextTitle = self.main_view.currentTracktitle |
90 | 115 | (Music Library must exist) """ | 135 | nextArtist = self.main_view.currentArtist |
91 | 116 | 136 | logger.debug("Next Song %s, %s" % (nextTitle, nextArtist)) | |
80 | 117 | # populate queue | ||
81 | 118 | first_genre_item = self.main_view.get_first_genre_item() | ||
82 | 119 | self.pointing_device.click_object(first_genre_item) | ||
83 | 120 | |||
84 | 121 | playbutton = self.main_view.get_now_playing_play_button() | ||
92 | 122 | 137 | ||
93 | 123 | """ Pause track """ | 138 | """ Pause track """ |
94 | 124 | self.pointing_device.click_object(playbutton) | 139 | self.pointing_device.click_object(playbutton) |
95 | 125 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(False))) | 140 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(False))) |
96 | 126 | 141 | ||
97 | 127 | """ Repeat is off """ | ||
98 | 128 | repeatbutton = self.main_view.get_repeat_button() | ||
99 | 129 | self.pointing_device.click_object(repeatbutton) | ||
100 | 130 | |||
101 | 131 | previousbutton = self.main_view.get_previous_button() | ||
102 | 132 | |||
103 | 133 | title = lambda: self.main_view.currentTracktitle | ||
104 | 134 | artist = lambda: self.main_view.currentArtist | ||
105 | 135 | self.assertThat(title, | ||
106 | 136 | Eventually(Equals("Foss Yeaaaah! (Radio Edit)"))) | ||
107 | 137 | self.assertThat(artist, Eventually(Equals("Benjamin Kerensa"))) | ||
108 | 138 | |||
109 | 139 | """ Select previous """ | 142 | """ Select previous """ |
110 | 143 | previousbutton = self.main_view.get_previous_button() | ||
111 | 140 | self.pointing_device.click_object(previousbutton) | 144 | self.pointing_device.click_object(previousbutton) |
112 | 145 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | ||
113 | 146 | |||
114 | 147 | #ensure we're back to original song | ||
115 | 148 | self.assertThat(title, Eventually(Equals(orgTitle))) | ||
116 | 149 | self.assertThat(artist, Eventually(Equals(orgArtist))) | ||
117 | 150 | |||
118 | 151 | def test_mp3(self): | ||
119 | 152 | """ Test that mp3 "plays" or at least doesn't crash on load """ | ||
120 | 153 | |||
121 | 154 | # populate queue | ||
122 | 155 | first_genre_item = self.main_view.get_first_genre_item() | ||
123 | 156 | self.pointing_device.click_object(first_genre_item) | ||
124 | 157 | |||
125 | 158 | playbutton = self.main_view.get_now_playing_play_button() | ||
126 | 159 | shufflebutton = self.main_view.get_shuffle_button() | ||
127 | 160 | |||
128 | 161 | title = self.main_view.currentTracktitle | ||
129 | 162 | artist = self.main_view.currentArtist | ||
130 | 163 | |||
131 | 164 | #ensure track is playing | ||
132 | 165 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | ||
133 | 166 | |||
134 | 167 | #ensure shuffle is off | ||
135 | 168 | if self.main_view.random: | ||
136 | 169 | logger.debug("Turning off shuffle") | ||
137 | 170 | self.pointing_device.click_object(shufflebutton) | ||
138 | 171 | else: | ||
139 | 172 | logger.debug("Shuffle already off") | ||
140 | 173 | self.assertThat(self.main_view.random, Eventually(Equals(False))) | ||
141 | 141 | 174 | ||
142 | 142 | """ Track is playing """ | 175 | """ Track is playing """ |
143 | 176 | count = 1 | ||
144 | 177 | #ensure track appears before looping through queue more than once | ||
145 | 178 | #needs to contain test mp3 metadata and end in *.mp3 | ||
146 | 179 | queue = self.main_view.get_queue_track_count() | ||
147 | 180 | while title != "TestMP3Title" and artist != "TestMP3Artist": | ||
148 | 181 | self.assertThat(count, LessThan(queue)) | ||
149 | 182 | |||
150 | 183 | """ Pause track """ | ||
151 | 184 | self.pointing_device.click_object(playbutton) | ||
152 | 185 | self.assertThat(self.main_view.isPlaying, | ||
153 | 186 | Eventually(Equals(False))) | ||
154 | 187 | |||
155 | 188 | """ Select next """ | ||
156 | 189 | forwardbutton = self.main_view.get_forward_button() | ||
157 | 190 | self.pointing_device.click_object(forwardbutton) | ||
158 | 191 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | ||
159 | 192 | |||
160 | 193 | title = self.main_view.currentTracktitle | ||
161 | 194 | artist = self.main_view.currentArtist | ||
162 | 195 | logger.debug("Current Song %s, %s" % (title, artist)) | ||
163 | 196 | logger.debug("File found %s" % self.main_view.currentFile) | ||
164 | 197 | |||
165 | 198 | count = count + 1 | ||
166 | 199 | |||
167 | 200 | #make sure mp3 plays | ||
168 | 201 | self.assertThat(self.main_view.currentFile.endswith("mp3"), | ||
169 | 202 | Equals(True)) | ||
170 | 143 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | 203 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) |
171 | 144 | self.assertThat(title, Eventually(Equals("TestMP3Title"))) | ||
172 | 145 | self.assertThat(artist, Eventually(Equals("TestMP3Artist"))) | ||
173 | 146 | 204 | ||
174 | 147 | def test_shuffle(self): | 205 | def test_shuffle(self): |
175 | 148 | """ Test shuffle (Music Library must exist) """ | 206 | """ Test shuffle (Music Library must exist) """ |
176 | @@ -151,55 +209,82 @@ | |||
177 | 151 | first_genre_item = self.main_view.get_first_genre_item() | 209 | first_genre_item = self.main_view.get_first_genre_item() |
178 | 152 | self.pointing_device.click_object(first_genre_item) | 210 | self.pointing_device.click_object(first_genre_item) |
179 | 153 | 211 | ||
180 | 154 | shufflebutton = self.main_view.get_shuffle_button() | ||
181 | 155 | |||
182 | 156 | forwardbutton = self.main_view.get_forward_button() | ||
183 | 157 | |||
184 | 158 | previousbutton = self.main_view.get_previous_button() | ||
185 | 159 | |||
186 | 160 | playbutton = self.main_view.get_now_playing_play_button() | ||
187 | 161 | |||
188 | 162 | title = lambda: self.main_view.currentTracktitle | ||
189 | 163 | artist = lambda: self.main_view.currentArtist | ||
190 | 164 | self.assertThat(title, | ||
191 | 165 | Eventually(Equals("Foss Yeaaaah! (Radio Edit)"))) | ||
192 | 166 | self.assertThat(artist, Eventually(Equals("Benjamin Kerensa"))) | ||
193 | 167 | |||
194 | 168 | """ Track is playing, shuffle is turned on""" | 212 | """ Track is playing, shuffle is turned on""" |
200 | 169 | self.assertThat(self.main_view.isPlaying, Equals(True)) | 213 | shufflebutton = self.main_view.get_shuffle_button() |
201 | 170 | self.pointing_device.click_object(shufflebutton) | 214 | forwardbutton = self.main_view.get_forward_button() |
202 | 171 | self.assertThat(self.main_view.random, Eventually(Equals(True))) | 215 | playbutton = self.main_view.get_now_playing_play_button() |
203 | 172 | 216 | previousbutton = self.main_view.get_previous_button() | |
204 | 173 | forward = True | 217 | |
205 | 218 | #play for a second, then pause | ||
206 | 219 | if not self.main_view.isPlaying: | ||
207 | 220 | logger.debug("Play not selected") | ||
208 | 221 | self.pointing_device.click_object(playbutton) | ||
209 | 222 | else: | ||
210 | 223 | logger.debug("Already playing") | ||
211 | 224 | |||
212 | 225 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(True))) | ||
213 | 226 | time.sleep(1) | ||
214 | 227 | self.pointing_device.click_object(playbutton) | ||
215 | 228 | self.assertThat(self.main_view.isPlaying, Eventually(Equals(False))) | ||
216 | 229 | |||
217 | 174 | count = 0 | 230 | count = 0 |
218 | 175 | while True: | 231 | while True: |
219 | 176 | self.assertThat(count, LessThan(100)) | 232 | self.assertThat(count, LessThan(100)) |
220 | 177 | 233 | ||
221 | 234 | #goal is to hit next under shuffle mode | ||
222 | 235 | #then verify original track is not the previous track | ||
223 | 236 | #this means a true shuffle happened | ||
224 | 237 | #if it doesn't try again, up to count times | ||
225 | 238 | |||
226 | 239 | orgTitle = self.main_view.currentTracktitle | ||
227 | 240 | orgArtist = self.main_view.currentArtist | ||
228 | 241 | logger.debug("Original Song %s, %s" % (orgTitle, orgArtist)) | ||
229 | 242 | |||
230 | 178 | if (not self.main_view.toolbarShown): | 243 | if (not self.main_view.toolbarShown): |
231 | 179 | self.main_view.show_toolbar() | 244 | self.main_view.show_toolbar() |
232 | 180 | 245 | ||
235 | 181 | if forward: | 246 | #ensure shuffle is on |
236 | 182 | self.pointing_device.click_object(forwardbutton) | 247 | if not self.main_view.random: |
237 | 248 | logger.debug("Turning on shuffle") | ||
238 | 249 | self.pointing_device.click_object(shufflebutton) | ||
239 | 183 | else: | 250 | else: |
241 | 184 | self.pointing_device.click_object(previousbutton) | 251 | logger.debug("Shuffle already on") |
242 | 252 | self.assertThat(self.main_view.random, Eventually(Equals(True))) | ||
243 | 185 | 253 | ||
245 | 186 | """ Track is playing""" | 254 | self.pointing_device.click_object(forwardbutton) |
246 | 187 | self.assertThat(self.main_view.isPlaying, | 255 | self.assertThat(self.main_view.isPlaying, |
247 | 188 | Eventually(Equals(True))) | 256 | Eventually(Equals(True))) |
250 | 189 | if (self.main_view.currentTracktitle == "TestMP3Title" and | 257 | title = self.main_view.currentTracktitle |
251 | 190 | self.main_view.currentArtist == "TestMP3Artist"): | 258 | artist = self.main_view.currentArtist |
252 | 259 | logger.debug("Current Song %s, %s" % (title, artist)) | ||
253 | 260 | |||
254 | 261 | #go back to previous and check against original | ||
255 | 262 | #play song, then pause before switching | ||
256 | 263 | time.sleep(1) | ||
257 | 264 | self.pointing_device.click_object(playbutton) | ||
258 | 265 | self.assertThat(self.main_view.isPlaying, | ||
259 | 266 | Eventually(Equals(False))) | ||
260 | 267 | |||
261 | 268 | #ensure shuffle is off | ||
262 | 269 | if self.main_view.random: | ||
263 | 270 | logger.debug("Turning off shuffle") | ||
264 | 271 | self.pointing_device.click_object(shufflebutton) | ||
265 | 272 | else: | ||
266 | 273 | logger.debug("Shuffle already off") | ||
267 | 274 | self.assertThat(self.main_view.random, Eventually(Equals(False))) | ||
268 | 275 | |||
269 | 276 | self.pointing_device.click_object(previousbutton) | ||
270 | 277 | |||
271 | 278 | title = self.main_view.currentTracktitle | ||
272 | 279 | artist = self.main_view.currentArtist | ||
273 | 280 | |||
274 | 281 | if title != orgTitle and artist != orgArtist: | ||
275 | 282 | #we shuffled properly | ||
276 | 283 | logger.debug("Yay, shuffled %s, %s" % (title, artist)) | ||
277 | 191 | break | 284 | break |
278 | 192 | else: | 285 | else: |
289 | 193 | """ Show toolbar if hidden """ | 286 | logger.debug("Same track, no shuffle %s, %s" % (title, artist)) |
290 | 194 | if (not self.main_view.toolbarShown): | 287 | count += 1 |
281 | 195 | self.main_view.show_toolbar() | ||
282 | 196 | |||
283 | 197 | """ Pause track """ | ||
284 | 198 | self.pointing_device.click_object(playbutton) | ||
285 | 199 | self.assertThat(self.main_view.isPlaying, | ||
286 | 200 | Eventually(Equals(False))) | ||
287 | 201 | forward = not forward | ||
288 | 202 | count += 1 | ||
291 | 203 | 288 | ||
292 | 204 | def test_show_albums_sheet(self): | 289 | def test_show_albums_sheet(self): |
293 | 205 | """tests navigating to the Albums tab and displaying the album sheet""" | 290 | """tests navigating to the Albums tab and displaying the album sheet""" |
FAILED: Continuous integration, rev:272 91.189. 93.70:8080/ job/music- app-ci/ 364/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 374/console 91.189. 93.70:8080/ job/music- app-raring- amd64-ci/ 364/console 91.189. 93.70:8080/ job/music- app-saucy- amd64-ci/ 366/console 91.189. 93.70:8080/ job/music- app-trusty- amd64-ci/ 85/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/music- app-ci/ 364/rebuild
http://