Skip to content

Commit

Permalink
[py]: add type hints for method parameters (#11053)
Browse files Browse the repository at this point in the history
  • Loading branch information
plming committed Sep 26, 2022
1 parent df0f92d commit 760305b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions py/selenium/webdriver/remote/webdriver.py
Expand Up @@ -741,7 +741,7 @@ def add_cookie(self, cookie_dict) -> None:
self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})

# Timeouts
def implicitly_wait(self, time_to_wait) -> None:
def implicitly_wait(self, time_to_wait: float) -> None:
"""
Sets a sticky timeout to implicitly wait for an element to be found,
or a command to complete. This method only needs to be called one
Expand All @@ -759,7 +759,7 @@ def implicitly_wait(self, time_to_wait) -> None:
self.execute(Command.SET_TIMEOUTS, {
'implicit': int(float(time_to_wait) * 1000)})

def set_script_timeout(self, time_to_wait) -> None:
def set_script_timeout(self, time_to_wait: float) -> None:
"""
Set the amount of time that the script should wait during an
execute_async_script call before throwing an error.
Expand All @@ -775,7 +775,7 @@ def set_script_timeout(self, time_to_wait) -> None:
self.execute(Command.SET_TIMEOUTS, {
'script': int(float(time_to_wait) * 1000)})

def set_page_load_timeout(self, time_to_wait) -> None:
def set_page_load_timeout(self, time_to_wait: float) -> None:
"""
Set the amount of time to wait for a page load to complete
before throwing an error.
Expand Down Expand Up @@ -826,7 +826,7 @@ def timeouts(self, timeouts) -> None:
"""
_ = self.execute(Command.SET_TIMEOUTS, timeouts._to_json())['value']

def find_element(self, by=By.ID, value=None) -> WebElement:
def find_element(self, by=By.ID, value: Optional[str] = None) -> WebElement:
"""
Find an element given a By strategy and locator.
Expand Down Expand Up @@ -857,7 +857,7 @@ def find_element(self, by=By.ID, value=None) -> WebElement:
'using': by,
'value': value})['value']

def find_elements(self, by=By.ID, value=None) -> List[WebElement]:
def find_elements(self, by=By.ID, value: Optional[str] = None) -> List[WebElement]:
"""
Find elements given a By strategy and locator.
Expand Down

0 comments on commit 760305b

Please sign in to comment.