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

Method waitForClickable

lib/helper/Puppeteer.js:2383–2396  ·  view source on GitHub ↗

* {{> waitForClickable }}

(locator, waitTimeout)

Source from the content-addressed store, hash-verified

2381 * {{> waitForClickable }}
2382 */
2383 async waitForClickable(locator, waitTimeout) {
2384 const el = await this._locateElement(locator)
2385 if (!el) {
2386 throw new ElementNotFound(locator, 'Element to wait for clickable')
2387 }
2388
2389 return this.waitForFunction(isElementClickable, [el], waitTimeout).catch(async e => {
2390 if (/Waiting failed/i.test(e.message) || /failed: timeout/i.test(e.message)) {
2391 throw new Error(`element ${new Locator(locator).toString()} still not clickable after ${waitTimeout || this.options.waitForTimeout / 1000} sec`)
2392 } else {
2393 throw e
2394 }
2395 })
2396 }
2397
2398 /**
2399 * {{> waitForElement }}

Calls 3

_locateElementMethod · 0.95
waitForFunctionMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected