What happened?
According to the docstring of url_matches the pattern should be matched against the url exactly - Is a re.search sufficient here over re.fullmatch ?
"""An expectation for checking the current url.
pattern is the expected pattern, which must be an exact match
returns True if the url matches, false otherwise.
"""
This may be as expected, either way we should either update the docstring if the current searching is adequate, or move to re.fullmatch maybe if the implementation is slightly off?
theres also a url_to_be that relies on string equality, which is slightly less usable for polling against dynamic aspects of a url, so the docstring might just of been a copy-paste mistake there.
Will take a look at other bindings if they implement EC in this particular use case (if at all - not sure if ec was removed from some or if that was mostly talk at the time)
How can we reproduce the issue?
from selenium import webdriver
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
with webdriver.Chrome() as driver:
driver.get("https://www.selenium.dev")
# matches on first iteration
_ = WebDriverWait(driver, timeout=30).until(expected_conditions.url_matches(pattern="dev"))
Relevant log output
Operating System
N/A
Selenium version
4.7.2
What are the browser(s) and version(s) where you see this issue?
Not Applicable.
What are the browser driver(s) and version(s) where you see this issue?
Not Applicable.
Are you using Selenium Grid?
Not Applicable.
What happened?
According to the docstring of
url_matchesthe pattern should be matched against the url exactly - Is are.searchsufficient here overre.fullmatch?This may be as expected, either way we should either update the docstring if the current searching is adequate, or move to
re.fullmatchmaybe if the implementation is slightly off?theres also a
url_to_bethat relies on string equality, which is slightly less usable for polling against dynamic aspects of a url, so the docstring might just of been a copy-paste mistake there.Will take a look at other bindings if they implement EC in this particular use case (if at all - not sure if ec was removed from some or if that was mostly talk at the time)
How can we reproduce the issue?
Relevant log output
Operating System
N/A
Selenium version
4.7.2
What are the browser(s) and version(s) where you see this issue?
Not Applicable.
What are the browser driver(s) and version(s) where you see this issue?
Not Applicable.
Are you using Selenium Grid?
Not Applicable.