MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / urlContains

Function urlContains

javascript/selenium-webdriver/lib/until.js:200–206  ·  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

198 * @return {!Condition<boolean>} The new condition.
199 */
200function urlContains(substrUrl) {
201 return new Condition('for URL to contain ' + JSON.stringify(substrUrl), function (driver) {
202 return driver.getCurrentUrl().then(function (url) {
203 return url && url.includes(substrUrl)
204 })
205 })
206}
207
208/**
209 * 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