From 23a0d7a3ed3a56d2103e10436f1d7c31392614bb Mon Sep 17 00:00:00 2001 From: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:47:44 -0500 Subject: [PATCH 1/2] [py] Update type annotation to include WebElement This adds `WebElement` to the type annotation for the `frame_to_be_available_and_switch_to_it` function in the `expected_conditions` module. --- py/selenium/webdriver/support/expected_conditions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/selenium/webdriver/support/expected_conditions.py b/py/selenium/webdriver/support/expected_conditions.py index 9f6936eec27e5..6b5093d85da8e 100644 --- a/py/selenium/webdriver/support/expected_conditions.py +++ b/py/selenium/webdriver/support/expected_conditions.py @@ -485,7 +485,7 @@ def _predicate(driver: WebDriverOrWebElement): return _predicate -def frame_to_be_available_and_switch_to_it(locator: Union[Tuple[str, str], str]) -> Callable[[WebDriver], bool]: +def frame_to_be_available_and_switch_to_it(locator: Union[Tuple[str, str], str, WebElement]) -> Callable[[WebDriver], bool]: """An expectation for checking whether the given frame is available to switch to. From 77a127dc221829ff05e95a5cbc686416c1f9c46a Mon Sep 17 00:00:00 2001 From: Corey Goldberg <1113081+cgoldberg@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:55:32 -0500 Subject: [PATCH 2/2] Updated docstring with type annotation change --- py/selenium/webdriver/support/expected_conditions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/selenium/webdriver/support/expected_conditions.py b/py/selenium/webdriver/support/expected_conditions.py index 6b5093d85da8e..48dd6705beb36 100644 --- a/py/selenium/webdriver/support/expected_conditions.py +++ b/py/selenium/webdriver/support/expected_conditions.py @@ -491,7 +491,7 @@ def frame_to_be_available_and_switch_to_it(locator: Union[Tuple[str, str], str, Parameters: ---------- - locator : Union[Tuple[str, str], str] + locator: Union[Tuple[str, str], str, WebElement] Used to find the frame. Returns: