wdio-wait-for
Version:
a library of conditions that are useful for end-to-end tests
17 lines (16 loc) • 511 B
JavaScript
/**
* A condition for checking that the title contains a case-sensitive substring
*
* @example
* browser.waitUntil(titleContains('Dashboard'));
*
* @param {!string} expectedTitle The expected title
* @returns {!function} A condition that returns a promise
* representing whether browser's title contains.
*/
export function titleContains(expectedTitle) {
return async function () {
const actualTitle = await this.getTitle();
return actualTitle.includes(expectedTitle);
};
}