2021-04-08 07:01:51 +00:00
|
|
|
from pyodide_build.testing import set_webdriver_script_timeout
|
|
|
|
|
|
|
|
|
|
|
|
class _MockSelenium:
|
|
|
|
script_timeout = 2
|
2021-07-20 08:48:27 +00:00
|
|
|
|
|
|
|
def set_script_timeout(self, value):
|
|
|
|
self._timeout = value
|
2021-04-08 07:01:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_set_webdriver_script_timeout():
|
|
|
|
selenium = _MockSelenium()
|
2021-07-20 08:48:27 +00:00
|
|
|
assert not hasattr(selenium, "_timeout")
|
2021-04-08 07:01:51 +00:00
|
|
|
with set_webdriver_script_timeout(selenium, script_timeout=10):
|
2021-07-20 08:48:27 +00:00
|
|
|
assert selenium._timeout == 10
|
|
|
|
assert selenium._timeout == 2
|