* {{> waitForDetached }}
(locator, sec = null)
| 2722 | * {{> waitForDetached }} |
| 2723 | */ |
| 2724 | async waitForDetached(locator, sec = null) { |
| 2725 | const aSec = sec || this.options.waitForTimeoutInSeconds |
| 2726 | |
| 2727 | return this.browser.waitUntil( |
| 2728 | async () => { |
| 2729 | const res = await this._res(locator) |
| 2730 | if (!res || res.length === 0) { |
| 2731 | return true |
| 2732 | } |
| 2733 | return false |
| 2734 | }, |
| 2735 | { timeout: aSec * 1000, timeoutMsg: `element (${new Locator(locator)}) still on page after ${aSec} sec` }, |
| 2736 | ) |
| 2737 | } |
| 2738 | |
| 2739 | /** |
| 2740 | * {{> waitForFunction }} |