Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py]: add type hints for method parameters #11053

Merged
merged 2 commits into from Sep 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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