on xenial help sign in
fix some tests
commitea99c0115175b7a810b5dfeb3f59eee17888fb57 authorMichael Terry <mike@mterry.name> dateTue 17 Jan 2017, 10:43 (10 years ago) parente043e4c
3 files changed+13−15
qml/Greeter/LoginList.qml+1 tests/plugins/LightDM/IntegratedLightDM/dbus.cpp+6−11 tests/qmltests/tst_Shell.qml+6−4
qml/Greeter/LoginList.qml+1
@@ -292,6 +292,7 @@ StyledItem {
292292
293293 WrongPasswordAnimation {
294294 id: wrongPasswordAnimation
295+ objectName: "wrongPasswordAnimation"
295296 target: promptList
296297 }
297298}
tests/plugins/LightDM/IntegratedLightDM/dbus.cpp+6−11
@@ -137,10 +137,10 @@ private Q_SLOTS:
137137 {
138138 QSignalSpy spy(this, &GreeterDBusTest::PropertiesChangedRelay);
139139 greeter->authenticate("has-password");
140− spy.wait();
141140
142− QVERIFY(spy.count() > 0);
143− QList<QVariant> arguments = spy.takeFirst();
141+ QTRY_COMPARE(spy.count(), 2); // EntryIsLocked then ActiveEntry
142+
143+ QList<QVariant> arguments = spy[1];
144144 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
145145 QVERIFY(arguments.at(1).toMap().contains("ActiveEntry"));
146146 QVERIFY(arguments.at(1).toMap()["ActiveEntry"] == "has-password");
@@ -162,15 +162,10 @@ private Q_SLOTS:
162162 QSignalSpy spy(this, &GreeterDBusTest::PropertiesChangedRelay);
163163 greeter->authenticate("no-password");
164164
165− // Two property changed signals will be emitted, one for the IsLocked
166− // property, one for the ActiveEntry; the first will be IsLocked.
167− spy.wait();
168− if (spy.count() < 2) {
169− spy.wait();
170− }
171− QCOMPARE(spy.count(), 2);
165+ // EntryIsLocked=true, ActiveEntry, then EntryIsLocked=false
166+ QTRY_COMPARE(spy.count(), 3);
172167
173− QList<QVariant> arguments = spy.takeLast();
168+ QList<QVariant> arguments = spy[2];
174169 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
175170 QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
176171 QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);
tests/qmltests/tst_Shell.qml+6−4
@@ -825,13 +825,15 @@ Rectangle {
825825 keyClick(Qt.Key_Escape) // Reset state if we're not moving
826826 while (userlist.currentIndex != i) {
827827 var next = userlist.currentIndex + 1
828+ var key = Qt.Key_Down;
828829 if (userlist.currentIndex > i) {
829830 next = userlist.currentIndex - 1
831+ key = Qt.Key_Up;
830832 }
831− tap(findChild(greeter, "username"+next));
833+ keyPress(key);
832834 tryCompare(userlist, "currentIndex", next)
833− tryCompare(userlist, "movingInternally", false)
834835 }
836+ tryCompare(userlist, "movingInternally", false);
835837 tryCompare(shell, "waitingOnGreeter", false); // wait for PAM to settle
836838 }
837839
@@ -854,7 +856,7 @@ Rectangle {
854856 var greeter = findChild(shell, "greeter")
855857 tryCompare(greeter, "fullyShown", true);
856858
857− var passwordInput = findChild(shell, "passwordInput");
859+ var passwordInput = findChild(shell, "greeterPrompt0");
858860
859861 var promptButton = findChild(passwordInput, "promptButton");
860862 tryCompare(promptButton, "visible", isButton);
@@ -1465,7 +1467,7 @@ Rectangle {
14651467 confirmLoggedIn(data.loggedIn)
14661468
14671469 if (data.passwordFocus) {
1468− var passwordInput = findChild(greeter, "passwordInput")
1470+ var passwordInput = findChild(greeter, "greeterPrompt0");
14691471 tryCompare(passwordInput, "focus", true)
14701472 }
14711473 }