From 3114d064edbae3f938b0881ec312b503a4c57147 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 30 Jun 2020 16:36:30 +0200 Subject: [PATCH] e2e: improve error message when using wait_for_url --- e2e/utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/e2e/utils.py b/e2e/utils.py index 20b337db3..7c10ad47e 100644 --- a/e2e/utils.py +++ b/e2e/utils.py @@ -46,8 +46,8 @@ class SeleniumTestCase(StaticLiveServerTestCase): makedirs("out", exist_ok=True) self.driver = self._get_driver() self.driver.maximize_window() - self.driver.implicitly_wait(60) - self.wait = WebDriverWait(self.driver, 120) + self.driver.implicitly_wait(300) + self.wait = WebDriverWait(self.driver, 500) self.apply_default_data() self.logger = get_logger() @@ -68,7 +68,10 @@ class SeleniumTestCase(StaticLiveServerTestCase): def wait_for_url(self, desired_url): """Wait until URL is `desired_url`.""" - self.wait.until(lambda driver: driver.current_url == desired_url) + self.wait.until( + lambda driver: driver.current_url == desired_url, + f"URL {self.driver.current_url} doesn't match expected URL {desired_url}", + ) def url(self, view, **kwargs) -> str: """reverse `view` with `**kwargs` into full URL using live_server_url"""