on xenial help sign in
stabilize the test
334e341Lukáš Tinkl
tests/qmltests/Launcher/tst_Drawer.qml+7−17
@@ -87,12 +87,6 @@ StyledItem {
87 }
87 }
88 }
88 }
89
89
90− Binding {
91− target: launcher
92− property: "panelWidth"
93− value: units.gu(Math.round(widthSlider.value))
94− }
95−
96 UnityTestCase {
90 UnityTestCase {
97 id: testCase
91 id: testCase
98 when: windowShown
92 when: windowShown
@@ -115,6 +109,7 @@ StyledItem {
115 tryCompareFunction( function(){ return drawer.x === 0; }, true );
109 tryCompareFunction( function(){ return drawer.x === 0; }, true );
116 tryCompare(launcher, "state", "drawer");
110 tryCompare(launcher, "state", "drawer");
117 tryCompare(launcher, "drawerShown", true);
111 tryCompare(launcher, "drawerShown", true);
112+ return drawer;
118 }
113 }
119
114
120 function revealByEdgePush() {
115 function revealByEdgePush() {
@@ -175,11 +170,9 @@ StyledItem {
175 function test_hideByDraggingDrawer(data) {
170 function test_hideByDraggingDrawer(data) {
176 launcher.lockedVisible = !data.autohide;
171 launcher.lockedVisible = !data.autohide;
177
172
178− dragDrawerIntoView();
173+ var drawer = dragDrawerIntoView();
179 waitForRendering(launcher);
174 waitForRendering(launcher);
180
175
181− var drawer = findChild(launcher, "drawer");
182−
183 mouseFlick(root, drawer.width - units.gu(1), drawer.height / 2, units.gu(2), drawer.height / 2, true, true);
176 mouseFlick(root, drawer.width - units.gu(1), drawer.height / 2, units.gu(2), drawer.height / 2, true, true);
184
177
185 tryCompare(drawer.anchors, "rightMargin", 0);
178 tryCompare(drawer.anchors, "rightMargin", 0);
@@ -188,9 +181,7 @@ StyledItem {
188 }
181 }
189
182
190 function test_hideByClickingOutside() {
183 function test_hideByClickingOutside() {
191− dragDrawerIntoView();
184+ var drawer = dragDrawerIntoView();
192−
193− var drawer = findChild(launcher, "drawer");
194
185
195 mouseClick(root, drawer.width + units.gu(1), root.height / 2);
186 mouseClick(root, drawer.width + units.gu(1), root.height / 2);
196
187
@@ -249,11 +240,10 @@ StyledItem {
249 compare(launcher.lastSelectedApplication, "camera-app");
240 compare(launcher.lastSelectedApplication, "camera-app");
250 }
241 }
251
242
252− function test_directSearch() {
243+ function test_searchDirectly() {
253− dragDrawerIntoView();
244+ var drawer = dragDrawerIntoView();
254− var drawer = findChild(launcher, "drawer");
245+ waitForRendering(launcher);
255− verify(!!drawer);
246+ waitUntilTransitionsEnd(launcher);
256−
257 tryCompare(drawer, "focus", true);
247 tryCompare(drawer, "focus", true);
258
248
259 var searchField = findChild(drawer, "searchField");
249 var searchField = findChild(drawer, "searchField");