UNPKG

wdio-wait-for

Version:

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

19 lines (18 loc) 639 B
import { getElement } from '../utils/index.js'; /** * A condition for checking an element is visible and clickable * * @example * browser.waitUntil(elementToBeClickable('.links')); * * @param {!string | ChainablePromiseElement<WebdriverIO.Element>} selectorOrElement The selector or element to check * * @returns {!function} An expected condition that returns a promise * representing whether the element is clickable. */ export function elementToBeClickable(selectorOrElement) { return async function () { const element = await getElement(selectorOrElement); return await element.isClickable(); }; }