on xenial help sign in
Test that dash shown changes correctly.
4bded4dMichał Sawicz
Dash/Dash.qml+1
@@ -22,6 +22,7 @@ import "../Components"
22
22
23Showable {
23Showable {
24 id: dash
24 id: dash
25+ objectName: "dash"
25
26
26 property alias contentProgress: dashContent.contentProgress
27 property alias contentProgress: dashContent.contentProgress
27 property string showScopeOnLoaded: "home.scope"
28 property string showScopeOnLoaded: "home.scope"
Panel/Panel.qml+1
@@ -73,6 +73,7 @@ Item {
73
73
74 Indicators {
74 Indicators {
75 id: indicatorsMenu
75 id: indicatorsMenu
76+ objectName: "indicators"
76
77
77 anchors.right: parent.right
78 anchors.right: parent.right
78 y: panelBackground.y
79 y: panelBackground.y
tests/qmltests/tst_Shell.qml+50
@@ -70,6 +70,8 @@ Item {
70
70
71 var dashHome = findChild(shell, "DashHome");
71 var dashHome = findChild(shell, "DashHome");
72 swipeUntilScopeViewIsReached(dashHome);
72 swipeUntilScopeViewIsReached(dashHome);
73+
74+ hideIndicators();
73 }
75 }
74
76
75 function killApps(apps) {
77 function killApps(apps) {
@@ -268,6 +270,19 @@ Item {
268 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2);
270 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2);
269 }
271 }
270
272
273+ function showIndicators() {
274+ var indicators = findChild(shell, "indicators");
275+ indicators.show();
276+ tryCompare(indicators, "fullyOpened", true);
277+ }
278+
279+ function hideIndicators() {
280+ var indicators = findChild(shell, "indicators");
281+ if (indicators.fullyOpened) {
282+ indicators.hide();
283+ }
284+ }
285+
271 function waitUntilApplicationWindowIsFullyVisible() {
286 function waitUntilApplicationWindowIsFullyVisible() {
272 var underlay = findChild(shell, "underlay");
287 var underlay = findChild(shell, "underlay");
273 tryCompare(underlay, "visible", false);
288 tryCompare(underlay, "visible", false);
@@ -360,5 +375,40 @@ Item {
360 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.expectedUrl) !== -1; }, true)
375 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.expectedUrl) !== -1; }, true)
361 tryCompare(backgroundImage, "status", Image.Ready)
376 tryCompare(backgroundImage, "status", Image.Ready)
362 }
377 }
378+
379+ function test_DashShown_data() {
380+ return [
381+ {tag: "in focus", greeter: false, app: false, launcher: false, indicators: false, expectedShown: true},
382+ {tag: "under greeter", greeter: true, app: false, launcher: false, indicators: false, expectedShown: false},
383+ {tag: "under app", greeter: false, app: true, launcher: false, indicators: false, expectedShown: false},
384+ {tag: "under launcher", greeter: false, app: false, launcher: true, indicators: false, expectedShown: true},
385+ {tag: "under indicators", greeter: false, app: false, launcher: false, indicators: true, expectedShown: true},
386+ ]
387+ }
388+
389+ function test_DashShown(data) {
390+ if (data.greeter) {
391+ // Swipe the greeter in
392+ var greeter = findChild(shell, "greeter");
393+ Powerd.displayPowerStateChange(Powerd.Off, 0);
394+ tryCompare(greeter, "showProgress", 1);
395+ }
396+
397+ if (data.app) {
398+ dragLauncherIntoView();
399+ tapOnAppIconInLauncher();
400+ }
401+
402+ if (data.launcher) {
403+ dragLauncherIntoView();
404+ }
405+
406+ if (data.indicators) {
407+
408+ }
409+
410+ var dash = findChild(shell, "dash");
411+ tryCompare(dash, "shown", data.expectedShown);
412+ }
363 }
413 }
364}
414}