on xenial help sign in
add a tryCompareFunction to get the button, seems it's too slow in the CI systems
a212706Albert Astals
tests/qmltests/Dash/tst_DashContent.qml+16−13
@@ -291,21 +291,24 @@ Item {
291 tryCompare(tabbar, "selectedIndex", 0);
291 tryCompare(tabbar, "selectedIndex", 0);
292 tryCompare(dashContent, "currentIndex", 0);
292 tryCompare(dashContent, "currentIndex", 0);
293
293
294− var button0;
294+ var button;
295+ tryCompareFunction(function() {
295− if (tabbar.children[0].children[0].children[0].children[1].x >= 0) {
296+ if (tabbar.children[0].children[0].children[0].children[1].x >= 0) {
296− button0 = tabbar.children[0].children[0].children[0].children[1].children[1];
297+ button = tabbar.children[0].children[0].children[0].children[1].children[1];
297− } else {
298+ } else {
298− button0 = tabbar.children[0].children[0].children[0].children[2].children[1];
299+ button = tabbar.children[0].children[0].children[0].children[2].children[1];
299− }
300+ }
301+ return button != undefined;
302+ }, true);
300− console.log("E", button0);
303+ console.log("E", button);
301− waitForRendering(button0);
304+ waitForRendering(button);
302−
305+
303− UT.Util.isInstanceOf(button0, "AbstractButton");
306+ UT.Util.isInstanceOf(button, "AbstractButton");
304− UT.Util.isInstanceOf(button0.children[3], "Label");
307+ UT.Util.isInstanceOf(button.children[3], "Label");
305− tryCompare(button0.children[3], "text", "Music");
308+ tryCompare(button.children[3], "text", "Music");
306 console.log("F");
309 console.log("F");
307
310
308− mouseClick(button0, button0.width / 2, button0.height / 2)
311+ mouseClick(button, button.width / 2, button.height / 2)
309 console.log("G");
312 console.log("G");
310
313
311 tryCompare(tabbar, "selectionMode", false);
314 tryCompare(tabbar, "selectionMode", false);