Skip to content

Commit e92a7dc

Browse files
nemowang2003cgoldberg
authored andcommitted
[py] Fix return type hint for alert_is_present (#16975)
--------- Co-authored-by: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com>
1 parent dd90b08 commit e92a7dc

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

py/selenium/webdriver/support/expected_conditions.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -692,19 +692,16 @@ def _predicate(driver: WebDriver):
692692
return _predicate
693693

694694

695-
def alert_is_present() -> Callable[[WebDriver], Alert | bool]:
695+
def alert_is_present() -> Callable[[WebDriver], Alert | Literal[False]]:
696696
"""Check that an alert is present and switch to it.
697697
698698
Returns:
699-
The Alert once it is located.
699+
The Alert once it is located, or False if no alert is present.
700700
701701
Example:
702702
from selenium.webdriver.support.ui import WebDriverWait
703703
from selenium.webdriver.support import expected_conditions as EC
704704
alert = WebDriverWait(driver, 10).until(EC.alert_is_present())
705-
706-
Note:
707-
If the alert is present it switches the given driver to it.
708705
"""
709706

710707
def _predicate(driver: WebDriver):

0 commit comments

Comments
 (0)