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

Method waitForElement

lib/helper/WebDriver.js:2484–2497  ·  view source on GitHub ↗

* {{> waitForElement }}

(locator, sec = null)

Source from the content-addressed store, hash-verified

2482 * {{> waitForElement }}
2483 */
2484 async waitForElement(locator, sec = null) {
2485 const aSec = sec || this.options.waitForTimeoutInSeconds
2486
2487 return this.browser.waitUntil(
2488 async () => {
2489 const res = await this._res(locator)
2490 return res && res.length
2491 },
2492 {
2493 timeout: aSec * 1000,
2494 timeoutMsg: `element (${new Locator(locator)}) still not present on page after ${aSec} sec`,
2495 },
2496 )
2497 }
2498
2499 /**
2500 * {{> waitForClickable }}

Callers

nothing calls this directly

Calls 1

_resMethod · 0.95

Tested by

no test coverage detected