@@ -112,6 +112,19 @@ Item {
112 mouseClick(tile);
112 mouseClick(tile);
115+ function open_manage_dash() {
116+ // Show the manage dash
117+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
118+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
119+ tryCompare(bottomEdgeController, "progress", 1);
121+ // Make sure stuff is loaded
122+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
123+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
124+ waitForRendering(favScopesListCategoryList);
125+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
115 function test_longNavigationFilterList() {
128 function test_longNavigationFilterList() {
116 // Select the scope with long navigation
129 // Select the scope with long navigation
117 dash.setCurrentScope("LongPrimaryNavigation")
130 dash.setCurrentScope("LongPrimaryNavigation")
@@ -121,6 +134,7 @@ Item {
121 var dashContentList = findChild(dashContent, "dashContentList")
134 var dashContentList = findChild(dashContent, "dashContentList")
122 var searchButton = findChild(dashContentList.currentItem, "search_button")
135 var searchButton = findChild(dashContentList.currentItem, "search_button")
123 var extraPanel = findChild(dashContentList.currentItem, "peExtraPanel")
136 var extraPanel = findChild(dashContentList.currentItem, "peExtraPanel")
137+ waitForRendering(extraPanel);
124 tryCompare(extraPanel, "visible", false)
138 tryCompare(extraPanel, "visible", false)
126 // Open the primaryNavigationFilter
140 // Open the primaryNavigationFilter
@@ -179,22 +193,16 @@ Item {
181 function test_manage_dash_clickscope_unfavoritable() {
195 function test_manage_dash_clickscope_unfavoritable() {
182− // Show the manage dash
196+ open_manage_dash();
183− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
184− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
185− tryCompare(bottomEdgeController, "progress", 1);
187− // Make sure stuff is loaded
188− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
189− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
190− tryCompare(favScopesListCategoryList, "currentIndex", 0);
192 // Click scope star area is not visible (i.e. can't be unfavorited)
198 // Click scope star area is not visible (i.e. can't be unfavorited)
199+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
193 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
200 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
194 var starArea = findChild(clickScope, "starArea");
201 var starArea = findChild(clickScope, "starArea");
195 compare(starArea.visible, false);
202 compare(starArea.visible, false);
197 // Go back
204 // Go back
205+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
198 var scopesList = findChild(dash, "scopesList");
206 var scopesList = findChild(dash, "scopesList");
199 var scopesListPageHeader = findChild(scopesList, "pageHeader");
207 var scopesListPageHeader = findChild(scopesList, "pageHeader");
200 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
208 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
@@ -203,20 +211,14 @@ Item {
205 function test_manage_dash_select_same_favorite() {
213 function test_manage_dash_select_same_favorite() {
206− // Show the manage dash
214+ open_manage_dash();
207− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
208− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
209− tryCompare(bottomEdgeController, "progress", 1);
211− // Make sure stuff is loaded
212− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
213− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
214− tryCompare(favScopesListCategoryList, "currentIndex", 0);
216 // Click in first item
216 // Click in first item
217+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
217 mouseClick(favScopesListCategoryList.currentItem);
218 mouseClick(favScopesListCategoryList.currentItem);
219 // Make sure animation went back
220 // Make sure animation went back
221+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
220 tryCompare(bottomEdgeController, "progress", 0);
222 tryCompare(bottomEdgeController, "progress", 0);
222 var dashContentList = findChild(dash, "dashContentList");
224 var dashContentList = findChild(dash, "dashContentList");
@@ -224,31 +226,25 @@ Item {
226 function test_manage_dash_select_different_favorite() {
228 function test_manage_dash_select_different_favorite() {
227− // Show the manage dash
229+ open_manage_dash();
228− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
229− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
230− tryCompare(bottomEdgeController, "progress", 1);
232− // Make sure stuff is loaded
233− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
234− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
235− tryCompare(favScopesListCategoryList, "currentIndex", 0);
237 // Click in second item
231 // Click in second item
232+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
238 favScopesListCategoryList.currentIndex = 1;
233 favScopesListCategoryList.currentIndex = 1;
239 mouseClick(favScopesListCategoryList.currentItem);
234 mouseClick(favScopesListCategoryList.currentItem);
241 // Make sure animation went back
236 // Make sure animation went back
237+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
242 tryCompare(bottomEdgeController, "progress", 0);
238 tryCompare(bottomEdgeController, "progress", 0);
243 var dashContentList = findChild(dash, "dashContentList");
239 var dashContentList = findChild(dash, "dashContentList");
244 compare(dashContentList.currentIndex, 1);
240 compare(dashContentList.currentIndex, 1);
247 function test_manage_dash_select_non_favorite() {
243 function test_manage_dash_select_non_favorite() {
248− // Show the manage dash
244+ open_manage_dash();
249− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
245+
250− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
246+ // Ensure non favorites are visible
251− tryCompare(bottomEdgeController, "progress", 1);
247+ flickToYEnd(findChild(dash,"scopesListFlickable"));
253 // Make sure stuff is loaded
249 // Make sure stuff is loaded
254 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
250 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
@@ -268,6 +264,7 @@ Item {
268 tryCompare(dashTempScopeItem, "visible", true);
264 tryCompare(dashTempScopeItem, "visible", true);
270 // Check the manage dash is gone
266 // Check the manage dash is gone
267+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
271 tryCompare(bottomEdgeController, "progress", 0);
268 tryCompare(bottomEdgeController, "progress", 0);
273 // Go back
270 // Go back
@@ -296,6 +293,7 @@ Item {
296 tryCompare(bottomEdgeController, "progress", 1);
293 tryCompare(bottomEdgeController, "progress", 1);
298 // Go back
295 // Go back
296+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
299 var scopesList = findChild(dash, "scopesList");
297 var scopesList = findChild(dash, "scopesList");
300 var scopesListPageHeader = findChild(scopesList, "pageHeader");
298 var scopesListPageHeader = findChild(scopesList, "pageHeader");
301 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
299 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
@@ -358,10 +356,7 @@ Item {
360 function test_manage_dash_store_no_favorites() {
358 function test_manage_dash_store_no_favorites() {
361− // Show the manage dash
359+ open_manage_dash();
362− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
363− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
364− tryCompare(bottomEdgeController, "progress", 1);
366 // clear the favorite scopes
361 // clear the favorite scopes
367 scopes.clearFavorites();
362 scopes.clearFavorites();
@@ -379,6 +374,7 @@ Item {
380 spy.wait();
375 spy.wait();
381 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
376 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
377+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
382 tryCompare(bottomEdgeController, "progress", 0);
378 tryCompare(bottomEdgeController, "progress", 0);
@@ -387,17 +383,10 @@ Item {
387 compare(dashContentList.currentIndex, 0);
383 compare(dashContentList.currentIndex, 0);
388 compare(dashContentList.currentItem.scopeId, "MockScope1");
384 compare(dashContentList.currentItem.scopeId, "MockScope1");
390− // Show the manage dash
386+ open_manage_dash();
391− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
392− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
393− tryCompare(bottomEdgeController, "progress", 1);
395− // Make sure stuff is loaded
396− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
397− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
398− tryCompare(favScopesListCategoryList, "currentIndex", 0);
400 // Enter edit mode
388 // Enter edit mode
389+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
401 var scopesList = findChild(dash, "scopesList");
390 var scopesList = findChild(dash, "scopesList");
402 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
391 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
403 mousePress(clickScope);
392 mousePress(clickScope);
@@ -408,6 +397,7 @@ Item {
408 touchFlick(starArea, 0, 0, 0, -units.gu(10));
397 touchFlick(starArea, 0, 0, 0, -units.gu(10));
410 // Exit edit mode and go back
399 // Exit edit mode and go back
400+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
411 var scopesList = findChild(dash, "scopesList");
401 var scopesList = findChild(dash, "scopesList");
412 var scopesListPageHeader = findChild(scopesList, "pageHeader");
402 var scopesListPageHeader = findChild(scopesList, "pageHeader");
413 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
403 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
@@ -429,17 +419,10 @@ Item {
429 compare(dashContentList.currentIndex, 0);
419 compare(dashContentList.currentIndex, 0);
430 compare(dashContentList.currentItem.scopeId, "MockScope1");
420 compare(dashContentList.currentItem.scopeId, "MockScope1");
432− // Show the manage dash
422+ open_manage_dash();
433− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
434− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
435− tryCompare(bottomEdgeController, "progress", 1);
437− // Make sure stuff is loaded
438− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
439− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
440− tryCompare(favScopesListCategoryList, "currentIndex", 0);
442 // Enter edit mode
424 // Enter edit mode
425+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
443 var scopesList = findChild(dash, "scopesList");
426 var scopesList = findChild(dash, "scopesList");
444 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
427 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
445 mousePress(clickScope);
428 mousePress(clickScope);
@@ -459,6 +442,8 @@ Item {
459 mouseClick(backButton);
442 mouseClick(backButton);
461 // Click on third scope
444 // Click on third scope
445+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
446+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
462 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
447 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
463 waitForRendering(mockScope5)
448 waitForRendering(mockScope5)
464 mouseClick(mockScope5);
449 mouseClick(mockScope5);
@@ -472,14 +457,12 @@ Item {
472 compare(dashContentList.currentIndex, 0);
457 compare(dashContentList.currentIndex, 0);
473 compare(dashContentList.currentItem.scopeId, "MockScope1");
458 compare(dashContentList.currentItem.scopeId, "MockScope1");
475− // Show the manage dash
460+ open_manage_dash();
476− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
477− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
478− tryCompare(bottomEdgeController, "progress", 1);
480 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
462 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
481 dashCommunicatorService.mockSetCurrentScope(1, true, false);
463 dashCommunicatorService.mockSetCurrentScope(1, true, false);
465+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
483 tryCompare(bottomEdgeController, "progress", 0);
466 tryCompare(bottomEdgeController, "progress", 0);
484 tryCompare(dashContentList, "currentIndex", 1)
467 tryCompare(dashContentList, "currentIndex", 1)
@@ -507,10 +490,10 @@ Item {
509 function test_close_temp_scope_preview_opening_scope() {
492 function test_close_temp_scope_preview_opening_scope() {
510− // Show the manage dash
493+ open_manage_dash();
511− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
494+
512− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
495+ // Ensure non favorite scopes are visible
513− tryCompare(bottomEdgeController, "progress", 1);
496+ flickToYEnd(findChild(dash, "scopesListFlickable"));
515 // Make sure stuff is loaded
498 // Make sure stuff is loaded
516 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
499 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
@@ -530,6 +513,7 @@ Item {
530 tryCompare(dashTempScopeItem, "visible", true);
513 tryCompare(dashTempScopeItem, "visible", true);
532 // Check the manage dash is gone
515 // Check the manage dash is gone
516+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
533 tryCompare(bottomEdgeController, "progress", 0);
517 tryCompare(bottomEdgeController, "progress", 0);
535 // Open preview
519 // Open preview
@@ -580,12 +564,10 @@ Item {
580 UriHandler.opened("scopes://clickscope");
564 UriHandler.opened("scopes://clickscope");
581 tryCompare(dashContentList, "currentIndex", 1);
565 tryCompare(dashContentList, "currentIndex", 1);
583− // Show the manage dash
567+ open_manage_dash();
584− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
585− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
586− tryCompare(bottomEdgeController, "progress", 1);
588 // UriHandler changes to a scope and closes the manage scopes
569 // UriHandler changes to a scope and closes the manage scopes
570+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
589 UriHandler.opened("scopes://MockScope1");
571 UriHandler.opened("scopes://MockScope1");
590 tryCompare(dashContentList, "currentIndex", 0);
572 tryCompare(dashContentList, "currentIndex", 0);
591 tryCompare(bottomEdgeController, "progress", 0);
573 tryCompare(bottomEdgeController, "progress", 0);
@@ -603,11 +585,11 @@ Item {
603 tryCompare(dashContent, "subPageShown", false);
585 tryCompare(dashContent, "subPageShown", false);
605 // Go to a temp scope
587 // Go to a temp scope
606− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
588+ open_manage_dash();
607− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
589+
608− tryCompare(bottomEdgeController, "progress", 1);
609 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
590 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
610 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
591 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
592+ flickToYEnd(findChild(dash, "scopesListFlickable"));
611 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
593 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
612 mouseClick(nonfavScopesListCategoryList.currentItem);
594 mouseClick(nonfavScopesListCategoryList.currentItem);
613 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
595 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
@@ -666,12 +648,15 @@ Item {
666 function test_tempScopeItemXOnResize()
648 function test_tempScopeItemXOnResize()
668 // Go to a temp scope
650 // Go to a temp scope
669− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
651+ open_manage_dash();
670− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
652+
671− tryCompare(bottomEdgeController, "progress", 1);
672 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
653 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
673 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
654 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
655+ var scopesListFlickable = findChild(dash, "scopesListFlickable");
674 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
656 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
658+ // Ensure the non-favorites, located at the bottom, are visible
659+ flickToYEnd(scopesListFlickable);
675 mouseClick(nonfavScopesListCategoryList.currentItem);
660 mouseClick(nonfavScopesListCategoryList.currentItem);
676 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
661 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
677 tryCompare(dashTempScopeItem, "x", 0);
662 tryCompare(dashTempScopeItem, "x", 0);