on xenial help sign in
Click on the correct tile

There's more than one dashCategory1 so make sure we look for the correct one otherwise we may be clicking on something that is not on screen

commit12668a6c965c53bcc48c896ab39c24c1ef3cb5f1 authorAlbert Astals <albert.astals@canonical.com> dateThu 13 Mar 2014, 13:17 (13 years ago) parentc80c0b2
1 file changed+9−5
tests/qmltests/Dash/tst_DashContent.qml+9−5
tests/qmltests/Dash/tst_DashContent.qml+9−5
@@ -364,10 +364,13 @@ Item {
364364
365365 function test_showPreviewCarousel() {
366366 tryCompareFunction(function() {
367− var dashCategory1 = findChild(dashContent, "dashCategory1");
368− if (dashCategory1 != null) {
369− var tile = findChild(dashCategory1, "carouselDelegate1");
370− return tile != null;
367+ var scope = findChild(dashContent, "MockScope1 loader");
368+ if (scope != null) {
369+ var dashCategory1 = findChild(scope, "dashCategory1");
370+ if (dashCategory1 != null) {
371+ var tile = findChild(dashCategory1, "carouselDelegate1");
372+ return tile != null;
373+ }
371374 }
372375 return false;
373376 },
@@ -378,7 +381,8 @@ Item {
378381 var previewListView = findChild(dashContent, "dashContentPreviewList");
379382 tryCompare(previewListView, "open", false);
380383
381− var dashCategory1 = findChild(dashContent, "dashCategory1");
384+ var scope = findChild(dashContent, "MockScope1 loader");
385+ var dashCategory1 = findChild(scope, "dashCategory1");
382386 var tile = findChild(dashCategory1, "carouselDelegate1");
383387 mouseClick(tile, tile.width / 2, tile.height / 2);
384388 tryCompare(previewListView, "open", true);