* {{> waitForElement }} *
(locator, sec)
| 3285 | * |
| 3286 | */ |
| 3287 | async waitForElement(locator, sec) { |
| 3288 | const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout |
| 3289 | locator = new Locator(locator, 'css') |
| 3290 | |
| 3291 | const context = await this._getContext() |
| 3292 | try { |
| 3293 | await context.locator(buildLocatorString(locator)).first().waitFor({ timeout: waitTimeout, state: 'attached' }) |
| 3294 | } catch (e) { |
| 3295 | throw new Error(`element (${locator.toString()}) still not present on page after ${waitTimeout / 1000} sec\n${e.message}`) |
| 3296 | } |
| 3297 | } |
| 3298 | |
| 3299 | /** |
| 3300 | * {{> waitForVisible }} |
nothing calls this directly
no test coverage detected