UNPKG

wdio-wait-for

Version:

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

17 lines (16 loc) 468 B
/** * A condition for checking the title of a page * * @example * browser.waitUntil(titleIs('Dashboard - Main page')); * * @param {!string} expectedTitle The expected title * @returns {!function} A condition that returns a promise * representing whether browser's title is. */ export function titleIs(expectedTitle) { return async function () { const actualTitle = await this.getTitle(); return actualTitle === expectedTitle; }; }