on xenial help sign in
Make tutorial qmltests more robust.
63f6e13Michael Terry
tests/qmltests/Tutorial/tst_Tutorial.qml+18−21
@@ -528,10 +528,10 @@ Rectangle {
528 // Test that we skip the tutorial if user uses top edge themselves
528 // Test that we skip the tutorial if user uses top edge themselves
529
529
530 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
530 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
531− var tutorialTop = findChild(shell, "tutorialTop");
531+ var tutorialTopLoader = findChild(shell, "tutorialTopLoader");
532 AccountsService.demoEdgesCompleted = ["left"];
532 AccountsService.demoEdgesCompleted = ["left"];
533 tryCompare(tutorialLeftLoader, "active", false);
533 tryCompare(tutorialLeftLoader, "active", false);
534− verify(!tutorialTop.shown);
534+ verify(!tutorialTopLoader.shown);
535
535
536 touchFlick(shell, halfWidth, 0, halfWidth, shell.height);
536 touchFlick(shell, halfWidth, 0, halfWidth, shell.height);
537 tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top"]);
537 tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top"]);
@@ -584,8 +584,8 @@ Rectangle {
584 function test_tutorialRightDelay() {
584 function test_tutorialRightDelay() {
585 // Test that if we exit the top tutorial, we don't immediately
585 // Test that if we exit the top tutorial, we don't immediately
586 // jump into right tutorial.
586 // jump into right tutorial.
587− var tutorialRight = findChild(shell, "tutorialRight");
587+ var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
588− var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightTimer");
588+ var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
589
589
590 openTutorialTop();
590 openTutorialTop();
591 ApplicationManager.startApplication("gallery-app");
591 ApplicationManager.startApplication("gallery-app");
@@ -595,9 +595,9 @@ Rectangle {
595
595
596 AccountsService.demoEdgesCompleted = ["left", "top", "left-long"];
596 AccountsService.demoEdgesCompleted = ["left", "top", "left-long"];
597 verify(tutorialRightTimer.running);
597 verify(tutorialRightTimer.running);
598− verify(!tutorialRight.shown);
598+ verify(!tutorialRightLoader.shown);
599 tutorialRightTimer.interval = 1;
599 tutorialRightTimer.interval = 1;
600− tryCompare(tutorialRight, "shown", true);
600+ tryCompare(tutorialRightLoader, "shown", true);
601 }
601 }
602
602
603 function test_tutorialRightAutoSkipped() {
603 function test_tutorialRightAutoSkipped() {
@@ -691,25 +691,25 @@ Rectangle {
691 function test_desktopTutorialRightFinish() {
691 function test_desktopTutorialRightFinish() {
692 loadShell("desktop");
692 loadShell("desktop");
693
693
694− var tutorialRight = findChild(shell, "tutorialRight");
694+ var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
695− var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightTimer");
695+ var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
696 tutorialRightTimer.interval = 1;
696 tutorialRightTimer.interval = 1;
697 ApplicationManager.startApplication("dialer-app");
697 ApplicationManager.startApplication("dialer-app");
698 ApplicationManager.startApplication("camera-app");
698 ApplicationManager.startApplication("camera-app");
699 ApplicationManager.startApplication("facebook-webapp");
699 ApplicationManager.startApplication("facebook-webapp");
700− tryCompare(tutorialRight, "shown", true);
700+ tryCompare(tutorialRightLoader, "shown", true);
701
701
702 var stage = findChild(shell, "stage");
702 var stage = findChild(shell, "stage");
703 mouseMove(shell, shell.width, shell.height / 2);
703 mouseMove(shell, shell.width, shell.height / 2);
704 stage.pushRightEdge(units.gu(8));
704 stage.pushRightEdge(units.gu(8));
705− tryCompare(tutorialRight, "shown", false);
705+ tryCompare(tutorialRightLoader, "shown", false);
706
706
707 tryCompare(AccountsService, "demoEdges", false);
707 tryCompare(AccountsService, "demoEdges", false);
708 }
708 }
709
709
710 function test_oskDoesNotHideTutorial() {
710 function test_oskDoesNotHideTutorial() {
711− var tutorialLeft = findChild(shell, "tutorialLeft");
711+ var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
712− verify(tutorialLeft.shown);
712+ verify(tutorialLeftLoader.shown);
713
713
714 var surface = SurfaceManager.inputMethodSurface;
714 var surface = SurfaceManager.inputMethodSurface;
715 surface.setState(Mir.RestoredState);
715 surface.setState(Mir.RestoredState);
@@ -717,7 +717,7 @@ Rectangle {
717 var inputMethod = findInvisibleChild(shell, "inputMethod");
717 var inputMethod = findInvisibleChild(shell, "inputMethod");
718 tryCompare(inputMethod, "state", "shown");
718 tryCompare(inputMethod, "state", "shown");
719
719
720− verify(tutorialLeft.shown);
720+ verify(tutorialLeftLoader.shown);
721 }
721 }
722
722
723 function test_oskDelaysTutorial() {
723 function test_oskDelaysTutorial() {
@@ -777,18 +777,15 @@ Rectangle {
777 }
777 }
778
778
779 function test_accountsServiceSettings() {
779 function test_accountsServiceSettings() {
780− var tutorialLeft = findChild(shell, "tutorialLeft");
780+ var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
781− verify(tutorialLeft != null);
781+ verify(tutorialLeftLoader.shown);
782− verify(tutorialLeft.shown);
783
782
784 AccountsService.demoEdges = false;
783 AccountsService.demoEdges = false;
785− verify(findChild(shell, "tutorialLeft") == null);
784+ verify(findChild(shell, "tutorialLeftLoader") == null);
786
785
787 AccountsService.demoEdges = true;
786 AccountsService.demoEdges = true;
788− tutorialLeft = findChild(shell, "tutorialLeft");
787+ tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
789− verify(tutorialLeft != null);
790−
791− var tutorialLeftTimer = findChild(tutorialLeft, "tutorialLeftTimer");
788+ var tutorialLeftTimer = findChild(tutorialLeftLoader, "tutorialLeftTimer");
792 verify(tutorialLeftTimer.running);
789 verify(tutorialLeftTimer.running);
793 }
790 }
794 }
791 }