fix: added type hints
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
from typing import Callable
|
||||
from selenium.webdriver.remote.webdriver import WebDriver
|
||||
from selenium.webdriver.remote.webelement import WebElement
|
||||
from selenium.webdriver.common.by import By
|
||||
@@ -11,7 +12,7 @@ from selenium.common.exceptions import StaleElementReferenceException, NoAlertPr
|
||||
driver: WebDriver|None = None
|
||||
unique, parameters = None, dict()
|
||||
|
||||
def until(condition, timeout=None):
|
||||
def until[T](condition: Callable[[WebDriver], T], timeout=None) -> T:
|
||||
try: return WebDriverWait(driver, timeout or parameters.get('timeout') or 0).until(condition)
|
||||
except: pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user