@@ -24,6 +24,7 @@ import Ubuntu.SystemSettings.SecurityPrivacy 1.0
24import Ubuntu.SystemSettings.TimeDate 1.1
24import Ubuntu.SystemSettings.TimeDate 1.1
25import Unity.Test 0.1 as UT
25import Unity.Test 0.1 as UT
26import Wizard 0.1
26import Wizard 0.1
27+import Unity.InputInfo 0.1
27import "../../../qml/Wizard"
28import "../../../qml/Wizard"
@@ -41,7 +42,12 @@ Item {
41 id: wizard
42 id: wizard
42 anchors.fill: parent
43 anchors.fill: parent
45+ Component.onCompleted: {
46+ MockInputDeviceBackend.addMockDevice("/test", InputInfo.Keyboard);
44 Component.onDestruction: {
49 Component.onDestruction: {
50+ MockInputDeviceBackend.removeDevice("/test");
45 wizardLoader.itemDestroyed = true;
51 wizardLoader.itemDestroyed = true;
@@ -74,6 +80,12 @@ Item {
74 signalName: "timeZoneChangedCalled"
80 signalName: "timeZoneChangedCalled"
85+ target: AccountsService
86+ signalName: "keymapsChanged"
77 function setup() {
89 function setup() {
78 AccountsService.hereEnabled = false;
90 AccountsService.hereEnabled = false;
79 AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
91 AccountsService.hereLicensePath = Qt.resolvedUrl("licenses");
@@ -88,6 +100,7 @@ Item {
88 activateLocationSpy.clear();
100 activateLocationSpy.clear();
89 activateGPSSpy.clear();
101 activateGPSSpy.clear();
90 timezoneSpy.clear();
102 timezoneSpy.clear();
103+ kbdLayoutSpy.clear();
92 ActionData.data = {
105 ActionData.data = {
93 "location-detection-enabled": {
106 "location-detection-enabled": {
@@ -176,6 +189,10 @@ Item {
176 tap(findChild(page, "forwardButton"));
189 tap(findChild(page, "forwardButton"));
192+ page = waitForPage("keyboardPage");
193+ if (name === page.objectName) return page;
194+ tap(findChild(page, "forwardButton"));
179 page = waitForPage("wifiPage");
196 page = waitForPage("wifiPage");
180 if (name === page.objectName) return page;
197 if (name === page.objectName) return page;
181 tap(findChild(page, "forwardButton"));
198 tap(findChild(page, "forwardButton"));
@@ -281,7 +298,7 @@ Item {
282 // Make sure that moving from sim page lands on wifi page
299 // Make sure that moving from sim page lands on wifi page
283 tap(findChild(page, "forwardButton"));
300 tap(findChild(page, "forwardButton"));
284− waitForPage("wifiPage"); // thus skipping passwdPage
301+ waitForPage("keyboardPage"); // thus skipping passwdPage
287 function verifyAnimationsNotRunning(page) {
304 function verifyAnimationsNotRunning(page) {
@@ -486,5 +503,27 @@ Item {
486 tap(findChild(page, "nameInput"));
503 tap(findChild(page, "nameInput"));
487 typeString("foobar");
504 typeString("foobar");
507+ function test_keyboardPage() {
508+ var page = goToPage("keyboardPage");
509+ var forwardButton = findChild(page, "forwardButton");
512+ var langSelector = findChild(page, "langSelector");
513+ verify(langSelector);
514+ langSelector.selectedIndex = 1; // should be fr_FR
515+ print("Selected language:", page.selectedLanguage);
518+ var kbdDelegate = findChild(page, "kbdDelegate1");
519+ verify(kbdDelegate);
520+ mouseClick(kbdDelegate);
521+ verify(kbdDelegate.isCurrent);
522+ print("Selected keymap:", page.selectedKeymap);
524+ // verify the keymapsChanged signal got fired
525+ tap(findChild(page, "forwardButton"));
526+ tryCompare(kbdLayoutSpy, "count", 1);