Skip to content

Commit 760305b

Browse files
authored
[py]: add type hints for method parameters (#11053)
1 parent df0f92d commit 760305b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

py/selenium/webdriver/remote/webdriver.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ def add_cookie(self, cookie_dict) -> None:
741741
self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
742742

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

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

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

829-
def find_element(self, by=By.ID, value=None) -> WebElement:
829+
def find_element(self, by=By.ID, value: Optional[str] = None) -> WebElement:
830830
"""
831831
Find an element given a By strategy and locator.
832832
@@ -857,7 +857,7 @@ def find_element(self, by=By.ID, value=None) -> WebElement:
857857
'using': by,
858858
'value': value})['value']
859859

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

0 commit comments

Comments
 (0)