on xenial help sign in
Bring back the tests
15cc38fAlbert Astals
qml/Dash/ScopesList.qml+2−15
@@ -32,10 +32,6 @@ Item {
32 signal requestFavorite(string scopeId, bool favorite)
32 signal requestFavorite(string scopeId, bool favorite)
33 signal requestFavoriteMoveTo(string scopeId, int index)
33 signal requestFavoriteMoveTo(string scopeId, int index)
34
34
35− function closePopup() {
36− header.closePopup();
37− }
38−
39 state: "browse"
35 state: "browse"
40
36
41 onStateChanged: {
37 onStateChanged: {
@@ -45,16 +41,6 @@ Item {
45 }
41 }
46 }
42 }
47
43
48− ScopeStyle {
49− id: scopeStyle
50− style: { "foreground-color" : "gray",
51− "background-color" : "transparent",
52− "page-header": {
53− "background": "color:///transparent"
54− }
55− }
56− }
57−
58 DashBackground {
44 DashBackground {
59 anchors.fill: parent
45 anchors.fill: parent
60 }
46 }
@@ -73,6 +59,7 @@ Item {
73
59
74 PageHeader {
60 PageHeader {
75 id: header
61 id: header
62+ objectName: "pageHeader"
76 title: i18n.tr("Manage")
63 title: i18n.tr("Manage")
77 width: parent.width
64 width: parent.width
78 showBackButton: true
65 showBackButton: true
@@ -109,7 +96,7 @@ Item {
109 asynchronous: true
96 asynchronous: true
110 width: root.width
97 width: root.width
111 sourceComponent: ScopesListCategory {
98 sourceComponent: ScopesListCategory {
112− scopeStyle: scopeStyle;
99+ objectName: "scopesListCategory" + categoryId
113 model: results
100 model: results
114 editMode: root.state == "edit"
101 editMode: root.state == "edit"
115
102
qml/Dash/ScopesListCategory.qml+3
@@ -53,6 +53,7 @@ Item {
53
53
54 ListView {
54 ListView {
55 id: list
55 id: list
56+ objectName: "scopesListCategoryInnerList"
56
57
57 readonly property double targetHeight: model.count * listItemHeight
58 readonly property double targetHeight: model.count * listItemHeight
58 clip: height != targetHeight
59 clip: height != targetHeight
@@ -70,6 +71,8 @@ Item {
70 clip: height != listItemHeight
71 clip: height != listItemHeight
71 Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
72 Behavior on height { enabled: visible; UbuntuNumberAnimation { } }
72 sourceComponent: ScopesListCategoryItem {
73 sourceComponent: ScopesListCategoryItem {
74+ objectName: "delegate" + index
75+
73 width: root.width
76 width: root.width
74
77
75 icon: model.art || ""
78 icon: model.art || ""
tests/qmltests/Dash/tst_Dash.qml+131−201
@@ -101,207 +101,137 @@ Item {
101 }
101 }
102 }
102 }
103
103
104−// function test_dash_overview_show_select_same_favorite() {
104+ function test_manage_dash_select_same_favorite() {
105−// // Show the overview
105+ // Show the manage dash
106−// touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
106+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
107−// var overviewController = findInvisibleChild(dash, "overviewController");
107+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
108−// tryCompare(overviewController, "progress", 1);
108+ tryCompare(bottomEdgeController, "progress", 1);
109−//
109+
110−// // Make sure tab is where it should
110+ // Make sure stuff is loaded
111−// var scopesOverview = findChild(dash, "scopesOverview");
111+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
112−// compare(scopesOverview.currentTab, 0);
112+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
113−//
113+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
114−// // Make sure stuff is loaded
114+
115−// var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
116−// tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
117−// tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
118−// waitForRendering(scopesOverviewFavoritesRepeater.itemAt(0).item);
119−//
120−// // Click in first item
115+ // Click in first item
121−// mouseClick(scopesOverviewFavoritesRepeater.itemAt(0).item, 0, 0);
116+ mouseClick(favScopesListCategoryList.currentItem, 0, 0);
122−//
117+
123−// // Make sure animation went back
118+ // Make sure animation went back
124−// tryCompare(overviewController, "progress", 0);
119+ tryCompare(bottomEdgeController, "progress", 0);
125−//
120+
126−// var dashContentList = findChild(dash, "dashContentList");
121+ var dashContentList = findChild(dash, "dashContentList");
127−// compare(dashContentList.currentIndex, 0);
122+ compare(dashContentList.currentIndex, 0);
128−// }
123+ }
129−//
124+
130−// function test_dash_overview_show_select_different_favorite() {
125+ function test_manage_dash_select_different_favorite() {
131−// // Show the overview
126+ // Show the manage dash
132−// touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
127+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
133−// var overviewController = findInvisibleChild(dash, "overviewController");
128+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
134−// tryCompare(overviewController, "progress", 1);
129+ tryCompare(bottomEdgeController, "progress", 1);
135−//
130+
136−// // Make sure tab is where it should
131+ // Make sure stuff is loaded
137−// var scopesOverview = findChild(dash, "scopesOverview");
132+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
138−// compare(scopesOverview.currentTab, 0);
133+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
139−//
134+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
140−// // Make sure stuff is loaded
135+
141−// var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
142−// tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
143−// tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
144−// waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
145−//
146−// // Click in first item
136+ // Click in second item
147−// mouseClick(scopesOverviewFavoritesRepeater.itemAt(1).item, 0, 0);
137+ favScopesListCategoryList.currentIndex = 1;
148−//
138+ mouseClick(favScopesListCategoryList.currentItem, 0, 0);
139+
149−// // Make sure animation went back
140+ // Make sure animation went back
150−// tryCompare(overviewController, "progress", 0);
141+ tryCompare(bottomEdgeController, "progress", 0);
151−// var dashContentList = findChild(dash, "dashContentList");
142+ var dashContentList = findChild(dash, "dashContentList");
152−// compare(dashContentList.currentIndex, 1);
143+ compare(dashContentList.currentIndex, 1);
153−// }
144+ }
154−//
145+
155−// function test_dash_overview_all_temp_scope_done_from_all() {
146+ function test_manage_dash_select_non_favorite() {
156−// // Show the overview
147+ // Show the manage dash
157−// touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
148+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
158−// var overviewController = findInvisibleChild(dash, "overviewController");
149+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
159−// tryCompare(overviewController, "progress", 1);
150+ tryCompare(bottomEdgeController, "progress", 1);
160−//
151+
161−// // Make sure tab is where it should
152+ // Make sure stuff is loaded
162−// var scopesOverview = findChild(dash, "scopesOverview");
153+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
163−// compare(scopesOverview.currentTab, 0);
154+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
164−//
155+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
165−// // Make sure stuff is loaded
156+
166−// var scopesOverviewFavoritesRepeater = findChild(dash, "scopesOverviewFavoritesRepeater");
157+ // Click on a non favorite scope
167−// tryCompare(scopesOverviewFavoritesRepeater, "count", 6);
158+ mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
168−// tryCompareFunction(function() { return scopesOverviewFavoritesRepeater.itemAt(0).item != null; }, true);
159+
169−// waitForRendering(scopesOverviewFavoritesRepeater.itemAt(1).item);
160+ // Check the bottom edge (manage dash) is disabled from temp scope
170−//
161+ var overviewDragHandle = findChild(dash, "overviewDragHandle");
171−// // Click on the all tab
162+ compare(overviewDragHandle.enabled, false);
172−// var scopesOverviewAllTabButton = findChild(dash, "scopesOverviewAllTabButton");
163+
173−// mouseClick(scopesOverviewAllTabButton, 0, 0);
174−//
175−// // Wait for all tab to be enabled (animation finish)
176−// var scopesOverviewAllView = findChild(dash, "scopesOverviewRepeaterChild1");
177−// tryCompare(scopesOverviewAllView, "enabled", true);
178−//
179−// // Click in the middle of the black bar (nothing happens)
180−// var bottomBar = findChild(scopesOverview, "bottomBar");
181−// mouseClick(bottomBar, bottomBar.width / 2, bottomBar.height / 2);
182−// // Check temp scope is not there
164+ // Check temp scope is there
183−// var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
165+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
184−// expectFailContinue("", "Clicking in the middle of bottom bar should not open a temp scope");
166+ tryCompare(dashTempScopeItem, "x", 0);
185−// tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
167+ tryCompare(dashTempScopeItem, "visible", true);
186−//
168+
187−// // Click on a temp scope
169+ // Check the manage dash is gone
188−// var tempScopeCard = findChild(scopesOverviewAllView, "delegate1");
170+ tryCompare(bottomEdgeController, "progress", 0);
189−// mouseClick(tempScopeCard, 0, 0);
171+
190−//
172+ // Go back
191−// // Check the bottom edge (overview) is disabled from temp scope
173+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
192−// var overviewDragHandle = findChild(dash, "overviewDragHandle");
174+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "backButton");
193−// compare(overviewDragHandle.enabled, false);
175+ mouseClick(backButton, 0, 0);
194−//
176+
195−// // Check temp scope is there
177+ // Check temp scope is gone
196−// tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
178+ tryCompare(dashTempScopeItem, "x", dash.width);
197−// tryCompare(scopesOverviewTempScopeItem, "enabled", true);
179+ tryCompare(dashTempScopeItem, "visible", false);
198−//
180+
199−// // Go back
181+ // Original list is still on 0
200−// var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader");
182+ var dashContentList = findChild(dash, "dashContentList");
201−// var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton");
183+ compare(dashContentList.currentIndex, 0);
202−// mouseClick(backButton, 0, 0);
184+ }
203−//
185+
204−// // Check temp scope is gone
186+ function test_manage_dash_search_temp_scope() {
205−// var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
206−// tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true);
207−// tryCompare(scopesOverviewTempScopeItem, "enabled", false);
208−//
209−// // Press on done
210−// var scopesOverviewDoneButton = findChild(scopesOverview, "scopesOverviewDoneButton");
211−// mouseClick(scopesOverviewDoneButton, 0, 0);
212−//
213−// // Check the dash overview is gone
214−// tryCompare(overviewController, "progress", 0);
215−//
216−// // Original list is still on 0
217−// var dashContentList = findChild(dash, "dashContentList");
218−// compare(dashContentList.currentIndex, 0);
219−// }
220−//
221−// function test_temp_scope_dash_overview_all_search_temp_scope_favorite_from_all() {
222−// // Swipe right to Apps scope
223−// var dashContentList = findChild(dash, "dashContentList");
224−// touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));
225−// tryCompare(dashContentList, "contentX", dashContentList.width);
226−// tryCompare(dashContentList, "currentIndex", 1);
227−//
228−// // Click on card that opens temp scope
229−// var categoryListView = findChild(dashContentList.currentItem, "categoryListView");
230−// var dashCategory2 = findChild(categoryListView, "dashCategory2");
231−// tryCompareFunction(function() {
232−// if (dashCategory2.y < 200) return true;
233−// categoryListView.contentY += 100;
234−// return false;
235−// }, true);
236−// var card2 = findChild(dashCategory2, "delegate2");
237−// waitForRendering(card2);
238−// mouseClick(card2, card2.width / 2, card2.height / 2);
239−//
240−// // Wait for temp scope to be there
241−// var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
242−// tryCompare(dashTempScopeItem, "x", 0);
243−//
244−// // Show the overview
187+ // Show the manage dash
245−// touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
188+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
246−// var overviewController = findInvisibleChild(dash, "overviewController");
189+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
247−// tryCompare(overviewController, "progress", 1);
190+ tryCompare(bottomEdgeController, "progress", 1);
248−//
191+
249−// // Make sure tab is where it should
250−// var scopesOverview = findChild(dash, "scopesOverview");
251−// compare(scopesOverview.currentTab, 1);
252−//
253−// // Do a search
192+ // Do a search
254−// var scopesOverviewPageHeader = findChild(scopesOverview, "scopesOverviewPageHeader");
193+ var scopesList = findChild(dash, "scopesList");
194+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
255−// var searchButton = findChild(scopesOverviewPageHeader, "search_header_button");
195+ var searchButton = findChild(scopesListPageHeader, "search_header_button");
256−// mouseClick(searchButton, 0, 0);
196+ mouseClick(searchButton, 0, 0);
257−//
197+
258−// // Type something
198+ // Type something
259−// keyClick(Qt.Key_H);
199+ keyClick(Qt.Key_H);
260−//
200+
261−// // Check results grid is there and the other lists are not
201+ // Click on a temp scope in the search
262−// var searchResultsViewer = findChild(scopesOverview, "searchResultsViewer");
202+ tryCompareFunction( function() { return findChild(scopesList, "scopesListCategorysearchA") != null; }, true);
263−// var scopesOverviewRepeater = findChild(dash, "scopesOverviewRepeater");
264−// tryCompare(searchResultsViewer, "opacity", 1);
265−// tryCompare(scopesOverviewRepeater, "count", 0);
266−//
267−// // Click on a temp scope in the search
268−// var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA");
203+ var dashCategorysearchA = findChild(scopesList, "scopesListCategorysearchA");
269−// var cardTempScope = findChild(dashCategorysearchA, "delegate2");
204+ tryCompareFunction( function() { return findChild(dashCategorysearchA, "delegate2") != null; }, true);
270−// verify(cardTempScope, "Could not find delegate2");
205+ var cardTempScope = findChild(dashCategorysearchA, "delegate2");
271−//
206+
272−// waitForRendering(cardTempScope);
207+ waitForRendering(cardTempScope);
273−// mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
208+ mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
274−//
209+
275−// // Check the bottom edge (overview) is disabled from temp scope
210+ // Check the bottom edge (overview) is disabled from temp scope
276−// var overviewDragHandle = findChild(dash, "overviewDragHandle");
211+ var overviewDragHandle = findChild(dash, "overviewDragHandle");
277−// compare(overviewDragHandle.enabled, false);
212+ compare(overviewDragHandle.enabled, false);
278−//
213+
279−// // Check temp scope is there
214+ // Check temp scope is there
280−// var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
215+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
281−// tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope != null; }, true);
216+ tryCompare(dashTempScopeItem, "x", 0);
282−// tryCompare(scopesOverviewTempScopeItem, "enabled", true);
217+ tryCompare(dashTempScopeItem, "visible", true);
283−//
218+
219+ // Check the manage dash is gone
220+ tryCompare(bottomEdgeController, "progress", 0);
221+
284−// // Go back
222+ // Go back
285−// var scopesOverviewTempScopeItemHeader = findChild(scopesOverviewTempScopeItem, "scopePageHeader");
223+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
286−// var backButton = findChild(findChild(scopesOverviewTempScopeItemHeader, "innerPageHeader"), "backButton");
224+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "backButton");
287−// mouseClick(backButton, 0, 0);
225+ mouseClick(backButton, 0, 0);
288−//
226+
289−// // Check temp scope is gone
227+ // Check temp scope is gone
290−// var scopesOverviewTempScopeItem = findChild(dash, "scopesOverviewTempScopeItem");
228+ tryCompare(dashTempScopeItem, "x", dash.width);
291−// tryCompareFunction( function() { return scopesOverviewTempScopeItem.scope == null; }, true);
229+ tryCompare(dashTempScopeItem, "visible", false);
292−// tryCompare(scopesOverviewTempScopeItem, "enabled", false);
230+
293−//
231+ // Original list is still on 0
294−// // Press on a favorite
232+ var dashContentList = findChild(dash, "dashContentList");
295−// var dashCategorysearchB = findChild(searchResultsViewer, "dashCategorysearchB");
296−// var cardFavSearch = findChild(dashCategorysearchB, "delegate3");
297−// mouseClick(cardFavSearch, 0, 0);
298−//
299−// // Check the dash overview is gone
300−// tryCompare(overviewController, "progress", 0);
301−//
302−// // Original list went to the favorite
303−// compare(dashContentList.currentIndex, 0);
233+ compare(dashContentList.currentIndex, 0);
304−// }
234+ }
305
235
306 function test_setCurrentScope() {
236 function test_setCurrentScope() {
307 var dashContentList = findChild(dash, "dashContentList");
237 var dashContentList = findChild(dash, "dashContentList");