* {{> waitToHide }}
(locator, sec)
| 2457 | * {{> waitToHide }} |
| 2458 | */ |
| 2459 | async waitToHide(locator, sec) { |
| 2460 | const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout |
| 2461 | locator = new Locator(locator, 'css') |
| 2462 | let waiter |
| 2463 | const context = await this._getContext() |
| 2464 | if (locator.isCSS()) { |
| 2465 | waiter = context.waitForSelector(locator.simplify(), { timeout: waitTimeout, hidden: true }) |
| 2466 | } else { |
| 2467 | waiter = _waitForElement.call(this, locator, { timeout: waitTimeout, hidden: true }) |
| 2468 | } |
| 2469 | return waiter.catch(err => { |
| 2470 | throw new Error(`element (${locator.toString()}) still not hidden after ${waitTimeout / 1000} sec\n${err.message}`) |
| 2471 | }) |
| 2472 | } |
| 2473 | |
| 2474 | /** |
| 2475 | * {{> waitForNumberOfTabs }} |
no test coverage detected