* Close all tabs except for the current one. * * ```js * I.closeOtherTabs(); * ```
()
| 1155 | * ``` |
| 1156 | */ |
| 1157 | async closeOtherTabs() { |
| 1158 | const pages = await this.browser.pages() |
| 1159 | const otherPages = pages.filter(page => page !== this.page) |
| 1160 | |
| 1161 | let p = Promise.resolve() |
| 1162 | otherPages.forEach(page => { |
| 1163 | p = p.then(() => page.close()) |
| 1164 | }) |
| 1165 | await p |
| 1166 | return this._waitForAction() |
| 1167 | } |
| 1168 | |
| 1169 | /** |
| 1170 | * Open new tab and switch to it |
no test coverage detected