* {{> waitForInvisible }}
(locator, sec = null)
| 2698 | * {{> waitForInvisible }} |
| 2699 | */ |
| 2700 | async waitForInvisible(locator, sec = null) { |
| 2701 | const aSec = sec || this.options.waitForTimeoutInSeconds |
| 2702 | |
| 2703 | return this.browser.waitUntil( |
| 2704 | async () => { |
| 2705 | const res = await this._res(locator) |
| 2706 | if (!res || res.length === 0) return true |
| 2707 | const selected = await forEachAsync(res, async el => el.isDisplayed()) |
| 2708 | return !selected.length |
| 2709 | }, |
| 2710 | { timeout: aSec * 1000, timeoutMsg: `element (${new Locator(locator)}) still visible after ${aSec} sec` }, |
| 2711 | ) |
| 2712 | } |
| 2713 | |
| 2714 | /** |
| 2715 | * {{> waitToHide }} |
no test coverage detected