fix: 'until' util function
This commit is contained in:
@@ -13,8 +13,8 @@ driver: WebDriver|None = None
|
|||||||
unique, parameters = None, dict()
|
unique, parameters = None, dict()
|
||||||
|
|
||||||
def until[T](condition: Callable[[WebDriver], T], timeout=None) -> T:
|
def until[T](condition: Callable[[WebDriver], T], timeout=None) -> T:
|
||||||
try: return WebDriverWait(driver, timeout or parameters.get('timeout') or 0).until(condition)
|
wait = WebDriverWait(driver, timeout or parameters.get('timeout') or 0)
|
||||||
except: pass
|
return wait.until(condition, "Timeout")
|
||||||
|
|
||||||
def sleep(seconds: float):
|
def sleep(seconds: float):
|
||||||
try: driver.switch_to.alert
|
try: driver.switch_to.alert
|
||||||
|
|||||||
Reference in New Issue
Block a user