~michael-sheldon/webbrowser-app/fix-1531179

« back to all changes in this revision

Viewing changes to tests/autopilot/webbrowser_app/tests/test_keyboard.py

Add keyboard shorcuts for 'next' (Ctrl+G) and 'previous' (Ctrl+Shift+G) while in find-in-page mode. Fixes: #1522152
Approved by: PS Jenkins bot, Ugo Riboni

Show diffs side-by-side

added added

removed removed

Lines of Context:
432
432
        self.main_window.press_key('Ctrl+f')
433
433
        self.assertThat(address_bar.findInPageMode, Equals(False))
434
434
 
 
435
    def test_find_previous_and_next(self):
 
436
        url = self.base_url + "/findinpage"
 
437
        self.main_window.go_to_url(url)
 
438
        self.main_window.wait_until_page_loaded(url)
 
439
        address_bar = self.main_window.chrome.address_bar
 
440
        self.main_window.press_key('Ctrl+f')
 
441
        self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))
 
442
        address_bar.write("e")
 
443
        counter = address_bar.get_find_in_page_counter()
 
444
        self.assertThat(counter.count, Eventually(Equals(4)))
 
445
        self.assertThat(counter.current, Eventually(Equals(1)))
 
446
        for i in [2, 3, 4, 1, 2, 3, 4, 1, 2]:
 
447
            self.main_window.press_key('Ctrl+g')
 
448
            self.assertThat(counter.current, Eventually(Equals(i)))
 
449
        for i in [1, 4, 3, 2, 1, 4, 3, 2]:
 
450
            self.main_window.press_key('Ctrl+Shift+g')
 
451
            self.assertThat(counter.current, Eventually(Equals(i)))
 
452
 
435
453
    def test_navigate_between_address_bar_and_new_tab_view(self):
436
454
        if not self.main_window.wide:
437
455
            self.skipTest("Only on wide form factors")