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

commit10b5a9eecd28f06008e52d0d4a69fd80a9d5f849 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 18 Aug 2016, 16:26 (10 years ago) parent9ffec52
1 file changed+3−1
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−1
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−1
@@ -151,15 +151,17 @@ Rectangle {
151151 {
152152 var button = findChild(buttonGroup, "moreLessButton");
153153 var buttonColumn = findChild(buttonGroup, "buttonColumn");
154+ var buttonColumnInitialHeight = buttonColumn.height;
155+ var buttonGroupInitialHeight = buttonGroup.height;
154156 verify(button != null);
155157 mouseClick(button);
156158 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
159+ tryCompare(buttonGroup, "height", buttonGroupInitialHeight + (buttonColumn.height - buttonColumnInitialHeight + units.gu(1)));
157160 }
158161
159162 function test_comboButton(data) {
160163 var twoActionsY = twoActions.y
161164 pressMoreButton(buttonAndCombo);
162− tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
163165 checkButtonPressSignal(buttonAndCombo, data.id);
164166 mouseClick(findChild(buttonAndCombo, "moreLessButton"));
165167 tryCompare(twoActions, "y", twoActionsY);