* {{> waitForInvisible }}
(locator, sec)
| 2438 | * {{> waitForInvisible }} |
| 2439 | */ |
| 2440 | async waitForInvisible(locator, sec) { |
| 2441 | const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout |
| 2442 | locator = new Locator(locator, 'css') |
| 2443 | await this.context |
| 2444 | let waiter |
| 2445 | const context = await this._getContext() |
| 2446 | if (locator.isCSS()) { |
| 2447 | waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, hidden: true }) |
| 2448 | } else { |
| 2449 | waiter = _waitForElement.call(this, locator, { timeout: waitTimeout, hidden: true }) |
| 2450 | } |
| 2451 | return waiter.catch(err => { |
| 2452 | throw new Error(`element (${locator.toString()}) still visible after ${waitTimeout / 1000} sec\n${err.message}`) |
| 2453 | }) |
| 2454 | } |
| 2455 | |
| 2456 | /** |
| 2457 | * {{> waitToHide }} |
nothing calls this directly
no test coverage detected