MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / urlMatches

Function urlMatches

javascript/selenium-webdriver/lib/until.js:213–219  ·  view source on GitHub ↗

* Creates a condition that will wait for the current page's url to match the * given regular expression. * * @param {!RegExp} regex The regular expression to test against. * @return {!Condition } The new condition.

(regex)

Source from the content-addressed store, hash-verified

211 * @return {!Condition<boolean>} The new condition.
212 */
213function urlMatches(regex) {
214 return new Condition('for URL to match ' + regex, function (driver) {
215 return driver.getCurrentUrl().then(function (url) {
216 return regex.test(url)
217 })
218 })
219}
220
221/**
222 * Creates a condition that will loop until an element is

Callers

nothing calls this directly

Calls 2

getCurrentUrlMethod · 0.65
testMethod · 0.45

Tested by

no test coverage detected