on xenial help sign in
add a tryCompareFunction to get the button, seems it's too slow in the CI systems
commita212706666c9a1358eb4a62ea2916e3108456da9 authorAlbert Astals <albert.astals@canonical.com> dateThu 12 Dec 2013, 09:13 (13 years ago) parentd7f5fb0
1 file changed+16−13
tests/qmltests/Dash/tst_DashContent.qml+16−13
tests/qmltests/Dash/tst_DashContent.qml+16−13
@@ -291,21 +291,24 @@ Item {
291291 tryCompare(tabbar, "selectedIndex", 0);
292292 tryCompare(dashContent, "currentIndex", 0);
293293
294− var button0;
295− 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− } else {
298− button0 = tabbar.children[0].children[0].children[0].children[2].children[1];
299− }
300− console.log("E", button0);
301− waitForRendering(button0);
302−
303− UT.Util.isInstanceOf(button0, "AbstractButton");
304− UT.Util.isInstanceOf(button0.children[3], "Label");
305− tryCompare(button0.children[3], "text", "Music");
294+ var button;
295+ tryCompareFunction(function() {
296+ if (tabbar.children[0].children[0].children[0].children[1].x >= 0) {
297+ button = tabbar.children[0].children[0].children[0].children[1].children[1];
298+ } else {
299+ button = tabbar.children[0].children[0].children[0].children[2].children[1];
300+ }
301+ return button != undefined;
302+ }, true);
303+ console.log("E", button);
304+ waitForRendering(button);
305+
306+ UT.Util.isInstanceOf(button, "AbstractButton");
307+ UT.Util.isInstanceOf(button.children[3], "Label");
308+ tryCompare(button.children[3], "text", "Music");
306309 console.log("F");
307310
308− mouseClick(button0, button0.width / 2, button0.height / 2)
311+ mouseClick(button, button.width / 2, button.height / 2)
309312 console.log("G");
310313
311314 tryCompare(tabbar, "selectionMode", false);