on xenial help sign in
fix qml tests
da5f503Lukáš Tinkl
qml/Wizard/Page.qml+2−1
@@ -264,6 +264,7 @@ Item {
264
264
265 SequentialAnimation { // animations for the content
265 SequentialAnimation { // animations for the content
266 id: contentAnimation
266 id: contentAnimation
267+ objectName: "contentAnimation"
267 property int animationDurationBase: UbuntuAnimation.BriskDuration
268 property int animationDurationBase: UbuntuAnimation.BriskDuration
268 readonly property int additionalDuration: 200
269 readonly property int additionalDuration: 200
269 property int direction: Qt.LeftToRight
270 property int direction: Qt.LeftToRight
@@ -296,7 +297,7 @@ Item {
296
297
297 ParallelAnimation { // animation for the secondary pages
298 ParallelAnimation { // animation for the secondary pages
298 id: secondaryAnimation
299 id: secondaryAnimation
299−
300+ objectName: "secondaryAnimation"
300 NumberAnimation { // the slide-up animation
301 NumberAnimation { // the slide-up animation
301 target: titleLabel
302 target: titleLabel
302 property: 'animatedTopMargin'
303 property: 'animatedTopMargin'
tests/qmltests/Wizard/tst_Wizard.qml+24−83
@@ -102,7 +102,6 @@ Item {
102 }
102 }
103
103
104 Component.onCompleted: {
104 Component.onCompleted: {
105− theme.name = "Ubuntu.Components.Themes.SuruDark";
106 setup();
105 setup();
107 }
106 }
108
107
@@ -208,13 +207,6 @@ Item {
208 if (name === page.objectName) return page;
207 if (name === page.objectName) return page;
209 tap(findChild(page, "nameInput"));
208 tap(findChild(page, "nameInput"));
210 typeString("foobar");
209 typeString("foobar");
211− tap(findChild(page, "passInput"));
212− typeString("12345678");
213− var pass2Input = findChild(page, "pass2Input");
214− // give it a bit of time to finish the scroll-into-view animation
215− tryCompareFunction(function() { return pass2Input !== null; }, true);
216− tap(pass2Input);
217− typeString("12345678");
218 tap(findChild(page, "forwardButton"));
210 tap(findChild(page, "forwardButton"));
219
211
220 page = waitForPage("passwdPage");
212 page = waitForPage("passwdPage");
@@ -300,21 +292,31 @@ Item {
300 waitForPage("wifiPage"); // thus skipping passwdPage
292 waitForPage("wifiPage"); // thus skipping passwdPage
301 }
293 }
302
294
295+ function verifyAnimationsNotRunning(page) {
296+ var contentAnimation = findInvisibleChild(page, "contentAnimation");
297+ var secondaryAnimation = findInvisibleChild(page, "secondaryAnimation");
298+ tryCompare(contentAnimation, "running", false);
299+ tryCompare(secondaryAnimation, "running", false);
300+ }
301+
303 function test_passwdPasscode() {
302 function test_passwdPasscode() {
304 var page = goToPage("passwdPage");
303 var page = goToPage("passwdPage");
305− tap(findChild(page, "passwdDelegate2")); // passcode option
304+ tap(findChild(page, "passwdDelegate1")); // passcode option
306 tap(findChild(page, "forwardButton"));
305 tap(findChild(page, "forwardButton"));
307 page = waitForPage("passcodeSetPage");
306 page = waitForPage("passcodeSetPage");
307+ verifyAnimationsNotRunning(page);
308
308
309 enterPasscode("1111");
309 enterPasscode("1111");
310 page = waitForPage("passcodeConfirmPage");
310 page = waitForPage("passcodeConfirmPage");
311+ verifyAnimationsNotRunning(page);
311
312
312− // make sure we go back to 'set' page not 'type' page
313 tap(findChild(page, "backButton"));
313 tap(findChild(page, "backButton"));
314 page = waitForPage("passcodeSetPage");
314 page = waitForPage("passcodeSetPage");
315+ verifyAnimationsNotRunning(page);
315
316
316 enterPasscode("1111");
317 enterPasscode("1111");
317 page = waitForPage("passcodeConfirmPage");
318 page = waitForPage("passcodeConfirmPage");
319+ verifyAnimationsNotRunning(page);
318
320
319 enterPasscode("1112");
321 enterPasscode("1112");
320 var error = findChild(page, "wrongNoticeLabel");
322 var error = findChild(page, "wrongNoticeLabel");
@@ -337,47 +339,29 @@ Item {
337
339
338 function test_passwdPassphrase() {
340 function test_passwdPassphrase() {
339 var page = goToPage("passwdPage");
341 var page = goToPage("passwdPage");
340− tap(findChild(page, "passwdDelegate1")); // password option
342+ tap(findChild(page, "passwdDelegate0")); // password option
341 tap(findChild(page, "forwardButton"));
343 tap(findChild(page, "forwardButton"));
342 page = waitForPage("passwdSetPage");
344 page = waitForPage("passwdSetPage");
343
345
344 var passwdField = findChild(page, "passwordField");
346 var passwdField = findChild(page, "passwordField");
345 verify(passwdField);
347 verify(passwdField);
346 tap(passwdField);
348 tap(passwdField);
349+ waitUntilTransitionsEnd(passwdField);
347 typeString("aaa");
350 typeString("aaa");
348− var continueButton = findChild(page, "okButton");
351+ var continueButton = findChild(page, "forwardButton");
349− tryCompare(continueButton, "enabled", false);
352+ tryCompare(page, "passwordsMatching", false);
350
353
351 tap(passwdField);
354 tap(passwdField);
355+ waitUntilTransitionsEnd(passwdField);
352 passwdField.selectAll(); // overwrite the text
356 passwdField.selectAll(); // overwrite the text
353 typeString("12345678");
357 typeString("12345678");
354− tap(continueButton);
358+ tryCompare(page, "passwordsMatching", false);
355− wait(200);
356−
357− // make sure we go back to 'set' page not 'type' page
358− var back = findChild(page, "cancelButton");
359− tap(back);
360− wait(200);
361
359
362− passwdField = findChild(page, "passwordField");
363− tryCompareFunction(function() {return !!passwdField}, true);
364− tap(passwdField);
365− typeString("aaab");
366−
367− continueButton = findChild(page, "okButton");
368− tryCompare(continueButton, "enabled", false);
369− var error = findChild(page, "infoLabel");
360+ var passwd2Field = findChild(page, "password2Field");
370− tryCompareFunction(function() { return error.text !== ""; }, true);
361+ tap(passwd2Field);
371−
362+ waitUntilTransitionsEnd(passwd2Field);
372− tap(passwdField);
373− passwdField.selectAll(); // overwrite the text
374− typeString("12345678");
375− tap(continueButton);
376− wait(200);
377−
378− tap(passwdField);
379− passwdField.selectAll(); // overwrite the text
380 typeString("12345678");
363 typeString("12345678");
364+ tryCompare(continueButton, "enabled", true);
381 tap(continueButton);
365 tap(continueButton);
382
366
383 // now finish up
367 // now finish up
@@ -395,7 +379,7 @@ Item {
395
379
396 function test_passwdSwipe() {
380 function test_passwdSwipe() {
397 var page = goToPage("passwdPage");
381 var page = goToPage("passwdPage");
398− tap(findChild(page, "passwdDelegate3")); // swipe option
382+ tap(findChild(page, "passwdDelegate2")); // swipe option
399
383
400 // now finish up
384 // now finish up
401 tap(findChild(page, "forwardButton"));
385 tap(findChild(page, "forwardButton"));
@@ -405,10 +389,7 @@ Item {
405 waitUntilTransitionsEnd(page);
389 waitUntilTransitionsEnd(page);
406 tap(findChild(page, "finishButton"));
390 tap(findChild(page, "finishButton"));
407
391
408− tryCompare(setSecuritySpy, "count", 1);
392+ tryCompare(setSecuritySpy, "count", 0); // not called for swipe method
409− //compare(setSecuritySpy.signalArguments[0][0], ""); // FIXME the swipe method collides with the account password
410− //compare(setSecuritySpy.signalArguments[0][1], "");
411− compare(setSecuritySpy.signalArguments[0][2], UbuntuSecurityPrivacyPanel.Swipe);
412 }
393 }
413
394
414 function test_locationGpsOnly() {
395 function test_locationGpsOnly() {
@@ -501,50 +482,10 @@ Item {
501
482
502 function test_accountPage() {
483 function test_accountPage() {
503 var page = goToPage("accountPage");
484 var page = goToPage("accountPage");
504− var password1 = findChild(page, "passInput");
505− var password2 = findChild(page, "pass2Input");
506 var forwardButton = findChild(page, "forwardButton");
485 var forwardButton = findChild(page, "forwardButton");
507
486
508 tap(findChild(page, "nameInput"));
487 tap(findChild(page, "nameInput"));
509 typeString("foobar");
488 typeString("foobar");
510−
511− verify(forwardButton.enabled, false); // no passwords yet
512−
513− tap(password1);
514− typeString("12345");
515−
516− verify(forwardButton.enabled, false); // password too short
517−
518− tap(password2);
519− typeString("12345678");
520−
521− verify(forwardButton.enabled, false); // passwords don't match
522−
523− tap(password1);
524− password1.selectAll();
525− typeString("12345678");
526−
527− verify(forwardButton.enabled, true); // now they match
528−
529− var pages = findChild(wizard, "wizardPages");
530− var security = findInvisibleChild(pages, "securityPrivacy");
531− setSecuritySpy.target = security;
532−
533− // now finish up
534− tap(forwardButton);
535− page = waitForPage("passwdPage");
536− tap(findChild(page, "passwdDelegate0")); // account option
537− tap(findChild(page, "forwardButton"));
538− page = waitForPage("reportingPage");
539− tap(findChild(page, "forwardButton"));
540− page = waitForPage("finishedPage");
541− waitUntilTransitionsEnd(page);
542− tap(findChild(page, "finishButton"));
543−
544− tryCompare(setSecuritySpy, "count", 1);
545− compare(setSecuritySpy.signalArguments[0][0], "");
546− compare(setSecuritySpy.signalArguments[0][1], "12345678");
547− compare(setSecuritySpy.signalArguments[0][2], UbuntuSecurityPrivacyPanel.Passphrase);
548 }
489 }
549 }
490 }
550}
491}