on xenial help sign in
tests for the new section jumping
commitd533574199de7a37bf07262e5ec914f8b9a1261f authorAlbert Astals Cid <albert.astals@canonical.com> dateMon 28 Sep 2015, 17:31 (11 years ago) parent631c1ed
1 file changed+95
tests/qmltests/Dash/tst_DashContent.qml+95
tests/qmltests/Dash/tst_DashContent.qml+95
@@ -400,6 +400,101 @@ Item {
400400 tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
401401 }
402402
403+ function goToSecondLevel() {
404+ var dashContentList = findChild(dashContent, "dashContentList");
405+ tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
406+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
407+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
408+ var searchButton = findChild(dashContentList.currentItem, "search_header_button");
409+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
410+ compare(peExtraPanel.visible, false);
411+ mouseClick(searchButton);
412+ tryCompare(peExtraPanel, "visible", true);
413+
414+ var navigationListView = findChild(dashNavigation, "navigationListView");
415+ tryCompareFunction(function() {
416+ return navigationListView.currentItem &&
417+ navigationListView.currentItem.navigation &&
418+ navigationListView.currentItem.navigation.loaded; }, true);
419+ waitForRendering(navigationListView);
420+ waitForRendering(navigationListView.currentItem);
421+
422+ var navigation4 = findChild(dashNavigation, "navigation0child4");
423+ mouseClick(navigation4);
424+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle4");
425+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle4");
426+ tryCompare(dashNavigation.currentNavigation, "loaded", true);
427+
428+ waitForRendering(navigationListView);
429+ waitForRendering(navigationListView.currentItem);
430+
431+ var navigation44 = findChild(dashNavigation, "navigation1child4");
432+ mouseClick(navigation44);
433+ tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle44");
434+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "childmiddle44");
435+ tryCompare(dashNavigation.currentNavigation, "loaded", true);
436+
437+ waitForRendering(navigationListView);
438+ waitForRendering(navigationListView.currentItem);
439+
440+ // header 0 is hidden
441+ var header0 = findChild(dashNavigation, "dashNavigationHeader0");
442+ compare(header0.height, 0);
443+ }
444+
445+ function test_navigationSecondLevelToRoot() {
446+ goToSecondLevel();
447+
448+ var dashContentList = findChild(dashContent, "dashContentList");
449+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
450+ var navigationListView = findChild(dashNavigation, "navigationListView");
451+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
452+
453+ // Go directly to the root pressing the back button of header1
454+ var header1 = findChild(dashNavigation, "dashNavigationHeader1");
455+ compare(header1.backVisible, true);
456+ mouseClick(findChild(header1, "backButton"));
457+
458+ tryCompare(dashNavigation.currentNavigation, "navigationId", "root");
459+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
460+ compare(peExtraPanel.visible, true);
461+ }
462+
463+ function test_navigationSecondLevelToFirstName() {
464+ goToSecondLevel();
465+
466+ var dashContentList = findChild(dashContent, "dashContentList");
467+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
468+ var navigationListView = findChild(dashNavigation, "navigationListView");
469+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
470+
471+ // Go directly to the first pressing the header1
472+ var header1 = findChild(dashNavigation, "dashNavigationHeader1");
473+ mouseClick(header1);
474+
475+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle4");
476+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle4");
477+ compare(peExtraPanel.visible, false);
478+ }
479+
480+ function test_navigationSecondLevelToFirstBack() {
481+ goToSecondLevel();
482+
483+ var dashContentList = findChild(dashContent, "dashContentList");
484+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
485+ var navigationListView = findChild(dashNavigation, "navigationListView");
486+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
487+
488+ // Go back to the first level pressing the back button of header2
489+ var header2 = findChild(dashNavigation, "dashNavigationHeader2");
490+ compare(header2.backVisible, true);
491+ mouseClick(findChild(header2, "backButton"));
492+
493+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle4");
494+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle4");
495+ compare(peExtraPanel.visible, true);
496+ }
497+
403498 function test_searchHint() {
404499 var dashContentList = findChild(dashContent, "dashContentList");
405500 verify(dashContentList !== null);