Merge lp:~michael-sheldon/ubuntu-keyboard/oxide-tests into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Needs review
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/oxide-tests
Merge into: lp:ubuntu-keyboard
Diff against target: 109 lines (+91/-1)
1 file modified
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+91/-1)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/oxide-tests
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+254881@code.launchpad.net

Commit message

Add autopilot tests for Oxide input areas.

Description of the change

Add autopilot tests for Oxide input areas.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

346. By Michael Sheldon

Merge from trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
2--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-03-26 16:09:48 +0000
3+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-04-01 09:25:01 +0000
4@@ -474,6 +474,56 @@
5 Eventually(Equals(self.text))
6 )
7
8+ def test_oxide_layout(self):
9+ """Test that keyboard layouts change apppropriately when receiving
10+ input hints from oxide.
11+
12+ """
13+ qml = dedent("""
14+ import QtQuick 2.0
15+ import Ubuntu.Components 1.1
16+ import Ubuntu.Web 0.2
17+
18+ Rectangle {
19+ id: window
20+ objectName: "windowRectangle"
21+ color: "lightgrey"
22+
23+ WebView {
24+ anchors.fill: parent
25+ objectName: "webview"
26+ Component.onCompleted: {
27+ loadHtml("<html><body><input id='input' type='%s' onkeyup=\\\"document.title=document.getElementById('input').value;\\\" style='width: 100%%; height: 100%%;' /></body></html>");
28+ }
29+ }
30+
31+ }
32+
33+ """) % (self.expected_activeview)
34+
35+ app = self._start_qml_script(qml)
36+ webview = app.select_single(objectName='webview')
37+
38+ self.ensure_focus_on_input(webview)
39+ keyboard = Keyboard()
40+ self.addCleanup(keyboard.dismiss)
41+
42+ self.assertThat(
43+ keyboard.keyboard.layoutId,
44+ Eventually(Equals(self.expected_activeview))
45+ )
46+
47+ if self.text[-4:] == ".com":
48+ keyboard.type(self.text[:-4])
49+ keyboard.press_key(".com")
50+ else:
51+ keyboard.type(self.text)
52+
53+ self.assertThat(
54+ webview.title,
55+ Eventually(Equals(self.text))
56+ )
57+
58
59 class UbuntuKeyboardAdvancedFeatures(UbuntuKeyboardTests):
60
61@@ -958,7 +1008,47 @@
62 text_area.text,
63 Eventually(Equals(expected))
64 )
65-
66+
67+
68+class UbuntuKeyboardOxide(UbuntuKeyboardTests):
69+
70+ def test_autocomplete(self):
71+ qml = dedent("""
72+ import QtQuick 2.0
73+ import Ubuntu.Components 1.1
74+ import Ubuntu.Web 0.2
75+
76+ Rectangle {
77+ id: window
78+ objectName: "windowRectangle"
79+ color: "lightgrey"
80+
81+ WebView {
82+ anchors.fill: parent
83+ objectName: "webview"
84+ Component.onCompleted: {
85+ loadHtml("<html><body><textarea id='textarea' onkeyup=\\\"document.title=document.getElementById('textarea').value;\\\" style='width: 100%; height: 100%;'></textarea></body></html>");
86+ }
87+ }
88+
89+ }
90+
91+ """)
92+ app = self._start_qml_script(qml)
93+ webview = app.select_single(objectName='webview')
94+
95+ self.ensure_focus_on_input(webview)
96+ keyboard = Keyboard()
97+ self.addCleanup(keyboard.dismiss)
98+
99+ keyboard.type('Pic ')
100+
101+ expected = 'Picture'
102+ self.assertThat(
103+ webview.title,
104+ Eventually(Equals(expected))
105+ )
106+
107
108 def maliit_cleanup():
109 presagedir = os.path.expanduser("~/.presage")

Subscribers

People subscribed via source and target branches