Merge lp:~dandrader/unity8/improveLauncherTests into lp:unity8

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1595
Merged at revision: 1601
Proposed branch: lp:~dandrader/unity8/improveLauncherTests
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/launcher-fixes
Diff against target: 112 lines (+33/-20)
1 file modified
tests/qmltests/Launcher/tst_Launcher.qml (+33/-20)
To merge this branch: bzr merge lp:~dandrader/unity8/improveLauncherTests
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+248919@code.launchpad.net

Commit message

Improve Launcher tests, making them more reliable

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
lp:~mzanetti/unity8/launcher-fixes

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable

 * If you changed the UI, has there been a design review?
Not applicable

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

hell yeah!

 * Did you make sure that the branch does not contain spurious tags?

yip yip

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
2--- tests/qmltests/Launcher/tst_Launcher.qml 2015-02-06 14:48:22 +0000
3+++ tests/qmltests/Launcher/tst_Launcher.qml 2015-02-06 14:48:22 +0000
4@@ -153,6 +153,18 @@
5 tryCompare(panel, "x", -panel.width, 1000);
6 }
7
8+ function positionLauncherListAtBeginning() {
9+ var listView = testCase.findChild(launcherLoader.item, "launcherListView");
10+ listView.contentY = -listView.topMargin;
11+ }
12+ function positionLauncherListAtEnd() {
13+ var listView = testCase.findChild(launcherLoader.item, "launcherListView");
14+ if ((listView.contentHeight + listView.topMargin + listView.bottomMargin) > listView.height) {
15+ listView.contentY = listView.topMargin + listView.contentHeight
16+ - listView.height;
17+ }
18+ }
19+
20 // Drag from the left edge of the screen rightwards and check that the launcher
21 // appears (as if being dragged by the finger/pointer)
22 function test_dragLeftEdgeToRevealLauncherAndTapCenterToDismiss() {
23@@ -179,22 +191,22 @@
24 launcherApplicationSelected("[...]dialer-app.desktop") */
25 function test_clickingOnAppIconCausesSignalEmission() {
26 dragLauncherIntoView();
27- launcher.lastSelectedApplication = ""
28-
29- var listView = findChild(launcher, "launcherListView");
30- listView.positionViewAtEnd();
31-
32- var appIcon = findChild(launcher, "launcherDelegate0")
33-
34- verify(appIcon != undefined)
35-
36- mouseClick(appIcon)
37+ launcher.lastSelectedApplication = "";
38+ launcher.inverted = false;
39+
40+ positionLauncherListAtBeginning();
41+
42+ var appIcon = findChild(launcher, "launcherDelegate0");
43+
44+ verify(appIcon != undefined);
45+
46+ mouseClick(appIcon);
47
48 tryCompare(launcher, "lastSelectedApplication",
49- "dialer-app")
50+ appIcon.appId);
51
52 // Tapping on an application icon also dismisses the launcher
53- waitUntilLauncherDisappears()
54+ waitUntilLauncherDisappears();
55 }
56
57 /* If I click on the dash icon on the launcher
58@@ -290,25 +302,26 @@
59 function test_clickFlick_data() {
60 var listView = findChild(launcher, "launcherListView");
61 return [
62- {tag: "unfolded top", positionViewAtBeginning: false,
63+ {tag: "unfolded top", positionViewAtBeginning: true,
64 clickY: listView.topMargin + units.gu(2),
65 expectFlick: false},
66
67- {tag: "folded top", positionViewAtBeginning: true,
68+ {tag: "folded top", positionViewAtBeginning: false,
69 clickY: listView.topMargin + units.gu(2),
70 expectFlick: true},
71
72- {tag: "unfolded bottom", positionViewAtBeginning: true,
73+ {tag: "unfolded bottom", positionViewAtBeginning: false,
74 clickY: listView.height - listView.topMargin - units.gu(1),
75 expectFlick: false},
76
77- {tag: "folded bottom", positionViewAtBeginning: false,
78+ {tag: "folded bottom", positionViewAtBeginning: true,
79 clickY: listView.height - listView.topMargin - units.gu(1),
80 expectFlick: true},
81 ];
82 }
83
84 function test_clickFlick(data) {
85+ launcher.inverted = false;
86 launcher.lastSelectedApplication = "";
87 dragLauncherIntoView();
88 var listView = findChild(launcher, "launcherListView");
89@@ -318,9 +331,9 @@
90 // So for stability's sake we just put the listView in the position
91 // we want to to actually start doing what this tests intends to check.
92 if (data.positionViewAtBeginning) {
93- listView.positionViewAtBeginning();
94+ positionLauncherListAtBeginning();
95 } else {
96- listView.positionViewAtEnd();
97+ positionLauncherListAtEnd();
98 }
99 tryCompare(listView, "flicking", false);
100
101@@ -455,9 +468,9 @@
102 // Position launcher to where we need it
103 var listView = findChild(launcher, "launcherListView");
104 if (data.flickTo == "top") {
105- listView.positionViewAtEnd();
106+ positionLauncherListAtBeginning();
107 } else {
108- listView.positionViewAtBeginning();
109+ positionLauncherListAtEnd();
110 }
111
112 // Doing longpress

Subscribers

People subscribed via source and target branches