on xenial help sign in
Use tryCompare to wait for the result.
9963fabMichał Sawicz
tests/qmltests/Dash/tst_Card.qml+8−9
@@ -451,11 +451,11 @@ Rectangle {
451 background.color = data.tag;
451 background.color = data.tag;
452
452
453 if (data.dark) {
453 if (data.dark) {
454− verify(Qt.colorEqual(summary.color, "grey"), "Summary should be grey.");
454+ tryCompareFunction(function() { return Qt.colorEqual(summary.color, "grey"); }, true);
455− verify(Qt.colorEqual(header.fontColor, "grey"), "Header color should be grey.");
455+ tryCompareFunction(function() { return Qt.colorEqual(header.fontColor, "grey"); }, true);
456 } else {
456 } else {
457− verify(Qt.colorEqual(summary.color, "white"), "Summary should be white.");
457+ tryCompareFunction(function() { return Qt.colorEqual(summary.color, "white"); }, true);
458− verify(Qt.colorEqual(header.fontColor, "white"), "Header color should be white.");
458+ tryCompareFunction(function() { return Qt.colorEqual(header.fontColor, "white"); }, true);
459 }
459 }
460 }
460 }
461
461
@@ -469,7 +469,6 @@ Rectangle {
469
469
470 function test_mascotShape(data) {
470 function test_mascotShape(data) {
471 selector.selectedIndex = data.index;
471 selector.selectedIndex = data.index;
472− wait(200)
473
472
474 var shape = findChild(card, "mascotShape");
473 var shape = findChild(card, "mascotShape");
475 var image = findChild(card, "mascotImage");
474 var image = findChild(card, "mascotImage");
@@ -478,11 +477,11 @@ Rectangle {
478 verify(image, "Could not find image.");
477 verify(image, "Could not find image.");
479
478
480 if (data.shape) {
479 if (data.shape) {
481− verify(shape.visible, "Shape should be visible");
480+ tryCompare(shape, "visible", true);
482− verify(!image.visible, "Image should not be visible");
481+ tryCompare(image, "visible", false);
483 } else {
482 } else {
484− verify(!shape.visible, "Shape should not be visible");
483+ tryCompare(shape, "visible", false);
485− verify(image.visible, "Image should be visible");
484+ tryCompare(image, "visible", true);
486 }
485 }
487 }
486 }
488 }
487 }