on xenial help sign in
testLauncher: use tryCompare to check launcher contentY

Also init the launcher before each test Approved by: Albert Astals Cid, Lukáš Tinkl, Unity8 CI Bot

commit648036032499c32ae70be4ddb1234fbacd3151af authorMarco Trevisan (Treviño) <mail@3v1n0.net> dateWed 16 Nov 2016, 10:44 (10 years ago) parent28d1c5c9b372b0
2 files changed+16−1
tests/qmltests/Launcher/tst_Launcher.qml+12−1 tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+4
tests/qmltests/Launcher/tst_Launcher.qml+12−1
@@ -113,6 +113,10 @@ Rectangle {
113113 }
114114 Label {
115115 text: "Launcher always visible"
116+ AbstractButton {
117+ anchors.fill: parent
118+ onClicked: lockedVisibleCheckBox.checked = !lockedVisibleCheckBox.checked
119+ }
116120 }
117121 }
118122
@@ -261,9 +265,15 @@ Rectangle {
261265 // iteration to do its work. So to ensure the reload, we will wait until the
262266 // Shell instance gets destroyed.
263267 tryCompare(launcherLoader, "itemDestroyed", true);
268+ }
269+
270+ function initLauncher() {
264271 launcherLoader.active = true;
272+ tryCompare(launcherLoader, "itemDestroyed", false);
265273 }
274+
266275 function init() {
276+ initLauncher();
267277 var panel = findChild(launcher, "launcherPanel");
268278 verify(!!panel);
269279
@@ -279,7 +289,7 @@ Rectangle {
279289 // growing while populating it with icons etc.
280290 tryCompare(listView, "flicking", false);
281291
282− compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");
292+ tryCompare(listView, "contentY", -listView.topMargin, 5000, "Launcher did not start up with first item unfolded");
283293
284294 // Now do check that snapping is in fact enabled
285295 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
@@ -538,6 +548,7 @@ Rectangle {
538548 }
539549
540550 function test_clickFlick_data() {
551+ initLauncher()
541552 var listView = findChild(launcher, "launcherListView");
542553 return [
543554 {tag: "unfolded top", positionViewAtBeginning: true,
tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+4
@@ -40,5 +40,9 @@ RowLayout {
4040 id: label
4141 text: "Mouse emulates touch"
4242 anchors.verticalCenter: parent.verticalCenter
43+ AbstractButton {
44+ anchors.fill: parent
45+ onClicked: checkbox.checked = !checkbox.checked
46+ }
4347 }
4448}