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

commit28e09bcd3ce3f62335aec299086b24ca04a45c28 authorAlbert Astals <albert.astals@canonical.com> dateMon 4 Aug 2014, 10:48 (12 years ago) parent7577e0d
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);