@@ -112,6 +112,19 @@ Item {
112112 mouseClick(tile);
113113 }
114114
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);
120+
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);
126+ }
127+
115128 function test_longNavigationFilterList() {
116129 // Select the scope with long navigation
117130 dash.setCurrentScope("LongPrimaryNavigation")
@@ -121,6 +134,7 @@ Item {
121134 var dashContentList = findChild(dashContent, "dashContentList")
122135 var searchButton = findChild(dashContentList.currentItem, "search_button")
123136 var extraPanel = findChild(dashContentList.currentItem, "peExtraPanel")
137+ waitForRendering(extraPanel);
124138 tryCompare(extraPanel, "visible", false)
125139
126140 // Open the primaryNavigationFilter
@@ -179,22 +193,16 @@ Item {
179193 }
180194
181195 function test_manage_dash_clickscope_unfavoritable() {
182− // Show the 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);
186−
187− // Make sure stuff is loaded
188− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
189− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
190− tryCompare(favScopesListCategoryList, "currentIndex", 0);
196+ open_manage_dash();
191197
192198 // Click scope star area is not visible (i.e. can't be unfavorited)
199+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
193200 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
194201 var starArea = findChild(clickScope, "starArea");
195202 compare(starArea.visible, false);
196203
197204 // Go back
205+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
198206 var scopesList = findChild(dash, "scopesList");
199207 var scopesListPageHeader = findChild(scopesList, "pageHeader");
200208 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
@@ -203,20 +211,14 @@ Item {
203211 }
204212
205213 function test_manage_dash_select_same_favorite() {
206− // Show the 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);
210−
211− // Make sure stuff is loaded
212− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
213− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
214− tryCompare(favScopesListCategoryList, "currentIndex", 0);
214+ open_manage_dash();
215215
216216 // Click in first item
217+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
217218 mouseClick(favScopesListCategoryList.currentItem);
218219
219220 // Make sure animation went back
221+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
220222 tryCompare(bottomEdgeController, "progress", 0);
221223
222224 var dashContentList = findChild(dash, "dashContentList");
@@ -224,31 +226,25 @@ Item {
224226 }
225227
226228 function test_manage_dash_select_different_favorite() {
227− // Show the 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);
231−
232− // Make sure stuff is loaded
233− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
234− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
235− tryCompare(favScopesListCategoryList, "currentIndex", 0);
229+ open_manage_dash();
236230
237231 // Click in second item
232+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
238233 favScopesListCategoryList.currentIndex = 1;
239234 mouseClick(favScopesListCategoryList.currentItem);
240235
241236 // Make sure animation went back
237+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
242238 tryCompare(bottomEdgeController, "progress", 0);
243239 var dashContentList = findChild(dash, "dashContentList");
244240 compare(dashContentList.currentIndex, 1);
245241 }
246242
247243 function test_manage_dash_select_non_favorite() {
248− // Show the manage dash
249− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
250− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
251− tryCompare(bottomEdgeController, "progress", 1);
244+ open_manage_dash();
245+
246+ // Ensure non favorites are visible
247+ flickToYEnd(findChild(dash,"scopesListFlickable"));
252248
253249 // Make sure stuff is loaded
254250 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
@@ -268,6 +264,7 @@ Item {
268264 tryCompare(dashTempScopeItem, "visible", true);
269265
270266 // Check the manage dash is gone
267+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
271268 tryCompare(bottomEdgeController, "progress", 0);
272269
273270 // Go back
@@ -296,6 +293,7 @@ Item {
296293 tryCompare(bottomEdgeController, "progress", 1);
297294
298295 // Go back
296+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
299297 var scopesList = findChild(dash, "scopesList");
300298 var scopesListPageHeader = findChild(scopesList, "pageHeader");
301299 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
@@ -358,10 +356,7 @@ Item {
358356 }
359357
360358 function test_manage_dash_store_no_favorites() {
361− // Show the 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);
359+ open_manage_dash();
365360
366361 // clear the favorite scopes
367362 scopes.clearFavorites();
@@ -379,6 +374,7 @@ Item {
379374
380375 spy.wait();
381376 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
377+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
382378 tryCompare(bottomEdgeController, "progress", 0);
383379 }
384380
@@ -387,17 +383,10 @@ Item {
387383 compare(dashContentList.currentIndex, 0);
388384 compare(dashContentList.currentItem.scopeId, "MockScope1");
389385
390− // Show the 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);
394−
395− // Make sure stuff is loaded
396− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
397− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
398− tryCompare(favScopesListCategoryList, "currentIndex", 0);
386+ open_manage_dash();
399387
400388 // Enter edit mode
389+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
401390 var scopesList = findChild(dash, "scopesList");
402391 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
403392 mousePress(clickScope);
@@ -408,6 +397,7 @@ Item {
408397 touchFlick(starArea, 0, 0, 0, -units.gu(10));
409398
410399 // Exit edit mode and go back
400+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
411401 var scopesList = findChild(dash, "scopesList");
412402 var scopesListPageHeader = findChild(scopesList, "pageHeader");
413403 var backButton = findChild(scopesListPageHeader, "innerPageHeader").leadingActionBar;
@@ -429,17 +419,10 @@ Item {
429419 compare(dashContentList.currentIndex, 0);
430420 compare(dashContentList.currentItem.scopeId, "MockScope1");
431421
432− // Show the 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);
436−
437− // Make sure stuff is loaded
438− var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
439− var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
440− tryCompare(favScopesListCategoryList, "currentIndex", 0);
422+ open_manage_dash();
441423
442424 // Enter edit mode
425+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
443426 var scopesList = findChild(dash, "scopesList");
444427 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
445428 mousePress(clickScope);
@@ -459,6 +442,8 @@ Item {
459442 mouseClick(backButton);
460443
461444 // Click on third scope
445+ var favScopesListCategoryList = findChild(findChild(dash, "scopesListCategoryfavorites"), "scopesListCategoryInnerList");
446+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
462447 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
463448 waitForRendering(mockScope5)
464449 mouseClick(mockScope5);
@@ -472,14 +457,12 @@ Item {
472457 compare(dashContentList.currentIndex, 0);
473458 compare(dashContentList.currentItem.scopeId, "MockScope1");
474459
475− // Show the 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);
460+ open_manage_dash();
479461
480462 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
481463 dashCommunicatorService.mockSetCurrentScope(1, true, false);
482464
465+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
483466 tryCompare(bottomEdgeController, "progress", 0);
484467 tryCompare(dashContentList, "currentIndex", 1)
485468 }
@@ -507,10 +490,10 @@ Item {
507490 }
508491
509492 function test_close_temp_scope_preview_opening_scope() {
510− // Show the manage dash
511− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
512− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
513− tryCompare(bottomEdgeController, "progress", 1);
493+ open_manage_dash();
494+
495+ // Ensure non favorite scopes are visible
496+ flickToYEnd(findChild(dash, "scopesListFlickable"));
514497
515498 // Make sure stuff is loaded
516499 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
@@ -530,6 +513,7 @@ Item {
530513 tryCompare(dashTempScopeItem, "visible", true);
531514
532515 // Check the manage dash is gone
516+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
533517 tryCompare(bottomEdgeController, "progress", 0);
534518
535519 // Open preview
@@ -580,12 +564,10 @@ Item {
580564 UriHandler.opened("scopes://clickscope");
581565 tryCompare(dashContentList, "currentIndex", 1);
582566
583− // Show the 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);
567+ open_manage_dash();
587568
588569 // UriHandler changes to a scope and closes the manage scopes
570+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
589571 UriHandler.opened("scopes://MockScope1");
590572 tryCompare(dashContentList, "currentIndex", 0);
591573 tryCompare(bottomEdgeController, "progress", 0);
@@ -603,11 +585,11 @@ Item {
603585 tryCompare(dashContent, "subPageShown", false);
604586
605587 // Go to a temp scope
606− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
607− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
608− tryCompare(bottomEdgeController, "progress", 1);
588+ open_manage_dash();
589+
609590 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
610591 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
592+ flickToYEnd(findChild(dash, "scopesListFlickable"));
611593 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
612594 mouseClick(nonfavScopesListCategoryList.currentItem);
613595 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
@@ -666,12 +648,15 @@ Item {
666648 function test_tempScopeItemXOnResize()
667649 {
668650 // Go to a temp scope
669− touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
670− var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
671− tryCompare(bottomEdgeController, "progress", 1);
651+ open_manage_dash();
652+
672653 var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
673654 var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
655+ var scopesListFlickable = findChild(dash, "scopesListFlickable");
674656 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
657+
658+ // Ensure the non-favorites, located at the bottom, are visible
659+ flickToYEnd(scopesListFlickable);
675660 mouseClick(nonfavScopesListCategoryList.currentItem);
676661 var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
677662 tryCompare(dashTempScopeItem, "x", 0);