on xenial help sign in
Make test_departments test more stable

There's various DashDepartments on the dash, make sure we're working over the one that is on screen, otherwise clicks don't end up where they should Approved by: Michał Sawicz, PS Jenkins bot

commit297c5ac0fb979e51dc85564a15ae41f1acfec25e authorAlbert Astals <albert.astals@canonical.com> dateWed 6 Aug 2014, 19:38 (12 years ago) parent7d27ba7e9c4786
1 file changed+4−2
tests/qmltests/Dash/tst_DashContent.qml+4−2
tests/qmltests/Dash/tst_DashContent.qml+4−2
@@ -269,8 +269,10 @@ Item {
269269 }
270270
271271 function test_departments() {
272− var dashDepartments = findChild(dashContent, "dashDepartments");
273− compare(dashDepartments.visible, true);
272+ var dashContentList = findChild(dashContent, "dashContentList");
273+ tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashDepartments") != null; }, true);
274+ var dashDepartments = findChild(dashContentList.currentItem, "dashDepartments");
275+ tryCompare(dashDepartments, "visible", true);
274276 compare(dashDepartments.showList, false);
275277 waitForRendering(dashDepartments);
276278 mouseClick(dashDepartments, 0, 0);