Merge lp:~uriboni/webbrowser-app/ap-keyboard-case-sensitive into lp:webbrowser-app

Proposed by Ugo Riboni
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1271
Merged at revision: 1274
Proposed branch: lp:~uriboni/webbrowser-app/ap-keyboard-case-sensitive
Merge into: lp:webbrowser-app
Diff against target: 180 lines (+31/-31)
2 files modified
tests/autopilot/webbrowser_app/tests/test_keyboard.py (+15/-15)
tests/autopilot/webbrowser_app/tests/test_tabs.py (+16/-16)
To merge this branch: bzr merge lp:~uriboni/webbrowser-app/ap-keyboard-case-sensitive
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+277009@code.launchpad.net

Commit message

Use lowercase letters for keyboard shortcut invokation in autopilot tests.

Autopilot tries to be too clever and automatically issues a Shift when an uppercase letter is used in a keypress combo. Fix our tests to adjust to this behavior.

Description of the change

Autopilot tries to be too clever and automatically appends a Shift when an uppercase letter is used in a keypress combo. Fix our tests to adjust to this behavior.

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
Francis Ginther (fginther) wrote :

I've restarted this MP to work around an issue triggering generic-deb-autopilot-vivid-touch on krillin hardware.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/webbrowser_app/tests/test_keyboard.py'
2--- tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-10-16 15:29:02 +0000
3+++ tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-11-09 14:15:15 +0000
4@@ -67,7 +67,7 @@
5 self.address_bar = self.main_window.address_bar
6
7 def open_tab(self, url):
8- self.main_window.press_key('Ctrl+T')
9+ self.main_window.press_key('Ctrl+t')
10 new_tab_view = self.main_window.get_new_tab_view()
11 self.address_bar.go_to_url(url)
12 new_tab_view.wait_until_destroyed()
13@@ -86,7 +86,7 @@
14 Eventually(Equals(url)))
15
16 def test_new_tab(self):
17- self.main_window.press_key('Ctrl+T')
18+ self.main_window.press_key('Ctrl+t')
19
20 webview = self.main_window.get_current_webview()
21 self.assertThat(webview.url, Equals(""))
22@@ -190,12 +190,12 @@
23 self.assertThat(webview.url, Equals(""))
24
25 def test_select_address_bar_ctrl_l(self):
26- self.main_window.press_key('Ctrl+L')
27+ self.main_window.press_key('Ctrl+l')
28 self.assertThat(self.address_bar.text_field.selectedText,
29 Eventually(Equals(self.address_bar.text_field.text)))
30
31 def test_select_address_bar_alt_d(self):
32- self.main_window.press_key('Alt+D')
33+ self.main_window.press_key('Alt+d')
34 self.assertThat(self.address_bar.text_field.selectedText,
35 Eventually(Equals(self.address_bar.text_field.text)))
36
37@@ -205,7 +205,7 @@
38 Eventually(Equals(self.address_bar.text_field.text)))
39
40 def test_escape_from_address_bar(self):
41- self.main_window.press_key('Alt+D')
42+ self.main_window.press_key('Alt+d')
43 self.assertThat(self.address_bar.text_field.selectedText,
44 Eventually(Equals(self.address_bar.text_field.text)))
45 self.main_window.press_key('Escape')
46@@ -223,7 +223,7 @@
47 watcher = webview.watch_signal('loadingStateChanged()')
48 previous = watcher.num_emissions
49
50- self.main_window.press_key('Ctrl+R')
51+ self.main_window.press_key('Ctrl+r')
52 self.assertThat(
53 lambda: watcher.num_emissions,
54 Eventually(GreaterThan(previous)))
55@@ -242,13 +242,13 @@
56 def test_bookmark(self):
57 chrome = self.main_window.chrome
58 self.assertThat(chrome.bookmarked, Equals(False))
59- self.main_window.press_key('Ctrl+D')
60+ self.main_window.press_key('Ctrl+d')
61 self.assertThat(chrome.bookmarked, Eventually(Equals(True)))
62 self.main_window.press_key('Escape')
63 self.assertThat(chrome.bookmarked, Eventually(Equals(False)))
64- self.main_window.press_key('Ctrl+D')
65+ self.main_window.press_key('Ctrl+d')
66 self.assertThat(chrome.bookmarked, Eventually(Equals(True)))
67- self.main_window.press_key('Ctrl+D')
68+ self.main_window.press_key('Ctrl+d')
69 self.assertThat(chrome.bookmarked, Eventually(Equals(False)))
70
71 def test_history_navigation_with_alt_arrows(self):
72@@ -281,7 +281,7 @@
73
74 def test_toggle_bookmarks(self):
75 self.assertThat(self.main_window.get_bookmarks_view(), Equals(None))
76- self.main_window.press_key('Ctrl+Shift+O')
77+ self.main_window.press_key('Ctrl+Shift+o')
78 self.assertThat(lambda: self.main_window.get_bookmarks_view(),
79 Eventually(NotEquals(None)))
80 bookmarks_view = self.main_window.get_bookmarks_view()
81@@ -306,7 +306,7 @@
82 bookmarks_view = self.main_window.get_bookmarks_view()
83 self.assertThat(bookmarks_view.activeFocus, Eventually(Equals(True)))
84
85- self.main_window.press_key('Ctrl+T')
86+ self.main_window.press_key('Ctrl+t')
87 bookmarks_view.wait_until_destroyed()
88
89 new_tab_view = self.main_window.get_new_tab_view()
90@@ -314,7 +314,7 @@
91
92 def test_toggle_history(self):
93 self.assertThat(self.main_window.get_history_view(), Equals(None))
94- self.main_window.press_key('Ctrl+H')
95+ self.main_window.press_key('Ctrl+h')
96 self.assertThat(lambda: self.main_window.get_history_view(),
97 Eventually(NotEquals(None)))
98 history_view = self.main_window.get_history_view()
99@@ -339,7 +339,7 @@
100 history_view = self.main_window.get_history_view()
101 self.assertThat(history_view.activeFocus, Eventually(Equals(True)))
102
103- self.main_window.press_key('Ctrl+T')
104+ self.main_window.press_key('Ctrl+t')
105 history_view.wait_until_destroyed()
106
107 new_tab_view = self.main_window.get_new_tab_view()
108@@ -355,12 +355,12 @@
109 def test_find_in_page_ctrl_f(self):
110 address_bar = self.main_window.chrome.address_bar
111 self.assertThat(address_bar.findInPageMode, Equals(False))
112- self.main_window.press_key('Ctrl+F')
113+ self.main_window.press_key('Ctrl+f')
114 self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))
115 self.main_window.press_key('Escape')
116 self.assertThat(address_bar.findInPageMode, Eventually(Equals(False)))
117 if not self.main_window.wide:
118 self.open_tabs_view()
119 self.open_new_tab()
120- self.main_window.press_key('Ctrl+F')
121+ self.main_window.press_key('Ctrl+f')
122 self.assertThat(address_bar.findInPageMode, Equals(False))
123
124=== modified file 'tests/autopilot/webbrowser_app/tests/test_tabs.py'
125--- tests/autopilot/webbrowser_app/tests/test_tabs.py 2015-10-26 13:06:27 +0000
126+++ tests/autopilot/webbrowser_app/tests/test_tabs.py 2015-11-09 14:15:15 +0000
127@@ -141,7 +141,7 @@
128 the new page view"""
129 address_bar = self.main_window.address_bar
130
131- self.main_window.press_key('Ctrl+T')
132+ self.main_window.press_key('Ctrl+t')
133 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))
134
135 self.main_window.press_key('Ctrl+Tab')
136@@ -159,31 +159,31 @@
137 allowing keyboard shortcuts to work without interruption"""
138 address_bar = self.main_window.address_bar
139
140- self.main_window.press_key('Ctrl+T')
141- self.main_window.press_key('Ctrl+T')
142+ self.main_window.press_key('Ctrl+t')
143+ self.main_window.press_key('Ctrl+t')
144 url = self.base_url + "/test1"
145 self.main_window.go_to_url(url)
146 self.main_window.wait_until_page_loaded(url)
147
148- self.main_window.press_key('Ctrl+T')
149+ self.main_window.press_key('Ctrl+t')
150 url = self.base_url + "/test2"
151 self.main_window.go_to_url(url)
152 self.main_window.wait_until_page_loaded(url)
153- self.main_window.press_key('Ctrl+T')
154- self.main_window.press_key('Ctrl+T')
155+ self.main_window.press_key('Ctrl+t')
156+ self.main_window.press_key('Ctrl+t')
157
158- self.main_window.press_key('Ctrl+W')
159+ self.main_window.press_key('Ctrl+w')
160 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))
161
162- self.main_window.press_key('Ctrl+W')
163- webview = self.main_window.get_current_webview()
164- self.assertThat(webview.activeFocus, Eventually(Equals(True)))
165-
166- self.main_window.press_key('Ctrl+W')
167- webview = self.main_window.get_current_webview()
168- self.assertThat(webview.activeFocus, Eventually(Equals(True)))
169-
170- self.main_window.press_key('Ctrl+W')
171+ self.main_window.press_key('Ctrl+w')
172+ webview = self.main_window.get_current_webview()
173+ self.assertThat(webview.activeFocus, Eventually(Equals(True)))
174+
175+ self.main_window.press_key('Ctrl+w')
176+ webview = self.main_window.get_current_webview()
177+ self.assertThat(webview.activeFocus, Eventually(Equals(True)))
178+
179+ self.main_window.press_key('Ctrl+w')
180 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))
181
182

Subscribers

People subscribed via source and target branches

to status/vote changes: