on xenial help sign in
Start of testing support
f377eafMichael Terry
plugins/ScreenGrabber/screengrabber.cpp−2
@@ -42,12 +42,10 @@ ScreenGrabber::ScreenGrabber(QObject *parent)
42{
42{
43 QDir screenshotsDir;
43 QDir screenshotsDir;
44 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
44 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
45− qDebug() << "Using test environment";
46 QTemporaryDir tDir;
45 QTemporaryDir tDir;
47 tDir.setAutoRemove(false);
46 tDir.setAutoRemove(false);
48 screenshotsDir = tDir.path();
47 screenshotsDir = tDir.path();
49 } else {
48 } else {
50− qDebug() << "Using real environment";
51 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
49 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
52 }
50 }
53 screenshotsDir.mkpath(QStringLiteral("Screenshots"));
51 screenshotsDir.mkpath(QStringLiteral("Screenshots"));
qml/Tutorial/TutorialContent.qml+1
@@ -89,6 +89,7 @@ Item {
89
89
90 Connections {
90 Connections {
91 target: panel.indicators
91 target: panel.indicators
92+ ignoreUnknownSignals: true // panel might be null initially
92 onFullyOpenedChanged: {
93 onFullyOpenedChanged: {
93 if (panel.indicators.fullyOpened) {
94 if (panel.indicators.fullyOpened) {
94 AccountsService.markDemoEdgeCompleted("top");
95 AccountsService.markDemoEdgeCompleted("top");
tests/qmltests/Tutorial/tst_Tutorial.qml+43−10
@@ -93,6 +93,7 @@ Item {
93 return;
93 return;
94
94
95 AccountsService.demoEdges = false;
95 AccountsService.demoEdges = false;
96+ AccountsService.demoEdgesCompleted = [];
96 AccountsService.demoEdges = true;
97 AccountsService.demoEdges = true;
97 }
98 }
98 }
99 }
@@ -114,8 +115,9 @@ Item {
114 tryCompare(shell, "enabled", true); // enabled by greeter when ready
115 tryCompare(shell, "enabled", true); // enabled by greeter when ready
115
116
116 AccountsService.demoEdges = false;
117 AccountsService.demoEdges = false;
118+ AccountsService.demoEdgesCompleted = [];
117 AccountsService.demoEdges = true;
119 AccountsService.demoEdges = true;
118− swipeAwayGreeter();
120+ //swipeAwayGreeter();
119 }
121 }
120
122
121 function cleanup() {
123 function cleanup() {
@@ -163,6 +165,37 @@ Item {
163 waitForRendering(greeter);
165 waitForRendering(greeter);
164 }
166 }
165
167
168+ function test_longPressDismissesTutorialPage() {
169+ var tutorialLeft = findChild(shell, "tutorialLeft");
170+
171+ verify(tutorialLeft.shown);
172+ compare(AccountsService.demoEdgesCompleted, []);
173+
174+ mousePress(tutorialLeft);
175+ wait(1000);
176+ mouseRelease(tutorialLeft);
177+
178+ tryCompare(tutorialLeft, "shown", false);
179+ tryCompare(AccountsService, "demoEdgesCompleted", ["left"]);
180+ }
181+
182+ function test_tutorialLeftEdges() {
183+ var tutorial = findChild(shell, "tutorial");
184+ var tutorialLeft = findChild(tutorial, "tutorialLeft");
185+ var launcher = findChild(shell, "launcher");
186+ var stage = findChild(shell, "stage");
187+ var panel = findChild(shell, "panel");
188+
189+ verify(tutorial.running);
190+ verify(tutorial.launcherEnabled);
191+ verify(!tutorial.spreadEnabled);
192+ verify(!tutorial.panelEnabled);
193+ verify(tutorialLeft.shown);
194+ verify(launcher.available);
195+ verify(!stage.spreadEnabled);
196+ verify(!panel.indicators.available);
197+ }
198+
166 function waitForPage(name) {
199 function waitForPage(name) {
167 waitForRendering(findChild(shell, name));
200 waitForRendering(findChild(shell, name));
168 var page = findChild(shell, name);
201 var page = findChild(shell, name);
@@ -259,11 +292,11 @@ Item {
259 return null;
292 return null;
260 }
293 }
261
294
262− function test_walkthrough() {
295+ function disabled_test_walkthrough() {
263 goToPage(null);
296 goToPage(null);
264 }
297 }
265
298
266− function test_skipOnDesktop() {
299+ function disabled_test_skipOnDesktop() {
267 var tutorial = findChild(shell, "tutorial");
300 var tutorial = findChild(shell, "tutorial");
268 tryCompare(tutorial, "active", true);
301 tryCompare(tutorial, "active", true);
269 tryCompare(tutorial, "running", true);
302 tryCompare(tutorial, "running", true);
@@ -273,7 +306,7 @@ Item {
273 tryCompare(tutorial, "running", false);
306 tryCompare(tutorial, "running", false);
274 }
307 }
275
308
276− function test_launcherShortDrag() {
309+ function disabled_test_launcherShortDrag() {
277 // goToPage does a normal launcher pull. But here we want to test
310 // goToPage does a normal launcher pull. But here we want to test
278 // just barely pulling the launcher out and letting go (i.e. not
311 // just barely pulling the launcher out and letting go (i.e. not
279 // triggering the "progress" property of Launcher).
312 // triggering the "progress" property of Launcher).
@@ -293,7 +326,7 @@ Item {
293 waitForPage("tutorialLeftFinish");
326 waitForPage("tutorialLeftFinish");
294 }
327 }
295
328
296− function test_launcherLongDrag() {
329+ function disabled_test_launcherLongDrag() {
297 // goToPage does a normal launcher pull. But here we want to test
330 // goToPage does a normal launcher pull. But here we want to test
298 // a full pull across the page.
331 // a full pull across the page.
299
332
@@ -310,7 +343,7 @@ Item {
310 tryCompare(errorTitleLabel, "opacity", 1); // show error
343 tryCompare(errorTitleLabel, "opacity", 1); // show error
311 }
344 }
312
345
313− function test_launcherDragBack() {
346+ function disabled_test_launcherDragBack() {
314 // goToPage does a full launcher pull. But here we test pulling
347 // goToPage does a full launcher pull. But here we test pulling
315 // all the way out, then dragging back into place.
348 // all the way out, then dragging back into place.
316
349
@@ -321,7 +354,7 @@ Item {
321 tryCompare(left, "shown", true); // and we should still be on left
354 tryCompare(left, "shown", true); // and we should still be on left
322 }
355 }
323
356
324− function test_launcherNoDragGap() {
357+ function disabled_test_launcherNoDragGap() {
325 // See bug 1454882, where if you dragged the launcher while it was
358 // See bug 1454882, where if you dragged the launcher while it was
326 // visible, you could pull it further than the edge of the screen.
359 // visible, you could pull it further than the edge of the screen.
327
360
@@ -351,7 +384,7 @@ Item {
351 tryCompare(teaseAnimation, "running", true);
384 tryCompare(teaseAnimation, "running", true);
352 }
385 }
353
386
354− function test_spread() {
387+ function disabled_test_spread() {
355 // Unfortunately, most of what we want to test of the spread is
388 // Unfortunately, most of what we want to test of the spread is
356 // "did it render correctly?" but that's hard to test. So instead,
389 // "did it render correctly?" but that's hard to test. So instead,
357 // just poke and prod it a little bit to see if some of the values
390 // just poke and prod it a little bit to see if some of the values
@@ -375,7 +408,7 @@ Item {
375 tryCompare(screenshotImage, "visible", true);
408 tryCompare(screenshotImage, "visible", true);
376 }
409 }
377
410
378− function test_bottomShortDrag() {
411+ function disabled_test_bottomShortDrag() {
379 var bottom = goToPage("tutorialBottom");
412 var bottom = goToPage("tutorialBottom");
380
413
381 touchFlick(shell, halfWidth, shell.height, halfWidth, shell.height * 0.8);
414 touchFlick(shell, halfWidth, shell.height, halfWidth, shell.height * 0.8);
@@ -387,7 +420,7 @@ Item {
387 tryCompare(errorTitleLabel, "opacity", 1); // show error
420 tryCompare(errorTitleLabel, "opacity", 1); // show error
388 }
421 }
389
422
390− function test_interrupted() {
423+ function disabled_test_interrupted() {
391 goToPage("tutorialLeft");
424 goToPage("tutorialLeft");
392 ApplicationManager.startApplication("dialer-app");
425 ApplicationManager.startApplication("dialer-app");
393 checkFinished();
426 checkFinished();