@@ -273,6 +273,33 @@ Item {
273 tryCompare(scopesModel.get(2), "isActive", data.active2);
273 tryCompare(scopesModel.get(2), "isActive", data.active2);
276+ function doFindMusicButton(parent) {
277+ console.log("P", parent);
278+ for (var i = 0; i < parent.children.length; i++) {
279+ var c = parent.children[i];
280+ if (UT.Util.isInstanceOf(c, "AbstractButton") && parent.x >= 0) {
281+ for (var ii = 0; ii < c.children.length; ii++) {
282+ var cc = c.children[ii];
283+ if (UT.Util.isInstanceOf(cc, "Label") && cc.text == "Music") {
288+ var r = doFindMusicButton(c);
289+ if (r !== undefined) {
296+ function findMusicButton() {
297+ // We need to find a AbstractButton that has a Label child
298+ // with text Music and it's parent x is >= 0
299+ var tabbar = findChild(dashContent, "tabbar");
300+ return doFindMusicButton(tabbar);
276 function test_tabBar_index_change() {
303 function test_tabBar_index_change() {
277 console.log("A");
304 console.log("A");
278 tryCompare(scopesModel, "loaded", true);
305 tryCompare(scopesModel, "loaded", true);
@@ -292,20 +319,10 @@ Item {
292 tryCompare(dashContent, "currentIndex", 0);
319 tryCompare(dashContent, "currentIndex", 0);
294 var button;
321 var button;
295− tryCompareFunction(function() {
322+ tryCompareFunction(function() { button = findMusicButton(); return button != undefined; }, true);
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];
299− button = tabbar.children[0].children[0].children[0].children[2].children[1];
301− return button != undefined;
303 console.log("E", button);
323 console.log("E", button);
304 waitForRendering(button);
324 waitForRendering(button);
306− UT.Util.isInstanceOf(button, "AbstractButton");
307− UT.Util.isInstanceOf(button.children[3], "Label");
308− tryCompare(button.children[3], "text", "Music");
309 console.log("F");
326 console.log("F");
311 mouseClick(button, button.width / 2, button.height / 2)
328 mouseClick(button, button.width / 2, button.height / 2)