Make reloading more reliable.

Before, we didn't wait until the reload is done, which could lead to a race
condition.
This commit is contained in:
Florian Bruhin 2015-10-27 06:59:57 +01:00
parent 2be5c4cd27
commit 5ed419c7f5
2 changed files with 8 additions and 2 deletions

View File

@ -5,9 +5,9 @@ Feature: Going back and forward.
Given I open data/backforward/1.txt
When I open data/backforward/2.txt
And I run :back
And I run :reload
And I reload
And I run :forward
And I run :reload
And I reload
Then the requests should be:
data/backforward/1.txt
data/backforward/2.txt

View File

@ -48,6 +48,12 @@ def run_command(quteproc, command):
quteproc.send_cmd(command)
@bdd.when(bdd.parsers.parse("I reload"))
def run_command(qtbot, httpbin, quteproc, command):
with qtbot.waitSignal(httpbin.new_request, raising=True):
quteproc.send_cmd(':reload')
@bdd.then(bdd.parsers.parse("{path} should be loaded"))
def path_should_be_loaded(httpbin, path):
requests = httpbin.get_requests()