on xenial help sign in
More reliable compares

Hopefully fixes the fail on ci-train autopkgtest Approved by: Unity8 CI Bot, Michał Sawicz

commit662e2894e90fc4734d4bc0829c0082db690f21b3 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 29 Jan 2016, 11:50 (11 years ago) parentabd2819f3dd6fb
1 file changed+5−6
tests/qmltests/Dash/Previews/tst_Preview.qml+5−6
tests/qmltests/Dash/Previews/tst_Preview.qml+5−6
@@ -121,15 +121,14 @@ Rectangle {
121121 var moreLessButton = findChild(widget, "moreLessButton");
122122 mouseClick(moreLessButton);
123123
124− // Make sure the combo is growing
125− tryCompareFunction(function () { return widget.height > 2 * initialWidgetHeight; }, true);
126−
127124 // Wait for the combo to stop growing
128− tryCompareFunction(function () { var currentWidgetHeight = widget.height; wait(200); return currentWidgetHeight === widget.height;}, true);
125+ tryCompare(widget, "height", units.gu(15));
129126
130127 // Make sure the combo bottom is on the viewport
131− var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
132− verify(bottomLeft.y <= preview.height);
128+ tryCompareFunction(function () {
129+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
130+ return bottomLeft.y <= preview.height
131+ }, true);
133132 }
134133 }
135134}