* {{> waitForFunction }}
(fn, argsOrSec = null, sec = null)
| 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. |
no test coverage detected