From 7dc03710b168f790637b84a3dfbbbf154c39a03c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 6 Jan 2016 22:57:49 +0100 Subject: [PATCH] bdd: Only check logs for "... should be loaded". Checking the requests from the webserver proved problematic, as often there's some kind of caching going on. Instead, we only check the log, as this is used for things like :navigate anyways, so if the log says the page got loaded, we can trust it. There's still "... should be requested" to check the actual requests. --- tests/integration/features/conftest.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 392f35d51..07268921e 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -197,7 +197,20 @@ def fill_clipboard(qtbot, qapp, httpbin, what, content): @bdd.then(bdd.parsers.parse("{path} should be loaded")) -def path_should_be_loaded(httpbin, path): +def path_should_be_loaded(quteproc, path): + """Make sure the given path was loaded according to the log. + + This is usally the better check compared to "should be requested" as the + page could be loaded from local cache. + """ + url = quteproc.path_to_url(path) + pattern = ("load status for : LoadStatus.success".format(url)) + quteproc.wait_for(message=pattern) + + +@bdd.then(bdd.parsers.parse("{path} should be requested")) +def path_should_be_requested(httpbin, path): """Make sure the given path was loaded from the webserver.""" httpbin.wait_for(verb='GET', path='/' + path)