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

Function urlContains

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

* Creates a condition that will wait for the current page's url to contain * the given substring. * * @param {string} substrUrl The substring that should be present in the current * URL. * @return {!Condition } The new condition.

(substrUrl)

Source from the content-addressed store, hash-verified

196 * @return {!Condition<boolean>} The new condition.
197 */
198function urlContains(substrUrl) {
199 return new Condition('for URL to contain ' + JSON.stringify(substrUrl), function (driver) {
200 return driver.getCurrentUrl().then(function (url) {
201 return url && url.includes(substrUrl)
202 })
203 })
204}
205
206/**
207 * Creates a condition that will wait for the current page's url to match the

Callers

nothing calls this directly

Calls 1

getCurrentUrlMethod · 0.65

Tested by

no test coverage detected