on xenial help sign in
Test: By default mouseX act on the middle

Saves us lots of typing, tests are easier to read and workarounds problems that sometimes happen if we end up with 0, 0 as mouse coordinates because the precission of some geometry goes crazy and since we're clicking on 0x0 after lots transformations of pos into pos into pos we end up clicking outside the item by a very small number

commit08c32e08a4dcaf6971ca30fa806671547f404f14 authorAlbert Astals <albert.astals@canonical.com> dateFri 9 Jan 2015, 10:15 (12 years ago) parent81652a2
28 files changed+203−142
tests/qmltests/Components/tst_Carousel.qml+5−5 tests/qmltests/Components/tst_Lockscreen.qml+1−1 tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−3 tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml+5−5 tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+2−2 tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+6−6 tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+5−5 tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml+1−1 tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+2−2 tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+2−2 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml+2−2 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml+3−3 tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml+2−2 tests/qmltests/Dash/tst_Card.qml+2−2 tests/qmltests/Dash/tst_Dash.qml+19−19 tests/qmltests/Dash/tst_DashContent.qml+25−25 tests/qmltests/Dash/tst_GenericScopeView.qml+26−26 tests/qmltests/Dash/tst_PageHeader.qml+1−1 tests/qmltests/Dash/tst_PreviewListView.qml+2−2 tests/qmltests/Launcher/tst_Launcher.qml+8−8 tests/qmltests/Notifications/tst_Notifications.qml+6−6 tests/qmltests/Notifications/tst_OptionToggle.qml+7−7 tests/qmltests/Notifications/tst_SwipeToAct.qml+1−1 tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml+2−2 tests/qmltests/Panel/tst_IndicatorsBar.qml+1−1 tests/qmltests/tst_Shell.qml+2−2 tests/qmltests/tst_TabletShell.qml+1−1 tests/utils/modules/Unity/Test/UnityTestCase.qml+61
tests/qmltests/Components/tst_Carousel.qml+5−5
@@ -274,20 +274,20 @@ Item {
274274
275275 spy.signalName = "clicked";
276276 spy.target = carouselItem;
277− mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
277+ mouseClick(carouselItem);
278278 tryCompare(carouselList, "moving", false);
279279 tryCompare(carouselItem, "explicitlyScaled", true);
280− mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
280+ mouseClick(carouselItem);
281281 spy.wait();
282282
283283 spy.signalName = "pressAndHold";
284284 spy.target = carouselItem;
285− mouseClick(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
285+ mouseClick(carouselItem);
286286 tryCompare(carouselList, "moving", false);
287287 tryCompare(carouselItem, "explicitlyScaled", true);
288− mousePress(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
288+ mousePress(carouselItem);
289289 spy.wait();
290− mouseRelease(carouselItem, carouselItem.width / 2, carouselItem.height / 2);
290+ mouseRelease(carouselItem);
291291 }
292292 }
293293}
tests/qmltests/Components/tst_Lockscreen.qml+1−1
@@ -421,7 +421,7 @@ Rectangle {
421421 signalSpy.clear();
422422
423423 var okButton = findChild(root, "infoPopupOkButton");
424− mouseClick(okButton, okButton.width / 2, okButton.height / 2);
424+ mouseClick(okButton);
425425
426426 tryCompareFunction(function() { return findChild(root, "infoPopup") === null}, true);
427427
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−3
@@ -104,7 +104,7 @@ Rectangle {
104104 var button = findChild(root, "button" + id);
105105 verify(button != null);
106106 spy.target = target;
107− mouseClick(button, button.width / 2, button.height / 2);
107+ mouseClick(button);
108108 compare(spy.count, 1);
109109 compare(spy.signalArguments[0][0], target.widgetId);
110110 compare(spy.signalArguments[0][1], id);
@@ -137,11 +137,11 @@ Rectangle {
137137 var buttonColumn = findChild(root, "buttonColumn");
138138 verify(button != null);
139139 var twoActionsY = twoActions.y
140− mouseClick(button, button.width / 2, button.height / 2);
140+ mouseClick(button);
141141 tryCompareFunction(function () { return twoActions.y <= twoActionsY; }, false);
142142 tryCompare(buttonColumn, "height", buttonColumn.implicitHeight);
143143 checkButtonPressSignal(buttonAndCombo, data.id, data.buttonNumber);
144− mouseClick(button, button.width / 2, button.height / 2);
144+ mouseClick(button);
145145 tryCompare(twoActions, "y", twoActionsY);
146146 }
147147 }
tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml+5−5
@@ -131,7 +131,7 @@ Rectangle {
131131 compare(track2ProgressBar.visible, false);
132132
133133 // Playing track 0 should make progress bar 0 visible
134− mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
134+ mouseClick(track0PlayButton);
135135
136136 tryCompare(audio, "playbackState", Audio.PlayingState);
137137 checkPlayerSource(0);
@@ -141,18 +141,18 @@ Rectangle {
141141 tryCompare(track2ProgressBar, "visible", false);
142142
143143 // Clicking the button again should pause it. The progress bar should stay visible
144− mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
144+ mouseClick(track0PlayButton);
145145 tryCompare(audio, "playbackState", Audio.PausedState);
146146 checkPlayerSource(0);
147147 tryCompare(track0ProgressBar, "visible", true);
148148
149149 // Continue playback
150− mouseClick(track0PlayButton, track0PlayButton.width / 2, track0PlayButton.height / 2);
150+ mouseClick(track0PlayButton);
151151 tryCompare(audio, "playbackState", Audio.PlayingState);
152152 checkPlayerSource(0);
153153
154154 // Playing track 1 should make progress bar 1 visible and hide progress bar 0 again
155− mouseClick(track1PlayButton, track1PlayButton.width / 2, track1PlayButton.height / 2);
155+ mouseClick(track1PlayButton);
156156
157157 tryCompare(audio, "playbackState", Audio.PlayingState);
158158 checkPlayerSource(1);
@@ -162,7 +162,7 @@ Rectangle {
162162 tryCompare(track2ProgressBar, "visible", false);
163163
164164 // Playing track 2 should make progress bar 1 visible and hide progress bar 0 again
165− mouseClick(track2PlayButton, track2PlayButton.width / 2, track2PlayButton.height / 2);
165+ mouseClick(track2PlayButton);
166166
167167 tryCompare(audio, "playbackState", Audio.PlayingState);
168168 checkPlayerSource(2);
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+2−2
@@ -85,7 +85,7 @@ Rectangle {
8585
8686 function test_expand_collapse() {
8787 var expandButton = findChild(previewExpandable, "expandButton")
88− mouseClick(expandButton, expandButton.width / 2, expandButton.height / 2);
88+ mouseClick(expandButton);
8989
9090 var repeater = findChild(previewExpandable, "repeater")
9191 compare(repeater.count, 4)
@@ -99,7 +99,7 @@ Rectangle {
9999 compare (repeater.itemAt(2).expanded, true);
100100 compare (repeater.itemAt(3).expanded, true);
101101
102− mouseClick(expandButton, expandButton.width / 2, expandButton.height / 2);
102+ mouseClick(expandButton);
103103
104104 checkInitialState();
105105 }
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+6−6
@@ -67,23 +67,23 @@ Rectangle {
6767
6868 function test_overlayOpenClose() {
6969 var image0 = findChild(imageGallery, "previewImage0");
70− mouseClick(image0, image0.width / 2, image0.height / 2);
70+ mouseClick(image0);
7171 tryCompare(overlay, "visible", true);
7272 tryCompare(overlay, "scale", 1.0);
7373 tryCompare(overlayCloseButton, "visible", true);
74− mouseClick(overlayCloseButton, overlayCloseButton.width / 2, overlayCloseButton.height / 2);
74+ mouseClick(overlayCloseButton);
7575 tryCompare(overlay, "visible", false);
7676 }
7777
7878 function test_overlayShowHideHeader() {
7979 var image0 = findChild(imageGallery, "previewImage0");
80− mouseClick(image0, image0.width / 2, image0.height / 2);
80+ mouseClick(image0);
8181 tryCompare(overlay, "visible", true);
8282 tryCompare(overlay, "scale", 1.0);
8383 tryCompare(overlayCloseButton, "visible", true);
84− mouseClick(overlay, overlay.width / 2, overlay.height / 2);
84+ mouseClick(overlay);
8585 tryCompare(overlayCloseButton, "visible", false);
86− mouseClick(overlay, overlay.width / 2, overlay.height / 2);
86+ mouseClick(overlay);
8787 tryCompare(overlayCloseButton, "visible", true);
8888 }
8989
@@ -97,7 +97,7 @@ Rectangle {
9797
9898 function test_overlayOpenCorrectImage(data) {
9999 var image = findChild(imageGallery, "previewImage" + data.index);
100− mouseClick(image, image.width / 2, image.height / 2);
100+ mouseClick(image);
101101 tryCompare(overlay, "visible", true);
102102 tryCompare(overlay, "scale", 1.0);
103103 tryCompare(overlayListView, "currentIndex", data.index);
tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+5−5
@@ -84,7 +84,7 @@ Rectangle {
8484 var button = findChild(previewPayments, "paymentButton");
8585 verify(button, "Button not found.");
8686
87− mouseClick(button, button.width / 2, button.height / 2);
87+ mouseClick(button);
8888
8989 paymentClient.process();
9090 spy.wait();
@@ -107,7 +107,7 @@ Rectangle {
107107 tryCompare(button, "visible", true);
108108 tryCompare(button, "opacity", 1);
109109
110− mouseClick(button, button.width / 2, button.height / 2);
110+ mouseClick(button););
111111
112112 paymentClient.process();
113113 spy.wait();
@@ -130,7 +130,7 @@ Rectangle {
130130 tryCompare(button, "visible", true);
131131 tryCompare(button, "opacity", 1);
132132
133− mouseClick(button, button.width / 2, button.height / 2);
133+ mouseClick(button););
134134
135135 tryCompare(progress, "visible", true);
136136 tryCompare(progress, "opacity", 1);
@@ -154,7 +154,7 @@ Rectangle {
154154 var button = findChild(previewPayments, "paymentButton");
155155 verify(button, "Button not found.");
156156
157− mouseClick(button, button.width / 2, button.height / 2);
157+ mouseClick(button););
158158
159159 paymentClient.process();
160160 spy.wait();
@@ -175,7 +175,7 @@ Rectangle {
175175 verify(button, "Button not found.");
176176 verify(progress, "Progress not found.");
177177
178− mouseClick(button, button.width / 2, button.height / 2);
178+ mouseClick(button););
179179
180180 tryCompare(progress, "visible", true);
181181 tryCompare(progress, "opacity", 1);
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml+1−1
@@ -118,7 +118,7 @@ Rectangle {
118118 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
119119
120120 // Tap on first star
121− mouseClick(rating, 0, 0);
121+ mouseClick(rating);
122122 compare(rating.value, reviewsModel1["reviews"][1]["rating"]);
123123 }
124124 }
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+2−2
@@ -139,7 +139,7 @@ Rectangle {
139139 verify(reviewTextArea.visible === true);
140140
141141 reviewTextArea.text = data.inputText;
142− mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
142+ mouseClick(submitButton);
143143 switch (data.widgetData["required"]) {
144144 case "rating": {
145145 if (rating.visible === false || data.inputRating < 0) {
@@ -187,7 +187,7 @@ Rectangle {
187187 if (data.inputRating > 0) rating.value = data.inputRating;
188188 if (data.inputText !== "") {
189189 reviewTextArea.text = data.inputText;
190− mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
190+ mouseClick(submitButton);
191191 }
192192
193193 compare(spy.count, 1);
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+2−2
@@ -72,11 +72,11 @@ Rectangle {
7272
7373 function test_zoomableImageOpenClose() {
7474 var overlayCloseButton = findChild(overlay, "overlayCloseButton");
75− mouseClick(lazyImage, lazyImage.width / 2, lazyImage.height / 2);
75+ mouseClick(lazyImage);
7676 tryCompare(overlay, "visible", true);
7777 tryCompare(overlay, "scale", 1.0);
7878 tryCompare(overlayCloseButton, "visible", true);
79− mouseClick(overlayCloseButton, overlayCloseButton.width / 2, overlayCloseButton.height / 2);
79+ mouseClick(overlayCloseButton);
8080 tryCompare(overlay, "visible", false);
8181 }
8282 }
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml+2−2
@@ -49,12 +49,12 @@ Rectangle {
4949
5050 function test_updated() {
5151 var control = findChild(scopeSetting, "control");
52− mouseClick(control, control.width / 2, control.height / 2);
52+ mouseClick(control);
5353 spy.wait();
5454 compare(spy.signalArguments[0][0], false);
5555
5656 spy.clear();
57− mouseClick(scopeSetting, scopeSetting.width / 2, scopeSetting.height / 2);
57+ mouseClick(scopeSetting);
5858 spy.wait();
5959 compare(spy.signalArguments[0][0], true);
6060 }
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml+3−3
@@ -57,7 +57,7 @@ Rectangle {
5757 }
5858
5959 function test_updated_on_unfocus() {
60− mouseClick(control, control.width / 2, control.height / 2);
60+ mouseClick(control);
6161 control.selectAll();
6262 control.cut();
6363 control.insert(0, newNumber);
@@ -67,7 +67,7 @@ Rectangle {
6767 }
6868
6969 function test_updated_on_accepted() {
70− mouseClick(control, control.width / 2, control.height / 2);
70+ mouseClick(control);
7171 control.selectAll();
7272 control.cut();
7373 control.insert(0, newNumber);
@@ -86,7 +86,7 @@ Rectangle {
8686 }
8787
8888 function test_unacceptable_input() {
89− mouseClick(control, control.width / 2, control.height / 2);
89+ mouseClick(control);
9090 control.selectAll();
9191 control.cut();
9292 control.insert(0, "not valid");
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml+2−2
@@ -57,7 +57,7 @@ Rectangle {
5757 }
5858
5959 function test_updated_on_unfocus() {
60− mouseClick(control, control.width / 2, control.height / 2);
60+ mouseClick(control);
6161 control.selectAll();
6262 control.cut();
6363 control.insert(0, newText);
@@ -67,7 +67,7 @@ Rectangle {
6767 }
6868
6969 function test_updated_on_accepted() {
70− mouseClick(control, control.width / 2, control.height / 2);
70+ mouseClick(control);
7171 control.selectAll();
7272 control.cut();
7373 control.insert(0, newText);
tests/qmltests/Dash/tst_Card.qml+2−2
@@ -539,9 +539,9 @@ Rectangle {
539539 var touchdown = findChild(card, "touchdown");
540540
541541 compare(touchdown.visible, false);
542− mousePress(card, card.width/2, card.height/2);
542+ mousePress(card);
543543 compare(touchdown.visible, true);
544− mouseRelease(card, card.width/2, card.height/2);
544+ mouseRelease(card);
545545 compare(touchdown.visible, false);
546546 }
547547
tests/qmltests/Dash/tst_Dash.qml+19−19
@@ -90,7 +90,7 @@ Item {
9090 var scopesList = findChild(dash, "scopesList");
9191 var scopesListPageHeader = findChild(scopesList, "pageHeader");
9292 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
93− mouseClick(backButton, 0, 0);
93+ mouseClick(backButton);
9494 tryCompare(bottomEdgeController, "progress", 0);
9595 }
9696
@@ -106,7 +106,7 @@ Item {
106106 tryCompare(favScopesListCategoryList, "currentIndex", 0);
107107
108108 // Click in first item
109− mouseClick(favScopesListCategoryList.currentItem, 0, 0);
109+ mouseClick(favScopesListCategoryList.currentItem);
110110
111111 // Make sure animation went back
112112 tryCompare(bottomEdgeController, "progress", 0);
@@ -128,7 +128,7 @@ Item {
128128
129129 // Click in second item
130130 favScopesListCategoryList.currentIndex = 1;
131− mouseClick(favScopesListCategoryList.currentItem, 0, 0);
131+ mouseClick(favScopesListCategoryList.currentItem);
132132
133133 // Make sure animation went back
134134 tryCompare(bottomEdgeController, "progress", 0);
@@ -148,7 +148,7 @@ Item {
148148 tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
149149
150150 // Click on a non favorite scope
151− mouseClick(nonfavScopesListCategoryList.currentItem, 0, 0);
151+ mouseClick(nonfavScopesListCategoryList.currentItem);
152152
153153 // Check the bottom edge (manage dash) is disabled from temp scope
154154 var overviewDragHandle = findChild(dash, "overviewDragHandle");
@@ -165,7 +165,7 @@ Item {
165165 // Go back
166166 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
167167 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
168− mouseClick(backButton, 0, 0);
168+ mouseClick(backButton);
169169
170170 // Check temp scope is gone
171171 tryCompare(dashTempScopeItem, "x", dash.width);
@@ -189,7 +189,7 @@ Item {
189189 var scopesList = findChild(dash, "scopesList");
190190 var scopesListPageHeader = findChild(scopesList, "pageHeader");
191191 var searchButton = findChild(scopesListPageHeader, "search_header_button");
192− mouseClick(searchButton, 0, 0);
192+ mouseClick(searchButton);
193193
194194 // Type something
195195 keyClick(Qt.Key_H);
@@ -201,7 +201,7 @@ Item {
201201 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
202202
203203 waitForRendering(cardTempScope);
204− mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
204+ mouseClick(cardTempScope);
205205
206206 // Check the bottom edge (overview) is disabled from temp scope
207207 var overviewDragHandle = findChild(dash, "overviewDragHandle");
@@ -218,7 +218,7 @@ Item {
218218 // Go back
219219 var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
220220 var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
221− mouseClick(backButton, 0, 0);
221+ mouseClick(backButton);
222222
223223 // Check temp scope is gone
224224 tryCompare(dashTempScopeItem, "x", dash.width);
@@ -244,7 +244,7 @@ Item {
244244 var scopesList = findChild(dash, "scopesList");
245245 var scopesListPageHeader = findChild(scopesList, "pageHeader");
246246 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
247− mouseClick(backButton, 0, 0);
247+ mouseClick(backButton);
248248 tryCompare(bottomEdgeController, "progress", 0);
249249 }
250250
@@ -272,7 +272,7 @@ Item {
272272 var scopeLoader0 = findChild(dashContent, "scopeLoader0");
273273 var dashCategory0 = findChild(scopeLoader0, "dashCategory0");
274274 var delegate0 = findChild(dashCategory0, "delegate0");
275− mouseClick(delegate0, delegate0.width / 2, delegate0.height / 2);
275+ mouseClick(delegate0);
276276
277277 tryCompare(dashContent, "subPageShown", true)
278278 waitForRendering(dash);
@@ -320,7 +320,7 @@ Item {
320320 // Click on the store
321321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
322322 var searchButton = findChild(scopesListPageHeader, "store_header_button");
323− mouseClick(searchButton, 0, 0);
323+ mouseClick(searchButton);
324324
325325 spy.wait();
326326 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
@@ -345,9 +345,9 @@ Item {
345345 // Enter edit mode
346346 var scopesList = findChild(dash, "scopesList");
347347 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
348− mousePress(clickScope, 0, 0);
348+ mousePress(clickScope);
349349 tryCompare(scopesList, "state", "edit");
350− mouseRelease(clickScope, 0, 0);
350+ mouseRelease(clickScope);
351351
352352 var starArea = findChild(clickScope, "starArea");
353353 touchFlick(starArea, 0, 0, 0, -units.gu(10));
@@ -356,8 +356,8 @@ Item {
356356 var scopesList = findChild(dash, "scopesList");
357357 var scopesListPageHeader = findChild(scopesList, "pageHeader");
358358 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
359− mouseClick(backButton, 0, 0);
360− mouseClick(backButton, 0, 0);
359+ mouseClick(backButton);
360+ mouseClick(backButton);
361361 tryCompare(bottomEdgeController, "progress", 0);
362362
363363 tryCompare(dashContentList, "currentIndex", 0);
@@ -387,9 +387,9 @@ Item {
387387 // Enter edit mode
388388 var scopesList = findChild(dash, "scopesList");
389389 var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
390− mousePress(clickScope, 0, 0);
390+ mousePress(clickScope);
391391 tryCompare(scopesList, "state", "edit");
392− mouseRelease(clickScope, 0, 0);
392+ mouseRelease(clickScope);
393393
394394 var starArea = findChild(clickScope, "starArea");
395395 touchFlick(starArea, 0, 0, 0, -units.gu(10));
@@ -401,12 +401,12 @@ Item {
401401 var scopesList = findChild(dash, "scopesList");
402402 var scopesListPageHeader = findChild(scopesList, "pageHeader");
403403 var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "customBackButton");
404− mouseClick(backButton, 0, 0);
404+ mouseClick(backButton);
405405
406406 // Click on third scope
407407 var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
408408 waitForRendering(mockScope5)
409− mouseClick(mockScope5, 0, 0);
409+ mouseClick(mockScope5);
410410 tryCompare(bottomEdgeController, "progress", 0);
411411 tryCompare(dashContentList, "currentIndex", 2);
412412 compare(dashContentList.currentItem.scopeId, "MockScope5");
tests/qmltests/Dash/tst_DashContent.qml+25−25
@@ -288,7 +288,7 @@ Item {
288288 var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
289289 compare(dashNavigationButton.showList, false);
290290 waitForRendering(dashNavigationButton);
291− mouseClick(dashNavigationButton, dashNavigationButton.width / 2, dashNavigationButton.height / 2);
291+ mouseClick(dashNavigationButton);
292292 compare(dashNavigationButton.showList, true);
293293
294294 var navigationListView = findChild(dashNavigationButton, "navigationListView");
@@ -304,30 +304,30 @@ Item {
304304 compare(allButton.visible, false);
305305
306306 var navigation = findChild(dashNavigationButton, "navigation0child3");
307− mouseClick(navigation, 0, 0);
307+ mouseClick(navigation);
308308 compare(dashNavigationButton.showList, false);
309309 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle3");
310310 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
311311
312− mouseClick(dashNavigationButton, 0, 0);
312+ mouseClick(dashNavigationButton);
313313 compare(dashNavigationButton.showList, true);
314314 waitForRendering(navigationListView);
315315 waitForRendering(navigationListView.currentItem);
316316 compare(allButton.visible, true);
317317
318− mouseClick(allButton, 0, 0);
318+ mouseClick(allButton);
319319 compare(dashNavigationButton.showList, false);
320320 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
321321 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
322322
323− mouseClick(dashNavigationButton, 0, 0);
323+ mouseClick(dashNavigationButton);
324324 compare(dashNavigationButton.showList, true);
325325 waitForRendering(navigationListView);
326326 waitForRendering(navigationListView.currentItem);
327327 compare(allButton.visible, false);
328328
329329 navigation = findChild(dashNavigationButton, "navigation0child2");
330− mouseClick(navigation, 0, 0);
330+ mouseClick(navigation);
331331 compare(dashNavigationButton.showList, true);
332332 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
333333 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
@@ -340,12 +340,12 @@ Item {
340340
341341 tryCompare(navigationListView, "contentX", navigationList1.x);
342342 waitForRendering(navigationListView);
343− mouseClick(allButton, 0, 0);
343+ mouseClick(allButton);
344344 compare(dashNavigationButton.showList, false);
345345 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
346346 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
347347
348− mouseClick(dashNavigationButton, 0, 0);
348+ mouseClick(dashNavigationButton);
349349 compare(dashNavigationButton.showList, true);
350350 waitForRendering(navigationListView);
351351 waitForRendering(navigationListView.currentItem);
@@ -354,47 +354,47 @@ Item {
354354
355355 tryCompare(navigationList1.navigation, "loaded", true);
356356 navigation = findChild(dashNavigationButton, "navigation1child2");
357− mouseClick(navigation, 0, 0);
357+ mouseClick(navigation);
358358 compare(dashNavigationButton.showList, false);
359359 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle22");
360360 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
361361
362− mouseClick(dashNavigationButton, 0, 0);
362+ mouseClick(dashNavigationButton);
363363 compare(dashNavigationButton.showList, true);
364364 waitForRendering(navigationListView);
365365 waitForRendering(navigationListView.currentItem);
366366
367367 tryCompare(navigationList1.navigation, "loaded", true);
368368 navigation = findChild(dashNavigationButton, "navigation1child3");
369− mouseClick(navigation, 0, 0);
369+ mouseClick(navigation);
370370 compare(dashNavigationButton.showList, false);
371371 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle23");
372372 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
373373
374− mouseClick(dashNavigationButton, 0, 0);
374+ mouseClick(dashNavigationButton);
375375 compare(dashNavigationButton.showList, true);
376376 waitForRendering(navigationListView);
377377 waitForRendering(navigationListView.currentItem);
378− mouseClick(backButton, 0, 0);
378+ mouseClick(backButton);
379379
380380 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
381381 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
382382 compare(dashNavigationButton.showList, true);
383− mouseClick(dashNavigationButton, 0, 0);
383+ mouseClick(dashNavigationButton);
384384 compare(dashNavigationButton.showList, false);
385385
386− mouseClick(dashNavigationButton, 0, 0);
386+ mouseClick(dashNavigationButton);
387387 compare(dashNavigationButton.showList, true);
388388 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
389389 navigation = findChild(dashNavigationButton, "navigation0child2");
390− mouseClick(navigation, 0, 0);
390+ mouseClick(navigation);
391391 compare(dashNavigationButton.showList, true);
392392 navigationList1 = findChild(dashNavigationButton, "navigation1");
393393 compare(navigationList1.navigation.loaded, false);
394394 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
395395 allButton = findChild(navigationList1, "allButton");
396396 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
397− mouseClick(allButton, 0, 0);
397+ mouseClick(allButton);
398398 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
399399 }
400400
@@ -408,7 +408,7 @@ Item {
408408
409409 compare(dashNavigationButton.showList, false);
410410 waitForRendering(dashNavigationButton);
411− mouseClick(dashNavigationButton, 0, 0);
411+ mouseClick(dashNavigationButton);
412412 compare(dashNavigationButton.showList, true);
413413
414414 var navigationListView = findChild(dashNavigationButton, "navigationListView");
@@ -429,24 +429,24 @@ Item {
429429 compare(backButton.visible, false);
430430
431431 var navigation = findChild(dashNavigationButton, "navigation0child3");
432− mouseClick(navigation, 0, 0);
432+ mouseClick(navigation);
433433 compare(dashNavigationButton.showList, false);
434434 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild3");
435435 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
436436
437− mouseClick(dashNavigationButton, 0, 0);
437+ mouseClick(dashNavigationButton);
438438 compare(dashNavigationButton.showList, true);
439439 waitForRendering(navigationListView);
440440 waitForRendering(navigationListView.currentItem);
441441 compare(allButton.visible, false);
442442
443443 navigation = findChild(dashNavigationButton, "navigation0child2");
444− mouseClick(navigation, 0, 0);
444+ mouseClick(navigation);
445445 compare(dashNavigationButton.showList, false);
446446 tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild2");
447447 tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
448448
449− mouseClick(dashNavigationButton, 0, 0);
449+ mouseClick(dashNavigationButton);
450450 compare(dashNavigationButton.showList, true);
451451 waitForRendering(navigationListView);
452452 waitForRendering(navigationListView.currentItem);
@@ -454,7 +454,7 @@ Item {
454454
455455 compare(navigationListView.count, 1, "There should be no second-level navigation");
456456
457− mouseClick(dashNavigationButton, 0, 0);
457+ mouseClick(dashNavigationButton);
458458 compare(dashNavigationButton.showList, false);
459459 }
460460
@@ -474,7 +474,7 @@ Item {
474474 compare(dashNavigationButton.showList, false);
475475 compare(dashAltNavigationButton.showList, false);
476476
477− mouseClick(dashNavigation, 0, 0);
477+ mouseClick(dashNavigation);
478478 compare(dashNavigationButton.showList, false);
479479 compare(dashAltNavigationButton.showList, true);
480480
@@ -500,7 +500,7 @@ Item {
500500 navigationListView = findChild(dashNavigationButton, "navigationListView");
501501 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
502502
503− mouseClick(dashNavigation, 0, 0);
503+ mouseClick(dashNavigation);
504504 compare(dashNavigationButton.showList, false);
505505 compare(dashAltNavigationButton.showList, false);
506506 }
tests/qmltests/Dash/tst_GenericScopeView.qml+26−26
@@ -163,12 +163,12 @@ Item {
163163 verify(!category.expanded);
164164
165165 var initialHeight = category.height;
166− mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
166+ mouseClick(seeAll);
167167 verify(category.expanded);
168168 tryCompare(category, "height", category.item.expandedHeight + seeAll.height);
169169
170170 waitForRendering(seeAll);
171− mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
171+ mouseClick(seeAll);
172172 verify(!category.expanded);
173173 }
174174
@@ -186,17 +186,17 @@ Item {
186186 verify(category2.expandable);
187187 verify(!category2.expanded);
188188
189− mouseClick(seeAll2, seeAll2.width / 2, seeAll2.height / 2);
189+ mouseClick(seeAll2);
190190 tryCompare(category2, "expanded", true);
191191
192192 categoryListView.positionAtBeginning();
193193
194194 var category0 = findChild(genericScopeView, "dashCategory0")
195195 var seeAll0 = findChild(category0, "seeAll")
196− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
196+ mouseClick(seeAll0);
197197 tryCompare(category0, "expanded", true);
198198 tryCompare(category2, "expanded", false);
199− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
199+ mouseClick(seeAll0);
200200 tryCompare(category0, "expanded", false);
201201 tryCompare(category2, "expanded", false);
202202 }
@@ -208,7 +208,7 @@ Item {
208208 spy.target = genericScopeView.scope;
209209 spy.signalName = "performQuery";
210210
211− mouseClick(header, header.width / 2, header.height / 2);
211+ mouseClick(header);
212212
213213 spy.wait();
214214 compare(spy.signalArguments[0][0], genericScopeView.scope.categories.data(1, Categories.RoleHeaderLink));
@@ -248,13 +248,13 @@ Item {
248248 categoryListView.contentY = units.gu(20);
249249 var seeAll = findChild(category, "seeAll");
250250 var floatingSeeLess = findChild(genericScopeView, "floatingSeeLess");
251− mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
251+ mouseClick(seeAll);
252252 tryCompare(category, "expanded", true);
253253 tryCompareFunction(function() {
254254 return category.item.height + floatingSeeLess.height ==
255255 genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd;
256256 }, true);
257− mouseClick(floatingSeeLess, floatingSeeLess.width / 2, floatingSeeLess.height / 2);
257+ mouseClick(floatingSeeLess);
258258 tryCompare(category, "expanded", false);
259259 }
260260
@@ -295,7 +295,7 @@ Item {
295295 true);
296296 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
297297 waitForRendering(tile);
298− mouseClick(tile, tile.width / 2, tile.height / 2);
298+ mouseClick(tile);
299299 tryCompare(testCase.subPageLoader, "open", true);
300300 tryCompare(testCase.subPageLoader, "x", 0);
301301 tryCompare(findChild(genericScopeView, "categoryListView"), "visible", false);
@@ -340,15 +340,15 @@ Item {
340340 tryCompare(testCase.subPageLoader, "open", false);
341341 tryCompare(testCase.subPageLoader, "visible", false);
342342
343− mouseClick(tile, tile.width / 2, tile.height / 2);
343+ mouseClick(tile);
344344
345345 tryCompare(testCase.subPageLoader, "open", false);
346346 tryCompare(testCase.subPageLoader, "visible", false);
347347
348− mousePress(tile, tile.width / 2, tile.height / 2);
348+ mousePress(tile);
349349 tryCompare(testCase.subPageLoader, "open", false);
350350 tryCompare(testCase.subPageLoader, "visible", false);
351− mouseRelease(tile, tile.width / 2, tile.height / 2);
351+ mouseRelease(tile);
352352 }
353353
354354 function test_showPreviewCarousel() {
@@ -359,18 +359,18 @@ Item {
359359 var tile = findChild(category, "carouselDelegate1");
360360 verify(tile, "Could not find delegate");
361361
362− mouseClick(tile, tile.width / 2, tile.height / 2);
362+ mouseClick(tile);
363363 tryCompare(tile, "explicitlyScaled", true);
364− mouseClick(tile, tile.width / 2, tile.height / 2);
364+ mouseClick(tile);
365365 tryCompare(testCase.subPageLoader, "open", true);
366366 tryCompare(testCase.subPageLoader, "x", 0);
367367
368368 closePreview();
369369
370− mousePress(tile, tile.width / 2, tile.height / 2);
370+ mousePress(tile);
371371 tryCompare(testCase.subPageLoader, "open", true);
372372 tryCompare(testCase.subPageLoader, "x", 0);
373− mouseRelease(tile, tile.width / 2, tile.height / 2);
373+ mouseRelease(tile);
374374
375375 closePreview();
376376 }
@@ -383,16 +383,16 @@ Item {
383383 var tile = findChild(category, "delegate1");
384384 verify(tile, "Could not find delegate");
385385
386− mouseClick(tile, tile.width / 2, tile.height / 2);
386+ mouseClick(tile);
387387 tryCompare(testCase.subPageLoader, "open", true);
388388 tryCompare(testCase.subPageLoader, "x", 0);
389389
390390 closePreview();
391391
392− mousePress(tile, tile.width / 2, tile.height / 2);
392+ mousePress(tile);
393393 tryCompare(testCase.subPageLoader, "open", true);
394394 tryCompare(testCase.subPageLoader, "x", 0);
395− mouseRelease(tile, tile.width / 2, tile.height / 2);
395+ mouseRelease(tile);
396396
397397 closePreview();
398398 }
@@ -429,7 +429,7 @@ Item {
429429 tryCompare(testCase.subPageLoader, "open", false);
430430 tryCompare(testCase.subPageLoader, "visible", false);
431431 var settings = findChild(innerHeader, "settings_header_button");
432− mouseClick(settings, settings.width / 2, settings.height / 2);
432+ mouseClick(settings);
433433 tryCompare(testCase.subPageLoader, "open", true);
434434 tryCompareFunction(function() { return (String(subPageLoader.source)).indexOf("ScopeSettingsPage.qml") != -1; }, true);
435435 tryCompare(genericScopeView, "subPageShown", true);
@@ -496,7 +496,7 @@ Item {
496496 verify(category0.expandable);
497497 verify(!category0.expanded);
498498
499− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
499+ mouseClick(seeAll0);
500500 verify(category0.expanded);
501501 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
502502 tryCompare(genericScopeView.categoryView, "contentY", units.gu(14));
@@ -509,7 +509,7 @@ Item {
509509 verify(category1.expandable);
510510 verify(!category1.expanded);
511511
512− mouseClick(seeAll1, seeAll1.width / 2, seeAll1.height / 2);
512+ mouseClick(seeAll1);
513513 verify(!category0.expanded);
514514 verify(category1.expanded);
515515 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
@@ -539,7 +539,7 @@ Item {
539539 verify(category0.expandable);
540540 verify(!category0.expanded);
541541
542− mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
542+ mouseClick(seeAll0);
543543 verify(category0.expanded);
544544 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
545545
@@ -550,7 +550,7 @@ Item {
550550 verify(category1.expandable);
551551 verify(!category1.expanded);
552552
553− mouseClick(seeAll1, seeAll1.width / 2, seeAll1.height / 2);
553+ mouseClick(seeAll1);
554554 verify(!category0.expanded);
555555 verify(category1.expanded);
556556 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
@@ -578,7 +578,7 @@ Item {
578578 expectFail("Apps", "Click scope should not have a favorite button");
579579 var favoriteAction = findChild(innerHeader, "favorite_header_button");
580580 verify(favoriteAction, "Could not find the favorite action.");
581− mouseClick(favoriteAction, favoriteAction.width / 2, favoriteAction.height / 2);
581+ mouseClick(favoriteAction);
582582
583583 tryCompare(genericScopeView.scope, "favorite", !data.favorite);
584584
@@ -629,7 +629,7 @@ Item {
629629 var touchdown = findChild(item0, "touchdown");
630630
631631 compare(touchdown.visible, false);
632− mouseClick(item0, item0.width / 2, item0.height / 2);
632+ mouseClick(item0);
633633 compare(touchdown.visible, false);
634634
635635 cardTool.template["non-interactive"] = false;
tests/qmltests/Dash/tst_PageHeader.qml+1−1
@@ -157,7 +157,7 @@ Item {
157157 var recentSearches = findChild(headerContainer.popover, "recentSearches");
158158 verify(recentSearches, "Could not find recent searches in the popover");
159159 waitForRendering(recentSearches);
160− mouseClick(recentSearches.itemAt(0), 0, 0);
160+ mouseClick(recentSearches.itemAt(0));
161161
162162 compare(pageHeader.searchQuery, "Search2");
163163 tryCompareFunction(function() { return headerContainer.popover === null; }, true);
tests/qmltests/Dash/tst_PreviewListView.qml+2−2
@@ -73,7 +73,7 @@ Rectangle {
7373
7474 function test_notProcessing() {
7575 expectFail("", "processingMouseArea should not receive the click.");
76− mouseClick(listView, listView.width / 2, listView.height / 2);
76+ mouseClick(listView);
7777 clickedSpy.wait();
7878 }
7979
@@ -83,7 +83,7 @@ Rectangle {
8383
8484 tryCompare(listView, "processing", true);
8585
86− mouseClick(listView, listView.width / 2, listView.height / 2);
86+ mouseClick(listView);
8787 clickedSpy.wait();
8888 }
8989
tests/qmltests/Launcher/tst_Launcher.qml+8−8
@@ -154,7 +154,7 @@ Item {
154154 dragLauncherIntoView()
155155
156156 // tapping on the center of the screen should dismiss the launcher
157− mouseClick(launcher, launcher.width/2, launcher.height/2)
157+ mouseClick(launcher)
158158
159159 // should eventually get fully retracted (hidden)
160160 tryCompare(panel, "x", -launcher.panelWidth, 1000)
@@ -175,7 +175,7 @@ Item {
175175
176176 verify(appIcon != undefined)
177177
178− mouseClick(appIcon, appIcon.width/2, appIcon.height/2)
178+ mouseClick(appIcon)
179179
180180 tryCompare(launcher, "lastSelectedApplication",
181181 "dialer-app")
@@ -194,7 +194,7 @@ Item {
194194 var dashIcon = findChild(launcher, "dashItem")
195195 verify(dashIcon != undefined)
196196
197− mouseClick(dashIcon, dashIcon.width/2, dashIcon.height/2)
197+ mouseClick(dashIcon)
198198
199199 tryCompare(launcher, "showDashHome_count", 1)
200200
@@ -413,7 +413,7 @@ Item {
413413 compare(quickListShape.visible, false)
414414
415415 // Doing longpress
416− mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
416+ mousePress(draggedItem)
417417 tryCompare(fakeDragItem, "visible", true) // Wait longpress happening
418418 tryCompare(quickListShape, "visible", true)
419419
@@ -448,7 +448,7 @@ Item {
448448 }
449449
450450 // Doing longpress
451− mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2);
451+ mousePress(draggedItem);
452452 tryCompare(quickListShape, "opacity", 0.96);
453453 mouseRelease(draggedItem);
454454
@@ -481,7 +481,7 @@ Item {
481481 tryCompare(quickListShape, "visible", false)
482482
483483 // Doing longpress
484− mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
484+ mousePress(clickedItem)
485485 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
486486 verify(quickListShape.visible, "QuickList must be visible")
487487
@@ -492,7 +492,7 @@ Item {
492492 signalSpy.clear();
493493 signalSpy.signalName = "quickListTriggered"
494494
495− mouseClick(quickListEntry, quickListEntry.width / 2, quickListEntry.height / 2)
495+ mouseClick(quickListEntry)
496496
497497 if (data.clickable) {
498498 // QuickList needs to be closed when some clickable item is clicked
@@ -524,7 +524,7 @@ Item {
524524 tryCompare(quickList, "state", "")
525525
526526 // Doing longpress
527− mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
527+ mousePress(clickedItem)
528528 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
529529 verify(quickList, "state", "open")
530530
tests/qmltests/Notifications/tst_Notifications.qml+6−6
@@ -547,7 +547,7 @@ Item {
547547 compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
548548
549549 // test input does not fall through
550− mouseClick(notification, notification.width / 2, notification.height / 2)
550+ mouseClick(notification)
551551 if(data.type == Notification.Interactive) {
552552 actionSpy.wait()
553553 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -568,7 +568,7 @@ Item {
568568
569569 // only test the left/cancel-button if two actions have been passed in
570570 if (data.actions.length == 2) {
571− tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
571+ tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
572572 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
573573 actionSpy.clear()
574574 }
@@ -577,7 +577,7 @@ Item {
577577 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
578578
579579 // click the positive/right button
580− tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
580+ tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
581581 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
582582 actionSpy.clear()
583583 waitForRendering (notification)
@@ -592,19 +592,19 @@ Item {
592592
593593 // try clicking on choices in expanded comboList
594594 var choiceButton1 = findChild(notification, "notify_button3")
595− tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
595+ tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
596596 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
597597 actionSpy.clear()
598598
599599 var choiceButton2 = findChild(notification, "notify_button4")
600− tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
600+ tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
601601 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
602602 actionSpy.clear()
603603
604604 // click to collapse
605605 //tryCompareFunction(function() { mouseClick(comboButton, comboButton.width - comboButton.__styleInstance.dropDownWidth / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
606606 } else {
607− mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
607+ mouseClick(buttonCancel)
608608 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
609609 }
610610 }
tests/qmltests/Notifications/tst_OptionToggle.qml+7−7
@@ -223,7 +223,7 @@ Row {
223223 }
224224
225225 // test input does not fall through
226− mouseClick(notification, notification.width / 2, notification.height / 2)
226+ mouseClick(notification)
227227 if(data.type == Notification.Interactive) {
228228 actionSpy.wait()
229229 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
@@ -244,7 +244,7 @@ Row {
244244
245245 // only test the left/cancel-button if two actions have been passed in
246246 if (data.actions.length == 2) {
247− tryCompareFunction(function() { mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2); return actionSpy.signalArguments.length > 0; }, true);
247+ tryCompareFunction(function() { mouseClick(buttonCancel); return actionSpy.signalArguments.length > 0; }, true);
248248 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
249249 actionSpy.clear()
250250 }
@@ -253,7 +253,7 @@ Row {
253253 verify(buttonAccept.color === data.buttonTinted ? "#3fb24f" : "#dddddd", "button has the wrong color-tint")
254254
255255 // click the positive/right button
256− tryCompareFunction(function() { mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2); return actionSpy.signalArguments.length > 0; }, true);
256+ tryCompareFunction(function() { mouseClick(buttonAccept); return actionSpy.signalArguments.length > 0; }, true);
257257 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id positive action")
258258 actionSpy.clear()
259259 waitForRendering(notification)
@@ -264,20 +264,20 @@ Row {
264264 tryCompareFunction(function() { return optionToggle.expanded == false; }, true);
265265
266266 // click to expand
267− tryCompareFunction(function() { mouseClick(optionToggle, optionToggle.width / 2, optionToggle.height / 2); return optionToggle.expanded == true; }, true);
267+ tryCompareFunction(function() { mouseClick(optionToggle); return optionToggle.expanded == true; }, true);
268268
269269 // try clicking on choices in expanded comboList
270270 var choiceButton1 = findChild(notification, "notify_button3")
271− tryCompareFunction(function() { mouseClick(choiceButton1, choiceButton1.width / 2, choiceButton1.height / 2); return actionSpy.signalArguments.length > 0; }, true);
271+ tryCompareFunction(function() { mouseClick(choiceButton1); return actionSpy.signalArguments.length > 0; }, true);
272272 compare(actionSpy.signalArguments[0][0], data.actions[3]["id"], "got wrong id choice action 1")
273273 actionSpy.clear()
274274
275275 var choiceButton2 = findChild(notification, "notify_button4")
276− tryCompareFunction(function() { mouseClick(choiceButton2, choiceButton2.width / 2, choiceButton2.height / 2); return actionSpy.signalArguments.length > 0; }, true);
276+ tryCompareFunction(function() { mouseClick(choiceButton2); return actionSpy.signalArguments.length > 0; }, true);
277277 compare(actionSpy.signalArguments[0][0], data.actions[4]["id"], "got wrong id choice action 2")
278278 actionSpy.clear()
279279 } else {
280− mouseClick(buttonCancel, buttonCancel.width / 2, buttonCancel.height / 2)
280+ mouseClick(buttonCancel)
281281 compare(actionSpy.signalArguments[0][0], data.actions[1]["id"], "got wrong id for negative action")
282282 }
283283 }
tests/qmltests/Notifications/tst_SwipeToAct.qml+1−1
@@ -240,7 +240,7 @@ Item {
240240 }
241241
242242 // test input does not fall through
243− mouseClick(notification, notification.width / 2, notification.height / 2)
243+ mouseClick(notification)
244244 if(data.type == Notification.Interactive) {
245245 actionSpy.wait()
246246 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml+2−2
@@ -214,7 +214,7 @@ Row {
214214
215215 // click/tap on each snap-decision and verify only one is in expanded-state at any time
216216 for (var index = 0; index < snap_decision.length; index++) {
217− mouseClick(snap_decision[index], snap_decision[index].width / 2, snap_decision[index].height / 2)
217+ mouseClick(snap_decision[index])
218218 for (var kindex = 0; kindex < snap_decision.length; kindex++) {
219219 if (kindex == index) {
220220 compare(snap_decision[kindex].state, "expanded", "state of "+ kindex + ".snap-decision is not expanded");
@@ -227,7 +227,7 @@ Row {
227227 // remove top-most and verify one of the remaining ones is still getting expanded
228228
229229 // make first snap-decision expand
230− mouseClick(snap_decision[0], snap_decision[0].width / 2, snap_decision[0].height / 2);
230+ mouseClick(snap_decision[0]);
231231
232232 for (var index = 1; index < snap_decision.length; index++) {
233233 removeTopMostNotification();
tests/qmltests/Panel/tst_IndicatorsBar.qml+1−1
@@ -197,7 +197,7 @@ IndicatorTest {
197197 if (indicatorsBar.mapFromItem(dataItem, dataItem.width/2, dataItem.height/2).x < 0) {
198198 skip("Out of bounds");
199199 }
200− mouseClick(dataItem, dataItem.width/2, dataItem.height/2);
200+ mouseClick(dataItem);
201201 verify(dataItem.selected === true);
202202 }
203203
tests/qmltests/tst_Shell.qml+2−2
@@ -245,7 +245,7 @@ Item {
245245
246246 // Clicking the button should dismiss the notification and return focus
247247 var buttonAccept = findChild(notification, "notify_button0");
248− mouseClick(buttonAccept, buttonAccept.width / 2, buttonAccept.height / 2);
248+ mouseClick(buttonAccept);
249249
250250 // Make sure we're back to normal
251251 tryCompare(app.session.surface, "activeFocus", true);
@@ -463,7 +463,7 @@ Item {
463463 var launcher = findChild(shell, "launcherPanel")
464464 tryCompareFunction(function() {return launcher.x === 0 || launcher.x === -launcher.width;}, true);
465465 if (launcher.x === 0) {
466− mouseClick(shell, shell.width / 2, shell.height / 2)
466+ mouseClick(shell)
467467 }
468468 tryCompare(launcher, "x", -launcher.width)
469469
tests/qmltests/tst_TabletShell.qml+1−1
@@ -211,7 +211,7 @@ Row {
211211 tryCompare(passwordMouseArea, "enabled", isButton)
212212
213213 var passwordInput = findChild(shell, "passwordInput")
214− mouseClick(passwordInput, passwordInput.width / 2, passwordInput.height / 2)
214+ mouseClick(passwordInput)
215215 }
216216
217217 function confirmLoggedIn(loggedIn) {
tests/utils/modules/Unity/Test/UnityTestCase.qml+61
@@ -37,6 +37,67 @@ TestCase {
3737 this.getCurrentTimeMs = function() {return this.currentTimeMs}
3838 }
3939
40+ function mouseClick(item, x, y, button, modifiers, delay) {
41+ if (button === undefined)
42+ button = Qt.LeftButton;
43+ if (modifiers === undefined)
44+ modifiers = Qt.NoModifier;
45+ if (delay == undefined)
46+ delay = -1;
47+ if (x == undefined)
48+ x = item.width / 2;
49+ if (y == undefined)
50+ y = item.height / 2;
51+ if (qtest_events.mouseClick(item, x, y, button, modifiers, delay))
52+ qtest_fail("window not shown", 2);
53+ }
54+
55+ function mouseDoubleClick(item, x, y, button, modifiers, delay) {
56+ if (button === undefined)
57+ button = Qt.LeftButton
58+ if (modifiers === undefined)
59+ modifiers = Qt.NoModifier
60+ if (delay == undefined)
61+ delay = -1
62+ if (x == undefined)
63+ x = item.width / 2;
64+ if (y == undefined)
65+ y = item.height / 2;
66+ if (!qtest_events.mouseDoubleClick(item, x, y, button, modifiers, delay))
67+ qtest_fail("window not shown", 2)
68+ }
69+
70+ function mousePress(item, x, y, button, modifiers, delay) {
71+ if (button === undefined)
72+ button = Qt.LeftButton
73+ if (modifiers === undefined)
74+ modifiers = Qt.NoModifier
75+ if (delay == undefined)
76+ delay = -1
77+ if (x == undefined)
78+ x = item.width / 2;
79+ if (y == undefined)
80+ y = item.height / 2;
81+ if (!qtest_events.mousePress(item, x, y, button, modifiers, delay))
82+ qtest_fail("window not shown", 2)
83+ }
84+
85+ function mouseRelease(item, x, y, button, modifiers, delay) {
86+ if (button === undefined)
87+ button = Qt.LeftButton
88+ if (modifiers === undefined)
89+ modifiers = Qt.NoModifier
90+ if (delay == undefined)
91+ delay = -1
92+ if (x == undefined)
93+ x = item.width / 2;
94+ if (y == undefined)
95+ y = item.height / 2;
96+ if (!qtest_events.mouseRelease(item, x, y, button, modifiers, delay))
97+ qtest_fail("window not shown", 2)
98+ }
99+
100+
40101 // Flickable won't recognise a single mouse move as dragging the flickable.
41102 // Use 5 steps because it's what
42103 // Qt uses in QQuickViewTestUtil::flick