MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / waitToHide

Method waitToHide

lib/helper/Puppeteer.js:2459–2472  ·  view source on GitHub ↗

* {{> waitToHide }}

(locator, sec)

Source from the content-addressed store, hash-verified

2457 * {{> waitToHide }}
2458 */
2459 async waitToHide(locator, sec) {
2460 const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
2461 locator = new Locator(locator, 'css')
2462 let waiter
2463 const context = await this._getContext()
2464 if (locator.isCSS()) {
2465 waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, hidden: true })
2466 } else {
2467 waiter = _waitForElement.call(this, locator, { timeout: waitTimeout, hidden: true })
2468 }
2469 return waiter.catch(err => {
2470 throw new Error(`element (${locator.toString()}) still not hidden after ${waitTimeout / 1000} sec\n${err.message}`)
2471 })
2472 }
2473
2474 /**
2475 * {{> waitForNumberOfTabs }}

Callers 6

Playwright_test.jsFile · 0.45
Puppeteer_test.jsFile · 0.45
testsFunction · 0.45

Calls 4

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

Tested by

no test coverage detected