UNPKG

wdio-wait-for

Version:

a library of conditions that are useful for end-to-end tests

17 lines (16 loc) 488 B
/** * A condition for checking URL of the current page to be a specific url. * * @example * browser.waitUntil(urlIs('https://the-internet.herokuapp.com/')); * * @param {!string} expectedUrl The expected url * @returns {!function} A condition that returns a promise * representing whether browser's url is. */ export function urlIs(expectedUrl) { return async function () { const actualUrl = await this.getUrl(); return actualUrl === expectedUrl; }; }