on xenial help sign in
Test: More stubborn flick to the end
488b30eAlbert Astals Cid
tests/qmltests/Dash/Previews/tst_Preview.qml+1−3
@@ -113,9 +113,7 @@ Rectangle {
113
113
114 // Scroll down
114 // Scroll down
115 var previewListRow0 = findChild(preview, "previewListRow0");
115 var previewListRow0 = findChild(preview, "previewListRow0");
116− touchFlick(preview, preview.width / 2, units.gu(20), preview.width / 2, units.gu(1));
117− tryCompare(previewListRow0, "atYEnd", true);
116+ flickToYEnd(previewListRow0);
118− tryCompare(previewListRow0, "moving", false);
119
117
120 // Click on the combo
118 // Click on the combo
121 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));
501− tryCompare(previewListRow0, "atYEnd", true);
500+ flickToYEnd(previewListRow0);
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+13
@@ -221,6 +221,19 @@ TestCase {
221 }
221 }
222 }
222 }
223
223
224+ function flickToYEnd(item) {
225+ var i = 0;
226+ var x = item.width / 2;
227+ var y = item.height - units.gu(1);
228+ var toY = units.gu(1);
229+ while (i < 5 && !item.atYEnd) {
230+ touchFlick(item, x, y, x, toY);
231+ tryCompare(item, "moving", false);
232+ ++i;
233+ }
234+ tryCompare(item, "atYEnd", true);
235+ }
236+
224 function touchEvent(item) {
237 function touchEvent(item) {
225 return UT.Util.touchEvent(item)
238 return UT.Util.touchEvent(item)
226 }
239 }