Fix :follow-selected tests

This commit is contained in:
Florian Bruhin 2018-09-14 20:23:56 +02:00
parent bc45aa33e0
commit 8d066690e6

View File

@ -331,16 +331,24 @@ class TestSearch:
class TestFollowSelected: class TestFollowSelected:
def test_follow_selected_without_a_selection(self, qtbot, caret, selection): LOAD_STARTED_DELAY = 50
with qtbot.wait_signal(caret.follow_selected_done):
caret.follow_selected()
def test_follow_selected_with_text(self, qtbot, caret, selection): def test_follow_selected_without_a_selection(self, qtbot, caret, selection, web_tab,
mode_manager):
mode_manager.leave(usertypes.KeyMode.caret)
with qtbot.wait_signal(caret.follow_selected_done):
with qtbot.assert_not_emitted(web_tab.load_started):
caret.follow_selected()
qtbot.wait(self.LOAD_STARTED_DELAY)
def test_follow_selected_with_text(self, qtbot, caret, selection, web_tab):
caret.move_to_next_word() caret.move_to_next_word()
selection.toggle() selection.toggle()
caret.move_to_end_of_word() caret.move_to_end_of_word()
with qtbot.wait_signal(caret.follow_selected_done): with qtbot.wait_signal(caret.follow_selected_done):
caret.follow_selected() with qtbot.assert_not_emitted(web_tab.load_started):
caret.follow_selected()
qtbot.wait(self.LOAD_STARTED_DELAY)
@pytest.mark.parametrize('with_js', [True, False]) @pytest.mark.parametrize('with_js', [True, False])
def test_follow_selected_with_link(self, caret, selection, config_stub, def test_follow_selected_with_link(self, caret, selection, config_stub,