on xenial help sign in
More stable dash overview tests
c3f33ddAlbert Astals
tests/qmltests/Dash/tst_Dash.qml+12−6
@@ -96,8 +96,10 @@ Item {
96 tryCompare(scopes, "loaded", true);
96 tryCompare(scopes, "loaded", true);
97 var dashContentList = findChild(dash, "dashContentList");
97 var dashContentList = findChild(dash, "dashContentList");
98 tryCompare(dashContentList, "count", 6);
98 tryCompare(dashContentList, "count", 6);
99+ tryCompareFunction(function() {
99− var mockScope1Loader = findChild(dash, "MockScope1 loader");
100+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
100− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
101+ return mockScope1Loader && mockScope1Loader.item != null; },
102+ true);
101
103
102 // Show the overview
104 // Show the overview
103 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
105 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -159,8 +161,10 @@ Item {
159 tryCompare(scopes, "loaded", true);
161 tryCompare(scopes, "loaded", true);
160 var dashContentList = findChild(dash, "dashContentList");
162 var dashContentList = findChild(dash, "dashContentList");
161 tryCompare(dashContentList, "count", 6);
163 tryCompare(dashContentList, "count", 6);
164+ tryCompareFunction(function() {
162− var mockScope1Loader = findChild(dash, "MockScope1 loader");
165+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
163− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
166+ return mockScope1Loader && mockScope1Loader.item != null; },
167+ true);
164
168
165 // Show the overview
169 // Show the overview
166 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
170 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -224,8 +228,10 @@ Item {
224 tryCompare(scopes, "loaded", true);
228 tryCompare(scopes, "loaded", true);
225 var dashContentList = findChild(dash, "dashContentList");
229 var dashContentList = findChild(dash, "dashContentList");
226 tryCompare(dashContentList, "count", 6);
230 tryCompare(dashContentList, "count", 6);
231+ tryCompareFunction(function() {
227− var mockScope1Loader = findChild(dash, "MockScope1 loader");
232+ var mockScope1Loader = findChild(dash, "MockScope1 loader");
228− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
233+ return mockScope1Loader && mockScope1Loader.item != null; },
234+ true);
229
235
230 // Swipe right to Apps scope
236 // Swipe right to Apps scope
231 touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));
237 touchFlick(dash, dash.width - 1, units.gu(1), dash.width - units.gu(10), units.gu(1));