~unity-team/unity8/trunk

« back to all changes in this revision

Viewing changes to tests/qmltests/Tutorial/tst_Tutorial.qml

Skip parts of the edge tutorial that require a touch device (like spread and bottom edge).

For now, we just use "desktop-mode" to imply "no-touch-device".  In the future, presumably Design will provide different tutorial layouts for the various device modes we support.  For now, they have only blessed a phone version.  So I just skip the problematic parts. Fixes: #1434712
Approved by: PS Jenkins bot, Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import QtQuick 2.0
18
18
import QtTest 1.0
19
19
import AccountsService 0.1
 
20
import GSettings 1.0
20
21
import LightDM 0.1 as LightDM
21
22
import Ubuntu.Components 1.1
22
23
import Unity.Application 0.1
45
46
        }
46
47
    }
47
48
 
 
49
    GSettings {
 
50
        id: unity8Settings
 
51
        schema.id: "com.canonical.Unity8"
 
52
    }
 
53
 
48
54
    Component.onCompleted: {
49
55
        // must set the mock mode before loading the Shell
50
56
        LightDM.Greeter.mockMode = "single-pin";
112
118
 
113
119
        function init() {
114
120
            tryCompare(shell, "enabled", true); // enabled by greeter when ready
 
121
            unity8Settings.usageMode = "Staged";
115
122
            AccountsService.demoEdges = false;
116
123
            AccountsService.demoEdges = true;
117
124
            swipeAwayGreeter();
185
192
        }
186
193
 
187
194
        function checkRightEdge() {
188
 
            touchFlick(shell, shell.width, halfHeight, halfWidth, halfHeight);
 
195
            if (unity8Settings.usageMode === "Staged") {
 
196
                touchFlick(shell, shell.width, halfHeight, halfWidth, halfHeight);
189
197
 
190
 
            var stage = findChild(shell, "stage");
191
 
            var spreadView = findChild(stage, "spreadView");
192
 
            tryCompare(spreadView, "phase", 0);
 
198
                var stage = findChild(shell, "stage");
 
199
                var spreadView = findChild(stage, "spreadView");
 
200
                tryCompare(spreadView, "phase", 0);
 
201
            }
193
202
        }
194
203
 
195
204
        function checkBottomEdge() {
196
205
            // Can't actually check effect of swipe, since dash isn't really loaded
197
206
            var applicationsDisplayLoader = findChild(shell, "applicationsDisplayLoader");
198
 
            tryCompare(applicationsDisplayLoader.item, "interactive", false);
 
207
            tryCompare(applicationsDisplayLoader, "interactive", false);
199
208
        }
200
209
 
201
210
        function checkFinished() {
256
265
            goToPage(null);
257
266
        }
258
267
 
 
268
        function test_walkthroughOnDesktop() {
 
269
            unity8Settings.usageMode = "Windowed";
 
270
            var page = goToPage("tutorialLeftFinish");
 
271
            var tick = findChild(page, "tick");
 
272
            tap(tick);
 
273
            checkFinished();
 
274
        }
 
275
 
259
276
        function test_launcherShortDrag() {
260
277
            // goToPage does a normal launcher pull.  But here we want to test
261
278
            // just barely pulling the launcher out and letting go (i.e. not