on xenial help sign in
Make PreviewActionsTest::test_comboButton more stable
10b5a9eAlbert Astals Cid
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−1
@@ -151,15 +151,17 @@ Rectangle {
151 {
151 {
152 var button = findChild(buttonGroup, "moreLessButton");
152 var button = findChild(buttonGroup, "moreLessButton");
153 var buttonColumn = findChild(buttonGroup, "buttonColumn");
153 var buttonColumn = findChild(buttonGroup, "buttonColumn");
154+ var buttonColumnInitialHeight = buttonColumn.height;
155+ var buttonGroupInitialHeight = buttonGroup.height;
154 verify(button != null);
156 verify(button != null);
155 mouseClick(button);
157 mouseClick(button);
156 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
158 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
159+ tryCompare(buttonGroup, "height", buttonGroupInitialHeight + (buttonColumn.height - buttonColumnInitialHeight + units.gu(1)));
157 }
160 }
158
161
159 function test_comboButton(data) {
162 function test_comboButton(data) {
160 var twoActionsY = twoActions.y
163 var twoActionsY = twoActions.y
161 pressMoreButton(buttonAndCombo);
164 pressMoreButton(buttonAndCombo);
162− tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
163 checkButtonPressSignal(buttonAndCombo, data.id);
165 checkButtonPressSignal(buttonAndCombo, data.id);
164 mouseClick(findChild(buttonAndCombo, "moreLessButton"));
166 mouseClick(findChild(buttonAndCombo, "moreLessButton"));
165 tryCompare(twoActions, "y", twoActionsY);
167 tryCompare(twoActions, "y", twoActionsY);