on xenial help sign in
Dash::test_cardIconStyle Turn compare into tryCompareFunction

On very slow machines (CI or valgrind) the UCProportionalShape is not created immediately so give it some slack

commit0ec0acd1fa86ca9ceaaea16e1c4bed9d11d0d7b9 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 18 Aug 2016, 12:42 (10 years ago) parent9ffec52
1 file changed+14−6
tests/qmltests/Dash/tst_Dash.qml+14−6
tests/qmltests/Dash/tst_Dash.qml+14−6
@@ -631,18 +631,26 @@ Item {
631631 tryCompare(dashContent.currentScope, "id", "clickscope");
632632
633633 scrollToCategory("dashCategorypredefined");
634− var tile = getCategoryDelegate("predefined", 2);
635− var proportionalShape = findChildsByType(tile, "UCProportionalShape");
636− compare(proportionalShape.length, 1);
634+ tryCompareFunction(function() {
635+ var tile = getCategoryDelegate("predefined", 2);
636+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
637+ return proportionalShape.length === 1;
638+ },
639+ true
640+ );
637641
638642 dash.setCurrentScope("libertine-scope.ubuntu_libertine-scope");
639643 var dashContent = findChild(dash, "dashContent");
640644 tryCompare(dashContent.currentScope, "id", "libertine-scope.ubuntu_libertine-scope");
641645
642646 scrollToCategory("dashCategory2");
643− tile = getCategoryDelegate("2", 2);
644− proportionalShape = findChildsByType(tile, "UCProportionalShape");
645− compare(proportionalShape.length, 1);
647+ tryCompareFunction(function() {
648+ var tile = getCategoryDelegate("2", 2);
649+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
650+ return proportionalShape.length === 1;
651+ },
652+ true
653+ );
646654 }
647655
648656 function test_tempScopeItemXOnResize()