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
=== modified file 'tests/autopilot/webbrowser_app/tests/test_keyboard.py'
--- tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-10-16 15:29:02 +0000
+++ tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-11-09 14:15:15 +0000
@@ -67,7 +67,7 @@
67 self.address_bar = self.main_window.address_bar67 self.address_bar = self.main_window.address_bar
6868
69 def open_tab(self, url):69 def open_tab(self, url):
70 self.main_window.press_key('Ctrl+T')70 self.main_window.press_key('Ctrl+t')
71 new_tab_view = self.main_window.get_new_tab_view()71 new_tab_view = self.main_window.get_new_tab_view()
72 self.address_bar.go_to_url(url)72 self.address_bar.go_to_url(url)
73 new_tab_view.wait_until_destroyed()73 new_tab_view.wait_until_destroyed()
@@ -86,7 +86,7 @@
86 Eventually(Equals(url)))86 Eventually(Equals(url)))
8787
88 def test_new_tab(self):88 def test_new_tab(self):
89 self.main_window.press_key('Ctrl+T')89 self.main_window.press_key('Ctrl+t')
9090
91 webview = self.main_window.get_current_webview()91 webview = self.main_window.get_current_webview()
92 self.assertThat(webview.url, Equals(""))92 self.assertThat(webview.url, Equals(""))
@@ -190,12 +190,12 @@
190 self.assertThat(webview.url, Equals(""))190 self.assertThat(webview.url, Equals(""))
191191
192 def test_select_address_bar_ctrl_l(self):192 def test_select_address_bar_ctrl_l(self):
193 self.main_window.press_key('Ctrl+L')193 self.main_window.press_key('Ctrl+l')
194 self.assertThat(self.address_bar.text_field.selectedText,194 self.assertThat(self.address_bar.text_field.selectedText,
195 Eventually(Equals(self.address_bar.text_field.text)))195 Eventually(Equals(self.address_bar.text_field.text)))
196196
197 def test_select_address_bar_alt_d(self):197 def test_select_address_bar_alt_d(self):
198 self.main_window.press_key('Alt+D')198 self.main_window.press_key('Alt+d')
199 self.assertThat(self.address_bar.text_field.selectedText,199 self.assertThat(self.address_bar.text_field.selectedText,
200 Eventually(Equals(self.address_bar.text_field.text)))200 Eventually(Equals(self.address_bar.text_field.text)))
201201
@@ -205,7 +205,7 @@
205 Eventually(Equals(self.address_bar.text_field.text)))205 Eventually(Equals(self.address_bar.text_field.text)))
206206
207 def test_escape_from_address_bar(self):207 def test_escape_from_address_bar(self):
208 self.main_window.press_key('Alt+D')208 self.main_window.press_key('Alt+d')
209 self.assertThat(self.address_bar.text_field.selectedText,209 self.assertThat(self.address_bar.text_field.selectedText,
210 Eventually(Equals(self.address_bar.text_field.text)))210 Eventually(Equals(self.address_bar.text_field.text)))
211 self.main_window.press_key('Escape')211 self.main_window.press_key('Escape')
@@ -223,7 +223,7 @@
223 watcher = webview.watch_signal('loadingStateChanged()')223 watcher = webview.watch_signal('loadingStateChanged()')
224 previous = watcher.num_emissions224 previous = watcher.num_emissions
225225
226 self.main_window.press_key('Ctrl+R')226 self.main_window.press_key('Ctrl+r')
227 self.assertThat(227 self.assertThat(
228 lambda: watcher.num_emissions,228 lambda: watcher.num_emissions,
229 Eventually(GreaterThan(previous)))229 Eventually(GreaterThan(previous)))
@@ -242,13 +242,13 @@
242 def test_bookmark(self):242 def test_bookmark(self):
243 chrome = self.main_window.chrome243 chrome = self.main_window.chrome
244 self.assertThat(chrome.bookmarked, Equals(False))244 self.assertThat(chrome.bookmarked, Equals(False))
245 self.main_window.press_key('Ctrl+D')245 self.main_window.press_key('Ctrl+d')
246 self.assertThat(chrome.bookmarked, Eventually(Equals(True)))246 self.assertThat(chrome.bookmarked, Eventually(Equals(True)))
247 self.main_window.press_key('Escape')247 self.main_window.press_key('Escape')
248 self.assertThat(chrome.bookmarked, Eventually(Equals(False)))248 self.assertThat(chrome.bookmarked, Eventually(Equals(False)))
249 self.main_window.press_key('Ctrl+D')249 self.main_window.press_key('Ctrl+d')
250 self.assertThat(chrome.bookmarked, Eventually(Equals(True)))250 self.assertThat(chrome.bookmarked, Eventually(Equals(True)))
251 self.main_window.press_key('Ctrl+D')251 self.main_window.press_key('Ctrl+d')
252 self.assertThat(chrome.bookmarked, Eventually(Equals(False)))252 self.assertThat(chrome.bookmarked, Eventually(Equals(False)))
253253
254 def test_history_navigation_with_alt_arrows(self):254 def test_history_navigation_with_alt_arrows(self):
@@ -281,7 +281,7 @@
281281
282 def test_toggle_bookmarks(self):282 def test_toggle_bookmarks(self):
283 self.assertThat(self.main_window.get_bookmarks_view(), Equals(None))283 self.assertThat(self.main_window.get_bookmarks_view(), Equals(None))
284 self.main_window.press_key('Ctrl+Shift+O')284 self.main_window.press_key('Ctrl+Shift+o')
285 self.assertThat(lambda: self.main_window.get_bookmarks_view(),285 self.assertThat(lambda: self.main_window.get_bookmarks_view(),
286 Eventually(NotEquals(None)))286 Eventually(NotEquals(None)))
287 bookmarks_view = self.main_window.get_bookmarks_view()287 bookmarks_view = self.main_window.get_bookmarks_view()
@@ -306,7 +306,7 @@
306 bookmarks_view = self.main_window.get_bookmarks_view()306 bookmarks_view = self.main_window.get_bookmarks_view()
307 self.assertThat(bookmarks_view.activeFocus, Eventually(Equals(True)))307 self.assertThat(bookmarks_view.activeFocus, Eventually(Equals(True)))
308308
309 self.main_window.press_key('Ctrl+T')309 self.main_window.press_key('Ctrl+t')
310 bookmarks_view.wait_until_destroyed()310 bookmarks_view.wait_until_destroyed()
311311
312 new_tab_view = self.main_window.get_new_tab_view()312 new_tab_view = self.main_window.get_new_tab_view()
@@ -314,7 +314,7 @@
314314
315 def test_toggle_history(self):315 def test_toggle_history(self):
316 self.assertThat(self.main_window.get_history_view(), Equals(None))316 self.assertThat(self.main_window.get_history_view(), Equals(None))
317 self.main_window.press_key('Ctrl+H')317 self.main_window.press_key('Ctrl+h')
318 self.assertThat(lambda: self.main_window.get_history_view(),318 self.assertThat(lambda: self.main_window.get_history_view(),
319 Eventually(NotEquals(None)))319 Eventually(NotEquals(None)))
320 history_view = self.main_window.get_history_view()320 history_view = self.main_window.get_history_view()
@@ -339,7 +339,7 @@
339 history_view = self.main_window.get_history_view()339 history_view = self.main_window.get_history_view()
340 self.assertThat(history_view.activeFocus, Eventually(Equals(True)))340 self.assertThat(history_view.activeFocus, Eventually(Equals(True)))
341341
342 self.main_window.press_key('Ctrl+T')342 self.main_window.press_key('Ctrl+t')
343 history_view.wait_until_destroyed()343 history_view.wait_until_destroyed()
344344
345 new_tab_view = self.main_window.get_new_tab_view()345 new_tab_view = self.main_window.get_new_tab_view()
@@ -355,12 +355,12 @@
355 def test_find_in_page_ctrl_f(self):355 def test_find_in_page_ctrl_f(self):
356 address_bar = self.main_window.chrome.address_bar356 address_bar = self.main_window.chrome.address_bar
357 self.assertThat(address_bar.findInPageMode, Equals(False))357 self.assertThat(address_bar.findInPageMode, Equals(False))
358 self.main_window.press_key('Ctrl+F')358 self.main_window.press_key('Ctrl+f')
359 self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))359 self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))
360 self.main_window.press_key('Escape')360 self.main_window.press_key('Escape')
361 self.assertThat(address_bar.findInPageMode, Eventually(Equals(False)))361 self.assertThat(address_bar.findInPageMode, Eventually(Equals(False)))
362 if not self.main_window.wide:362 if not self.main_window.wide:
363 self.open_tabs_view()363 self.open_tabs_view()
364 self.open_new_tab()364 self.open_new_tab()
365 self.main_window.press_key('Ctrl+F')365 self.main_window.press_key('Ctrl+f')
366 self.assertThat(address_bar.findInPageMode, Equals(False))366 self.assertThat(address_bar.findInPageMode, Equals(False))
367367
=== modified file 'tests/autopilot/webbrowser_app/tests/test_tabs.py'
--- tests/autopilot/webbrowser_app/tests/test_tabs.py 2015-10-26 13:06:27 +0000
+++ tests/autopilot/webbrowser_app/tests/test_tabs.py 2015-11-09 14:15:15 +0000
@@ -141,7 +141,7 @@
141 the new page view"""141 the new page view"""
142 address_bar = self.main_window.address_bar142 address_bar = self.main_window.address_bar
143143
144 self.main_window.press_key('Ctrl+T')144 self.main_window.press_key('Ctrl+t')
145 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))145 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))
146146
147 self.main_window.press_key('Ctrl+Tab')147 self.main_window.press_key('Ctrl+Tab')
@@ -159,31 +159,31 @@
159 allowing keyboard shortcuts to work without interruption"""159 allowing keyboard shortcuts to work without interruption"""
160 address_bar = self.main_window.address_bar160 address_bar = self.main_window.address_bar
161161
162 self.main_window.press_key('Ctrl+T')162 self.main_window.press_key('Ctrl+t')
163 self.main_window.press_key('Ctrl+T')163 self.main_window.press_key('Ctrl+t')
164 url = self.base_url + "/test1"164 url = self.base_url + "/test1"
165 self.main_window.go_to_url(url)165 self.main_window.go_to_url(url)
166 self.main_window.wait_until_page_loaded(url)166 self.main_window.wait_until_page_loaded(url)
167167
168 self.main_window.press_key('Ctrl+T')168 self.main_window.press_key('Ctrl+t')
169 url = self.base_url + "/test2"169 url = self.base_url + "/test2"
170 self.main_window.go_to_url(url)170 self.main_window.go_to_url(url)
171 self.main_window.wait_until_page_loaded(url)171 self.main_window.wait_until_page_loaded(url)
172 self.main_window.press_key('Ctrl+T')172 self.main_window.press_key('Ctrl+t')
173 self.main_window.press_key('Ctrl+T')173 self.main_window.press_key('Ctrl+t')
174174
175 self.main_window.press_key('Ctrl+W')175 self.main_window.press_key('Ctrl+w')
176 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))176 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))
177177
178 self.main_window.press_key('Ctrl+W')178 self.main_window.press_key('Ctrl+w')
179 webview = self.main_window.get_current_webview()179 webview = self.main_window.get_current_webview()
180 self.assertThat(webview.activeFocus, Eventually(Equals(True)))180 self.assertThat(webview.activeFocus, Eventually(Equals(True)))
181181
182 self.main_window.press_key('Ctrl+W')182 self.main_window.press_key('Ctrl+w')
183 webview = self.main_window.get_current_webview()183 webview = self.main_window.get_current_webview()
184 self.assertThat(webview.activeFocus, Eventually(Equals(True)))184 self.assertThat(webview.activeFocus, Eventually(Equals(True)))
185185
186 self.main_window.press_key('Ctrl+W')186 self.main_window.press_key('Ctrl+w')
187 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))187 self.assertThat(address_bar.activeFocus, Eventually(Equals(True)))
188188
189189

Subscribers

People subscribed via source and target branches

to status/vote changes: