on xenial help sign in
Wait for greeter to stabilize before running test and remove unused function
4bdf94bDaniel d'Andrada
tests/qmltests/tst_Shell.qml+16−12
@@ -251,6 +251,21 @@ Rectangle {
251
251
252 var launcher = findChild(shell, "launcher");
252 var launcher = findChild(shell, "launcher");
253 launcherShowDashHomeSpy.target = launcher;
253 launcherShowDashHomeSpy.target = launcher;
254+
255+ waitForGreeterToStabilize();
256+ }
257+
258+ function waitForGreeterToStabilize() {
259+ var greeter = findChild(shell, "greeter");
260+ verify(greeter);
261+
262+ var loginList = findChild(greeter, "loginList");
263+ // Only present in WideView
264+ if (loginList) {
265+ var userList = findChild(loginList, "userList");
266+ verify(userList);
267+ tryCompare(userList, "movingInternally", false);
268+ }
254 }
269 }
255
270
256 function tearDown() {
271 function tearDown() {
@@ -674,6 +689,7 @@ Rectangle {
674 function test_launchedAppHasActiveFocus(data) {
689 function test_launchedAppHasActiveFocus(data) {
675 loadShell(data.formFactor);
690 loadShell(data.formFactor);
676 swipeAwayGreeter();
691 swipeAwayGreeter();
692+
677 var dialerApp = ApplicationManager.startApplication("webbrowser-app");
693 var dialerApp = ApplicationManager.startApplication("webbrowser-app");
678 verify(dialerApp);
694 verify(dialerApp);
679 waitUntilAppSurfaceShowsUp("webbrowser-app")
695 waitUntilAppSurfaceShowsUp("webbrowser-app")
@@ -683,18 +699,6 @@ Rectangle {
683 tryCompare(dialerApp.session.surface, "activeFocus", true);
699 tryCompare(dialerApp.session.surface, "activeFocus", true);
684 }
700 }
685
701
686− // Wait for the whole UI to settle down
687− function waitForUIToSettle() {
688− var launcher = findChild(shell, "launcherPanel")
689− tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
690− if (launcher.x === 0) {
691− mouseClick(shell)
692− }
693− tryCompare(launcher, "x", -launcher.width)
694−
695− waitForRendering(shell)
696− }
697−
698 function waitUntilAppSurfaceShowsUp(appId) {
702 function waitUntilAppSurfaceShowsUp(appId) {
699 var appWindow = findChild(shell, "appWindow_" + appId);
703 var appWindow = findChild(shell, "appWindow_" + appId);
700 verify(appWindow);
704 verify(appWindow);