Skip to content

Commit 9a30730

Browse files
committed
[py]: Update docs around url_matches and use a None check. closes #11431
1 parent 2ac53b8 commit 9a30730

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

py/selenium/webdriver/support/expected_conditions.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ def _predicate(driver):
8888
def url_matches(pattern: str):
8989
"""An expectation for checking the current url.
9090
91-
pattern is the expected pattern, which must be an exact match
92-
returns True if the url matches, false otherwise.
91+
pattern is the expected pattern. This finds the first
92+
occurrence of pattern in the current url and as such does
93+
not require an exact full match.
9394
"""
9495

9596
def _predicate(driver):
96-
return bool(re.search(pattern, driver.current_url))
97+
return re.search(pattern, driver.current_url) is not None
9798

9899
return _predicate
99100

0 commit comments

Comments
 (0)