diff --git a/tools/wptrunner/wptrunner/executors/base.py b/tools/wptrunner/wptrunner/executors/base.py index 4bc193d038b3bc..f62ded610ca4ed 100644 --- a/tools/wptrunner/wptrunner/executors/base.py +++ b/tools/wptrunner/wptrunner/executors/base.py @@ -644,6 +644,7 @@ def do_wdspec(self, path, timeout): session_config = {"host": self.browser.host, "port": self.browser.port, "capabilities": self.capabilities, + "timeout_multiplier": self.timeout_multiplier, "webdriver": { "binary": self.webdriver_binary, "args": self.webdriver_args diff --git a/webdriver/tests/get_timeouts/get.py b/webdriver/tests/get_timeouts/get.py index 9601c00d903d5f..aa02c0990e1a11 100644 --- a/webdriver/tests/get_timeouts/get.py +++ b/webdriver/tests/get_timeouts/get.py @@ -23,15 +23,6 @@ def test_get_timeouts(session): assert isinstance(value["pageLoad"], int) -def test_get_default_timeouts(session): - response = get_timeouts(session) - - assert_success(response) - assert response.body["value"]["script"] == 30000 - assert response.body["value"]["implicit"] == 0 - assert response.body["value"]["pageLoad"] == 300000 - - def test_get_new_timeouts(session): session.timeouts.script = 60 session.timeouts.implicit = 1 diff --git a/webdriver/tests/support/fixtures.py b/webdriver/tests/support/fixtures.py index 4a08d921a3bb2d..9201e0859022e4 100644 --- a/webdriver/tests/support/fixtures.py +++ b/webdriver/tests/support/fixtures.py @@ -14,13 +14,14 @@ from tests.support.http_request import HTTPRequest +SCRIPT_TIMEOUT = 1 +PAGE_LOAD_TIMEOUT = 3 +IMPLICIT_WAIT_TIMEOUT = 0 + # The webdriver session can outlive a pytest session _current_session = None -_custom_session = False - - def pytest_configure(config): # register the capabilities marker config.addinivalue_line( @@ -63,6 +64,7 @@ def full_configuration(): host - WebDriver server host. port - WebDriver server port. capabilites - Capabilites passed when creating the WebDriver session + timeout_multiplier - Multiplier for timeout values webdriver - Dict with keys `binary`: path to webdriver binary, and `args`: Additional command line arguments passed to the webdriver binary. This doesn't include all the required arguments e.g. the @@ -137,6 +139,12 @@ async def session(capabilities, configuration): _current_session.window.size = defaults.WINDOW_SIZE _current_session.window.position = defaults.WINDOW_POSITION + # Set default timeouts + multiplier = configuration["timeout_multiplier"] + _current_session.timeouts.implicit = IMPLICIT_WAIT_TIMEOUT * multiplier + _current_session.timeouts.page_load = PAGE_LOAD_TIMEOUT * multiplier + _current_session.timeouts.script = SCRIPT_TIMEOUT * multiplier + yield _current_session cleanup_session(_current_session)