Merge lp:~carla-sella/music-app/show_albums_sheet into lp:music-app/trusty

Proposed by Carla Sella
Status: Merged
Approved by: Victor Thompson
Approved revision: 265
Merged at revision: 261
Proposed branch: lp:~carla-sella/music-app/show_albums_sheet
Merge into: lp:music-app/trusty
Diff against target: 89 lines (+48/-1)
3 files modified
MusicAlbums.qml (+2/-0)
tests/autopilot/music_app/emulators.py (+24/-0)
tests/autopilot/music_app/tests/test_music.py (+22/-1)
To merge this branch: bzr merge lp:~carla-sella/music-app/show_albums_sheet
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Nicholas Skaggs (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+196785@code.launchpad.net

Commit message

Autopilot test for music app.

Description of the change

Added test_show_albums_sheet.

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: Needs Fixing (continuous-integration)
262. By Carla Sella <email address hidden>

Fixed pep8 error.

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
Nicholas Skaggs (nskaggs) wrote :

Carla, remember to run pyflakes to :-)

+ pyflakes .
./tests/autopilot/music_app/tests/test_music.py:13: 'NotEquals' imported but unused
./tests/autopilot/music_app/tests/test_music.py:209: local variable 'albumstab' is assigned to but never used
./debian/music-app-autopilot/usr/lib/python2.7/dist-packages/music_app/tests/test_music.py:13: 'NotEquals' imported but unused
./debian/music-app

Should be an easy fix.

review: Needs Fixing
Revision history for this message
Carla Sella (carla-sella) wrote :

I fixed everything now.

263. By Carla Sella <email address hidden>

Ran pyflakes on tests.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
264. By Carla Sella <email address hidden>

Deleted redundant asserts.

265. By Carla Sella <email address hidden>

Fixed asserts.

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
Nicholas Skaggs (nskaggs) :
review: Approve
Revision history for this message
Victor Thompson (vthompson) :
review: Approve
Revision history for this message
Carla Sella (carla-sella) wrote :

Closed bug ##1253447.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicAlbums.qml'
2--- MusicAlbums.qml 2013-11-23 21:02:25 +0000
3+++ MusicAlbums.qml 2013-11-27 21:14:45 +0000
4@@ -103,6 +103,7 @@
5 }
6 Label {
7 id: albumArtist
8+ objectName: "albums-albumartist"
9 anchors.bottom: parent.bottom
10 anchors.bottomMargin: units.gu(1)
11 anchors.left: parent.left
12@@ -187,6 +188,7 @@
13 }
14 Label {
15 id: albumArtist
16+ objectName: "albumsheet-albumartist"
17 wrapMode: Text.NoWrap
18 maximumLineCount: 1
19 fontSize: "small"
20
21=== modified file 'tests/autopilot/music_app/emulators.py'
22--- tests/autopilot/music_app/emulators.py 2013-11-01 19:52:31 +0000
23+++ tests/autopilot/music_app/emulators.py 2013-11-27 21:14:45 +0000
24@@ -81,3 +81,27 @@
25
26 def get_back_button(self):
27 return self.select_single("*", objectName="nowPlayingBackButtonObject")
28+
29+ def get_albumstab(self):
30+ return self.select_single("Tab", objectName="albumstab")
31+
32+ def get_albums_albumartist_list(self):
33+ return self.select_many("Label", objectName="albums-albumartist")
34+
35+ def get_albums_albumartist(self, artistName):
36+ albumartistList = self.get_albums_albumartist_list()
37+ for item in albumartistList:
38+ if item.text == artistName:
39+ return item
40+
41+ def get_album_sheet_artist(self):
42+ return self.select_single("Label", objectName="albumsheet-albumartist")
43+
44+ def close_buttons(self):
45+ return self.select_many("Button", text="close")
46+
47+ def get_album_sheet_close_button(self):
48+ closebuttons = self.close_buttons()
49+ for item in closebuttons:
50+ if item.enabled:
51+ return item
52
53=== modified file 'tests/autopilot/music_app/tests/test_music.py'
54--- tests/autopilot/music_app/tests/test_music.py 2013-11-22 16:58:47 +0000
55+++ tests/autopilot/music_app/tests/test_music.py 2013-11-27 21:14:45 +0000
56@@ -10,7 +10,7 @@
57 from __future__ import absolute_import
58
59 from autopilot.matchers import Eventually
60-from testtools.matchers import Equals, LessThan
61+from testtools.matchers import Equals, Is, Not, LessThan
62
63 from music_app.tests import MusicTestCase
64
65@@ -198,3 +198,24 @@
66 Eventually(Equals(False)))
67 forward = not forward
68 count += 1
69+
70+ def test_show_albums_sheet(self):
71+ """tests navigating to the Albums tab and displaying the album sheet"""
72+
73+ artistName = "Benjamin Kerensa"
74+
75+ # switch to albums tab
76+ self.main_view.switch_to_tab("albumstab")
77+
78+ #select album
79+ albumartist = self.main_view.get_albums_albumartist(artistName)
80+ self.pointing_device.click_object(albumartist)
81+
82+ #get album sheet album artist
83+ sheet_albumartist = self.main_view.get_album_sheet_artist()
84+ self.assertThat(sheet_albumartist.text, Eventually(Equals(artistName)))
85+
86+ # click on close button to close album sheet
87+ closebutton = self.main_view.get_album_sheet_close_button()
88+ self.pointing_device.click_object(closebutton)
89+ self.assertThat(self.main_view.get_albumstab(), Not(Is(None)))

Subscribers

People subscribed via source and target branches

to status/vote changes: