* {{> closeOtherTabs }}
()
| 2433 | * {{> closeOtherTabs }} |
| 2434 | */ |
| 2435 | async closeOtherTabs() { |
| 2436 | const handles = await this.browser.getWindowHandles() |
| 2437 | const currentHandle = await this.browser.getWindowHandle() |
| 2438 | const otherHandles = handles.filter(handle => handle !== currentHandle) |
| 2439 | |
| 2440 | await forEachAsync(otherHandles, async handle => { |
| 2441 | await this.browser.switchToWindow(handle) |
| 2442 | await this.browser.closeWindow() |
| 2443 | }) |
| 2444 | await this.browser.switchToWindow(currentHandle) |
| 2445 | } |
| 2446 | |
| 2447 | /** |
| 2448 | * {{> wait }} |
no test coverage detected