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

Method waitForFunction

lib/helper/Puppeteer.js:2702–2714  ·  view source on GitHub ↗

* {{> waitForFunction }}

(fn, argsOrSec = null, sec = null)

Source from the content-addressed store, hash-verified

2700 * {{> waitForFunction }}
2701 */
2702 async waitForFunction(fn, argsOrSec = null, sec = null) {
2703 let args = []
2704 if (argsOrSec) {
2705 if (Array.isArray(argsOrSec)) {
2706 args = argsOrSec
2707 } else if (typeof argsOrSec === 'number') {
2708 sec = argsOrSec
2709 }
2710 }
2711 const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
2712 const context = await this._getContext()
2713 return context.waitForFunction(fn, { timeout: waitTimeout }, ...args)
2714 }
2715
2716 /**
2717 * Waits for navigation to finish. By default, takes configured `waitForNavigation` option.

Callers 15

waitForClickableMethod · 0.95
waitForEnabledMethod · 0.45
waitForValueMethod · 0.45
waitInUrlMethod · 0.45
waitUrlEqualsMethod · 0.45
waitCurrentPathEqualsMethod · 0.45
waitForTextMethod · 0.45
waitForDetachedMethod · 0.45
Playwright_test.jsFile · 0.45
WebDriver_test.jsFile · 0.45
Puppeteer_test.jsFile · 0.45

Calls 1

_getContextMethod · 0.95

Tested by

no test coverage detected