From 03a88196525abe0cc3c2a47cc46bcdf802416ef7 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Sat, 26 Jan 2019 12:47:35 +0000 Subject: [PATCH] [FIX] tests: avoid check document.readyState of about:blank In an HttpCase test, when the browser_js method is used, an optional javascript code can be used to check that the page is ready to execute the test. When no 'ready' code is given it defaults to check the 'document.readyState' status. In some rare cases (discovered by @Xavier-Do) this status is checked on the 'about:blank' page. As the page seems ready, the test code is evaluated and fails. With this commit, when no specific ready code is provided, the test will wait for a chrome devtools event that ensure the page is fully loaded before starting the test. closes odoo/odoo#30584 --- odoo/tests/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 56b76e01c84..b735a63c816 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -915,7 +915,7 @@ class HttpCase(TransactionCase): if odoo.tools.config['logfile']: self._logger.info('Starting screen cast') self.browser.start_screencast() - self.browser.navigate_to(url) + self.browser.navigate_to(url, wait_stop=not bool(ready)) # Needed because tests like test01.js (qunit tests) are passing a ready # code = ""