on xenial help sign in
Make PreviewActionsTest::test_comboButton more stable

We also wait for the buttonGroup height to have settled otherwise the mouse clicks can end up in the wrong place Approved by: Andrea Cimitan

commit391dbfed03033549e91a77a8fd5a90cfc5c8ddcd authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 13 Sep 2016, 06:49 (10 years ago) parent6e1f27fb59538d
1 file changed+2−1
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+2−1
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+2−1
@@ -151,15 +151,16 @@ Rectangle {
151151 {
152152 var button = findChild(buttonGroup, "moreLessButton");
153153 var buttonColumn = findChild(buttonGroup, "buttonColumn");
154+ var buttonGroupInitialHeight = buttonGroup.height;
154155 verify(button != null);
155156 mouseClick(button);
156157 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
158+ tryCompare(buttonGroup, "height", buttonGroupInitialHeight + buttonColumn.height + buttonColumn.anchors.topMargin);
157159 }
158160
159161 function test_comboButton(data) {
160162 var twoActionsY = twoActions.y
161163 pressMoreButton(buttonAndCombo);
162− tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
163164 checkButtonPressSignal(buttonAndCombo, data.id);
164165 mouseClick(findChild(buttonAndCombo, "moreLessButton"));
165166 tryCompare(twoActions, "y", twoActionsY);