on xenial help sign in
Improve test_set_current_scope_reset reliability.
94e20b8Michał Sawicz
tests/qmltests/Dash/tst_DashContent.qml+9−4
@@ -61,6 +61,11 @@ Item {
61 signalName: "movementStarted"
61 signalName: "movementStarted"
62 }
62 }
63
63
64+ SignalSpy {
65+ id: loadedSpy
66+ signalName: "loaded"
67+ }
68+
64 UT.UnityTestCase {
69 UT.UnityTestCase {
65 name: "DashContent"
70 name: "DashContent"
66 when: scopesModel.loaded && windowShown
71 when: scopesModel.loaded && windowShown
@@ -78,6 +83,7 @@ Item {
78
83
79 function cleanup() {
84 function cleanup() {
80 movementStartedSpy.clear();
85 movementStartedSpy.clear();
86+ loadedSpy.clear();
81 dashContent.visible = true;
87 dashContent.visible = true;
82
88
83 var dashContentList = findChild(dashContent, "dashContentList");
89 var dashContentList = findChild(dashContent, "dashContentList");
@@ -134,13 +140,12 @@ Item {
134
140
135 function test_set_current_scope_reset() {
141 function test_set_current_scope_reset() {
136 var dashContentList = findChild(dashContent, "dashContentList");
142 var dashContentList = findChild(dashContent, "dashContentList");
137− verify(dashContentList != undefined);
143+ verify(dashContentList, "Couldn't find dashContentList");
138 var scope = findChild(dashContent, "MockScope1 loader");
144 var scope = findChild(dashContent, "MockScope1 loader");
139− waitForRendering(scope);
140
145
141− var categoryListView = findChild(dashContentList, "categoryListView");
146+ tryCompare(scope, "status", Loader.Ready);
142− waitForRendering(categoryListView);
143
147
148+ var categoryListView = findChild(dashContentList, "categoryListView");
144 categoryListView.contentY = units.gu(10);
149 categoryListView.contentY = units.gu(10);
145
150
146 compare(dashContentList.currentItem.item.objectName, "MockScope1")
151 compare(dashContentList.currentItem.item.objectName, "MockScope1")