on xenial help sign in
First easy scopes overview test
commitf890a7e8257c3d50c15e2a4d44990dde10cbb319 authorAlbert Astals <albert.astals@canonical.com> dateFri 18 Jul 2014, 17:42 (12 years ago) parent4e57d21
3 files changed+34
qml/Dash/Dash.qml+2 qml/Dash/ScopesOverviewFavorites.qml+1 tests/qmltests/Dash/tst_Dash.qml+31
qml/Dash/Dash.qml+2
@@ -71,6 +71,7 @@ Showable {
7171
7272 QtObject {
7373 id: overviewController
74+ objectName: "overviewController"
7475
7576 property alias enableAnimation: progressAnimation.enabled
7677 property real progress: 0
@@ -82,6 +83,7 @@ Showable {
8283
8384 ScopesOverview {
8485 id: scopesOverview
86+ objectName: "scopesOverview"
8587 anchors.fill: parent
8688 scope: scopes.overviewScope
8789 progress: overviewController.progress
qml/Dash/ScopesOverviewFavorites.qml+1
@@ -43,6 +43,7 @@ Flickable {
4343
4444 Repeater {
4545 id: repeater
46+ objectName: "scopesOverviewFavoritesRepeater"
4647
4748 delegate: Loader {
4849 id: loader
tests/qmltests/Dash/tst_Dash.qml+31
@@ -91,5 +91,36 @@ Item {
9191 verify(dashContentList != undefined);
9292 tryCompare(dashContentList, "currentIndex", data.visualIndex);
9393 }
94+
95+ function test_dash_overview_show_select_same_favorite() {
96+ // Wait for stuff to be loaded
97+ tryCompare(scopes, "loaded", true);
98+ var dashContentList = findChild(dash, "dashContentList");
99+ tryCompare(dashContentList, "count", 6);
100+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
101+ tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
102+
103+ // Show the overview
104+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
105+ var overviewController = findInvisibleChild(dash, "overviewController");
106+ tryCompare(overviewController, "progress", 1);
107+
108+ // Make sure tab is where it should
109+ var scopesOverview = findChild(dash, "scopesOverview");
110+ compare(scopesOverview.currentTab, 0);
111+
112+ // Make sure stuff is loaded
113+ var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
114+ tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
115+ tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
116+ waitForRendering(scopesOverviewFavoritesRepeater.itemAt(0).item);
117+
118+ // Click in first item
119+ mouseClick(scopesOverviewFavoritesRepeater.itemAt(0).item, 0, 0);
120+
121+ // Make sure animation went back
122+ tryCompare(overviewController, "progress", 0);
123+ compare(dashContentList.currentIndex, 0);
124+ }
94125 }
95126}