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

Method waitForFunction

lib/helper/Playwright.js:3684–3696  ·  view source on GitHub ↗

* {{> waitForFunction }}

(fn, argsOrSec = null, sec = null)

Source from the content-addressed store, hash-verified

3682 * {{> waitForFunction }}
3683 */
3684 async waitForFunction(fn, argsOrSec = null, sec = null) {
3685 let args = []
3686 if (argsOrSec) {
3687 if (Array.isArray(argsOrSec)) {
3688 args = argsOrSec
3689 } else if (typeof argsOrSec === 'number') {
3690 sec = argsOrSec
3691 }
3692 }
3693 const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout
3694 const context = await this._getContext()
3695 return context.waitForFunction(fn, args, { timeout: waitTimeout })
3696 }
3697
3698 /**
3699 * Waits for navigation to finish. By default, it takes configured `waitForNavigation` option.

Callers 8

waitForEnabledMethod · 0.45
waitForDisabledMethod · 0.45
waitForValueMethod · 0.45
waitInUrlMethod · 0.45
waitCurrentPathEqualsMethod · 0.45
waitForTextMethod · 0.45
waitForDetachedMethod · 0.45

Calls 1

_getContextMethod · 0.95

Tested by

no test coverage detected