← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ahayzen/music-app/fix-1613328-autopilot-tests into lp:music-app

 

Andrew Hayzen has proposed merging lp:~ahayzen/music-app/fix-1613328-autopilot-tests into lp:music-app.

Commit message:
* Fix for autopilot using switch_to_tab instead of leadingActionBar

Requested reviews:
  Music App Developers (music-app-dev)
Related bugs:
  Bug #1613328 in Ubuntu Music App: "Autopilot tests fail"
  https://bugs.launchpad.net/music-app/+bug/1613328

For more details, see:
https://code.launchpad.net/~ahayzen/music-app/fix-1613328-autopilot-tests/+merge/302955

* Fix for autopilot using switch_to_tab instead of leadingActionBar
-- 
Your team Music App Developers is requested to review the proposed merge of lp:~ahayzen/music-app/fix-1613328-autopilot-tests into lp:music-app.
=== modified file 'app/components/HeadState/EmptyHeadState.qml'
--- app/components/HeadState/EmptyHeadState.qml	2016-03-28 09:50:01 +0000
+++ app/components/HeadState/EmptyHeadState.qml	2016-08-15 16:33:06 +0000
@@ -32,6 +32,7 @@
                     backActionComponent
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: thisPage.title
         visible: thisPage.state === "default"

=== modified file 'app/components/HeadState/PlaylistHeadState.qml'
--- app/components/HeadState/PlaylistHeadState.qml	2016-03-28 09:50:01 +0000
+++ app/components/HeadState/PlaylistHeadState.qml	2016-08-15 16:33:06 +0000
@@ -34,6 +34,7 @@
                     backActionComponent
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: thisPage.title
         trailingActionBar {

=== modified file 'app/components/HeadState/PlaylistsHeadState.qml'
--- app/components/HeadState/PlaylistsHeadState.qml	2016-03-28 09:50:01 +0000
+++ app/components/HeadState/PlaylistsHeadState.qml	2016-08-15 16:33:06 +0000
@@ -36,6 +36,7 @@
                     backActionComponent
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: thisPage.title
         trailingActionBar {

=== modified file 'app/components/HeadState/QueueHeadState.qml'
--- app/components/HeadState/QueueHeadState.qml	2016-04-06 02:18:12 +0000
+++ app/components/HeadState/QueueHeadState.qml	2016-08-15 16:33:06 +0000
@@ -37,6 +37,7 @@
                     backActionComponent
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: thisPage.title
         trailingActionBar {

=== modified file 'app/components/HeadState/SearchableHeadState.qml'
--- app/components/HeadState/SearchableHeadState.qml	2016-03-04 04:28:21 +0000
+++ app/components/HeadState/SearchableHeadState.qml	2016-08-15 16:33:06 +0000
@@ -35,6 +35,7 @@
                     backActionComponent
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: thisPage.title
         trailingActionBar {

=== modified file 'app/components/MusicPage.qml'
--- app/components/MusicPage.qml	2016-03-28 09:02:31 +0000
+++ app/components/MusicPage.qml	2016-08-15 16:33:06 +0000
@@ -53,6 +53,7 @@
                     null
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: thisPage.title
 

=== modified file 'app/components/NowPlayingSidebar.qml'
--- app/components/NowPlayingSidebar.qml	2016-03-04 03:14:29 +0000
+++ app/components/NowPlayingSidebar.qml	2016-08-15 16:33:06 +0000
@@ -34,6 +34,7 @@
             thisHeader {
                 leadingActionBar {
                     actions: []  // hide tab bar
+                    objectName: "sideLeadingActionBar"
                 }
                 z: 100  // put on top of content
             }
@@ -61,6 +62,7 @@
         id: pageHeader
         leadingActionBar {
             actions: nowPlayingSidebar.head.backAction
+            objectName: "sideLeadingActionBar"
         }
         flickable: queue
         trailingActionBar {

=== modified file 'app/music-app.qml'
--- app/music-app.qml	2016-08-03 21:15:31 +0000
+++ app/music-app.qml	2016-08-15 16:33:06 +0000
@@ -640,6 +640,7 @@
             property list<Action> tabActions: [
                 Action {
                     enabled: recentTabRepeater.count > 0
+                    objectName: "recentTabAction"
                     text: enabled ? recentTabRepeater.itemAt(0).title : ""
                     visible: enabled
 
@@ -650,22 +651,27 @@
                     }
                 },
                 Action {
+                    objectName: "artistsTabAction"
                     text: artistsTab.title
                     onTriggered: tabs.selectedTabIndex = artistsTab.index
                 },
                 Action {
+                    objectName: "albumsTabAction"
                     text: albumsTab.title
                     onTriggered: tabs.selectedTabIndex = albumsTab.index
                 },
                 Action {
+                    objectName: "genresTabAction"
                     text: genresTab.title
                     onTriggered: tabs.selectedTabIndex = genresTab.index
                 },
                 Action {
+                    objectName: "songsTabAction"
                     text: songsTab.title
                     onTriggered: tabs.selectedTabIndex = songsTab.index
                 },
                 Action {
+                    objectName: "playlistsTabAction"
                     text: playlistsTab.title
                     onTriggered: tabs.selectedTabIndex = playlistsTab.index
                 }

=== modified file 'app/ui/Recent.qml'
--- app/ui/Recent.qml	2016-03-07 20:01:22 +0000
+++ app/ui/Recent.qml	2016-08-15 16:33:06 +0000
@@ -41,6 +41,7 @@
                     backActionComponent
                 }
             }
+            objectName: "tabsLeadingActionBar"
         }
         title: recentPage.title
         trailingActionBar {

=== modified file 'debian/changelog'
--- debian/changelog	2016-08-03 21:15:31 +0000
+++ debian/changelog	2016-08-15 16:33:06 +0000
@@ -2,6 +2,7 @@
 
   * Release 2.4 and start 2.5
   * Remove gstreamer0.10-fluendo-mp3 plugin from control as 1.0 should instead be used
+  * Fix for autopilot using switch_to_tab instead of leadingActionBar (LP: #1613328).
 
  -- Andrew Hayzen <ahayzen@xxxxxxxxx>  Wed, 03 Aug 2016 21:57:36 +0100
 

=== modified file 'tests/autopilot/music_app/__init__.py'
--- tests/autopilot/music_app/__init__.py	2016-01-18 16:16:27 +0000
+++ tests/autopilot/music_app/__init__.py	2016-08-15 16:33:06 +0000
@@ -60,7 +60,7 @@
                                            objectName="addToPlaylistPage")
 
     def get_albums_page(self):
-        self.main_view.switch_to_tab('albumsTab')
+        self.main_view.switch_to_tab_wrapper('albumsTabAction')
 
         return self.main_view.wait_select_single(
             Albums, objectName='albumsPage')
@@ -70,7 +70,7 @@
             ArtistView, objectName='artistViewPage')
 
     def get_artists_page(self):
-        self.main_view.switch_to_tab('artistsTab')
+        self.main_view.switch_to_tab_wrapper('artistsTabAction')
 
         return self.main_view.wait_select_single(
             Artists, objectName='artistsPage')
@@ -88,7 +88,7 @@
                                            objectName="nowPlayingPage")
 
     def get_playlists_page(self):
-        self.main_view.switch_to_tab('playlistsTab')
+        self.main_view.switch_to_tab_wrapper('playlistsTabAction')
 
         return self.main_view.wait_select_single(
             Playlists, objectName='playlistsPage')
@@ -104,7 +104,7 @@
                                            objectName="musicToolbarObject")
 
     def get_songs_page(self):
-        self.main_view.switch_to_tab('songsTab')
+        self.main_view.switch_to_tab_wrapper('songsTabAction')
 
         return self.main_view.wait_select_single(
             Songs, objectName='songsPage')
@@ -463,3 +463,11 @@
         spinner = self.wait_select_single("ActivityIndicator",
                                           objectName="LoadingSpinner")
         spinner.running.wait_for(False)
+
+    def switch_to_tab_wrapper(self, objectName):
+        # We use leadingActionBar instead of Tabs so create wrapper
+        actionBar = self.wait_select_single(
+            "ActionBar", objectName="tabsLeadingActionBar", visible=True,
+        )
+
+        return actionBar.click_action_button(objectName)


Follow ups