on xenial help sign in
Test that dash shown changes correctly.
commit4bded4dc3f2b3f57e1bf9fae5c6e5a15b0d8b303 authorMichał Sawicz <michal.sawicz@canonical.com> dateTue 24 Sep 2013, 11:00 (13 years ago) parent6fe2f9b
3 files changed+52
Dash/Dash.qml+1 Panel/Panel.qml+1 tests/qmltests/tst_Shell.qml+50
Dash/Dash.qml+1
@@ -22,6 +22,7 @@ import "../Components"
2222
2323Showable {
2424 id: dash
25+ objectName: "dash"
2526
2627 property alias contentProgress: dashContent.contentProgress
2728 property string showScopeOnLoaded: "home.scope"
Panel/Panel.qml+1
@@ -73,6 +73,7 @@ Item {
7373
7474 Indicators {
7575 id: indicatorsMenu
76+ objectName: "indicators"
7677
7778 anchors.right: parent.right
7879 y: panelBackground.y
tests/qmltests/tst_Shell.qml+50
@@ -70,6 +70,8 @@ Item {
7070
7171 var dashHome = findChild(shell, "DashHome");
7272 swipeUntilScopeViewIsReached(dashHome);
73+
74+ hideIndicators();
7375 }
7476
7577 function killApps(apps) {
@@ -268,6 +270,19 @@ Item {
268270 mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2);
269271 }
270272
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+
271286 function waitUntilApplicationWindowIsFullyVisible() {
272287 var underlay = findChild(shell, "underlay");
273288 tryCompare(underlay, "visible", false);
@@ -360,5 +375,40 @@ Item {
360375 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.expectedUrl) !== -1; }, true)
361376 tryCompare(backgroundImage, "status", Image.Ready)
362377 }
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+ }
363413 }
364414}