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