mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Add an handler when the ui test is reaching an error page due to a connectionFailure
This commit is contained in:
parent
1f5a1beac0
commit
c7543df86a
1 changed files with 8 additions and 4 deletions
|
|
@ -18,10 +18,7 @@ from selenium.webdriver.firefox.service import Service
|
|||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.remote.webelement import WebElement
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from selenium.common.exceptions import (
|
||||
ElementClickInterceptedException,
|
||||
TimeoutException,
|
||||
)
|
||||
from selenium.common.exceptions import ElementClickInterceptedException, TimeoutException, WebDriverException
|
||||
|
||||
ready = False
|
||||
retries = 0
|
||||
|
|
@ -146,6 +143,13 @@ def access_page(
|
|||
|
||||
print(f"{name.title()} page didn't load in time, exiting ...", flush=True)
|
||||
exit(1)
|
||||
except WebDriverException as we:
|
||||
if "connectionFailure" in str(we):
|
||||
print("Connection failure, retrying in 5s ...", flush=True)
|
||||
driver.refresh()
|
||||
sleep(5)
|
||||
return access_page(driver, driver_wait, button, name, message, retries=1)
|
||||
raise we
|
||||
|
||||
if message:
|
||||
print(
|
||||
|
|
|
|||
Loading…
Reference in a new issue