MCPcopy
hub / github.com/codeceptjs/CodeceptJS / waitForInvisible

Method waitForInvisible

lib/helper/Puppeteer.js:2440–2454  ·  view source on GitHub ↗

* {{> waitForInvisible }}

(locator, sec)

Source from the content-addressed store, hash-verified

2438 * {{> waitForInvisible }}
2439 */
2440 async waitForInvisible(locator, sec) {
2441 const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
2442 locator = new Locator(locator, 'css')
2443 await this.context
2444 let waiter
2445 const context = await this._getContext()
2446 if (locator.isCSS()) {
2447 waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, hidden: true })
2448 } else {
2449 waiter = _waitForElement.call(this, locator, { timeout: waitTimeout, hidden: true })
2450 }
2451 return waiter.catch(err => {
2452 throw new Error(`element (${locator.toString()}) still visible after ${waitTimeout / 1000} sec\n${err.message}`)
2453 })
2454 }
2455
2456 /**
2457 * {{> waitToHide }}

Callers

nothing calls this directly

Calls 4

_getContextMethod · 0.95
isCSSMethod · 0.80
simplifyMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected