tests/e2e: add retry for webdriver init
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
c28f68400d
commit
3a51bcd890
|
@ -106,10 +106,16 @@ class SeleniumTestCase(StaticLiveServerTestCase):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _get_driver(self) -> WebDriver:
|
def _get_driver(self) -> WebDriver:
|
||||||
return webdriver.Remote(
|
count = 0
|
||||||
command_executor="http://localhost:4444/wd/hub",
|
while count < RETRIES:
|
||||||
desired_capabilities=DesiredCapabilities.CHROME,
|
try:
|
||||||
)
|
return webdriver.Remote(
|
||||||
|
command_executor="http://localhost:4444/wd/hub",
|
||||||
|
desired_capabilities=DesiredCapabilities.CHROME,
|
||||||
|
)
|
||||||
|
except WebDriverException:
|
||||||
|
count += 1
|
||||||
|
raise ValueError(f"Webdriver failed after {RETRIES}.")
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
if "TF_BUILD" in environ:
|
if "TF_BUILD" in environ:
|
||||||
|
|
Reference in a new issue