on xenial help sign in
Need the stubborness in another place, so generalize it
8fff1ddAlbert Astals Cid
tests/qmltests/Dash/Previews/tst_Preview.qml+1−7
@@ -113,13 +113,7 @@ Rectangle {
113
113
114 // Scroll down
114 // Scroll down
115 var previewListRow0 = findChild(preview, "previewListRow0");
115 var previewListRow0 = findChild(preview, "previewListRow0");
116− var i = 0;
116+ tryTouchFlickToYEnd(previewListRow0, previewListRow0.width / 2, units.gu(20), previewListRow0.width / 2, units.gu(1));
117− while (i < 5 && !previewListRow0.atYEnd) {
118− touchFlick(preview, preview.width / 2, units.gu(20), preview.width / 2, units.gu(1));
119− tryCompare(previewListRow0, "moving", false);
120− ++i;
121− }
122− tryCompare(previewListRow0, "atYEnd", true);
123
117
124 // Click on the combo
118 // Click on the combo
125 var widget = findChild(preview, "widget-21");
119 var widget = findChild(preview, "widget-21");
tests/qmltests/Dash/tst_Dash.qml+1−3
@@ -497,9 +497,7 @@ Item {
497 tryCompare(subPageLoader, "x", 0);
497 tryCompare(subPageLoader, "x", 0);
498 tryCompare(findChild(dashTempScopeItem, "categoryListView"), "visible", false);
498 tryCompare(findChild(dashTempScopeItem, "categoryListView"), "visible", false);
499 var previewListRow0 = findChild(subPageLoader, "previewListRow0");
499 var previewListRow0 = findChild(subPageLoader, "previewListRow0");
500− touchFlick(previewListRow0, previewListRow0.width / 2, units.gu(20), previewListRow0.width / 2, units.gu(1));
500+ tryTouchFlickToYEnd(previewListRow0, previewListRow0.width / 2, units.gu(20), previewListRow0.width / 2, units.gu(1));
501− tryCompare(previewListRow0, "atYEnd", true);
502− tryCompare(previewListRow0, "moving", false);
503 var widget = findChild(subPageLoader, "widget-21");
501 var widget = findChild(subPageLoader, "widget-21");
504 var initialWidgetHeight = widget.height;
502 var initialWidgetHeight = widget.height;
505 var openButton = findChild(widget, "buttonopen_click");
503 var openButton = findChild(widget, "buttonopen_click");
tests/utils/modules/Unity/Test/UnityTestCase.qml+10
@@ -221,6 +221,16 @@ TestCase {
221 }
221 }
222 }
222 }
223
223
224+ function tryTouchFlickToYEnd(item, x, y, toX, toY) {
225+ var i = 0;
226+ while (i < 5 && !item.atYEnd) {
227+ touchFlick(item, x, y, toX, toY);
228+ tryCompare(item, "moving", false);
229+ ++i;
230+ }
231+ tryCompare(item, "atYEnd", true);
232+ }
233+
224 function touchEvent(item) {
234 function touchEvent(item) {
225 return UT.Util.touchEvent(item)
235 return UT.Util.touchEvent(item)
226 }
236 }