on xenial help sign in
More stable dash overview tests

Approved by: Michał Sawicz, PS Jenkins bot

commitc3f33dd23e11dfe6170189cc7264ca6f53d1eb22 authorAlbert Astals <albert.astals@canonical.com> dateFri 22 Aug 2014, 09:27 (12 years ago) parent1a3ac0dcd4bedf
1 file changed+12−6
tests/qmltests/Dash/tst_Dash.qml+12−6
tests/qmltests/Dash/tst_Dash.qml+12−6
@@ -96,8 +96,10 @@ Item {
9696 tryCompare(scopes, "loaded", true);
9797 var dashContentList = findChild(dash, "dashContentList");
9898 tryCompare(dashContentList, "count", 6);
99− var mockScope1Loader = findChild(dash, "MockScope1 loader");
100− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
99+ tryCompareFunction(function() {
100+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
101+ return mockScope1Loader && mockScope1Loader.item != null; },
102+ true);
101103
102104 // Show the overview
103105 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -159,8 +161,10 @@ Item {
159161 tryCompare(scopes, "loaded", true);
160162 var dashContentList = findChild(dash, "dashContentList");
161163 tryCompare(dashContentList, "count", 6);
162− var mockScope1Loader = findChild(dash, "MockScope1 loader");
163− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
164+ tryCompareFunction(function() {
165+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
166+ return mockScope1Loader && mockScope1Loader.item != null; },
167+ true);
164168
165169 // Show the overview
166170 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -224,8 +228,10 @@ Item {
224228 tryCompare(scopes, "loaded", true);
225229 var dashContentList = findChild(dash, "dashContentList");
226230 tryCompare(dashContentList, "count", 6);
227− var mockScope1Loader = findChild(dash, "MockScope1 loader");
228− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
231+ tryCompareFunction(function() {
232+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
233+ return mockScope1Loader && mockScope1Loader.item != null; },
234+ true);
229235
230236 // Swipe right to Apps scope
231237 touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));