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

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

commit3b57f64b46bf114c3a8acb95758993ec2496e92a authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 22 Sep 2016, 07:35 (10 years ago) parent6e86ab80ec0acd
1 file changed+14−6
tests/qmltests/Dash/tst_Dash.qml+14−6
tests/qmltests/Dash/tst_Dash.qml+14−6
@@ -633,18 +633,26 @@ Item {
633633 tryCompare(dashContent.currentScope, "id", "clickscope");
634634
635635 scrollToCategory("dashCategorypredefined");
636− var tile = getCategoryDelegate("predefined", 2);
637− var proportionalShape = findChildsByType(tile, "UCProportionalShape");
638− compare(proportionalShape.length, 1);
636+ tryCompareFunction(function() {
637+ var tile = getCategoryDelegate("predefined", 2);
638+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
639+ return proportionalShape.length === 1;
640+ },
641+ true
642+ );
639643
640644 dash.setCurrentScope("libertine-scope.ubuntu_libertine-scope");
641645 var dashContent = findChild(dash, "dashContent");
642646 tryCompare(dashContent.currentScope, "id", "libertine-scope.ubuntu_libertine-scope");
643647
644648 scrollToCategory("dashCategory2");
645− tile = getCategoryDelegate("2", 2);
646− proportionalShape = findChildsByType(tile, "UCProportionalShape");
647− compare(proportionalShape.length, 1);
649+ tryCompareFunction(function() {
650+ var tile = getCategoryDelegate("2", 2);
651+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
652+ return proportionalShape.length === 1;
653+ },
654+ true
655+ );
648656 }
649657
650658 function test_tempScopeItemXOnResize()