* Switch focus to a particular tab by its number. It waits tabs loading and then switch tab * * ```js * I.switchToNextTab(); * I.switchToNextTab(2); * ``` * * @param {number} [num=1]
(num = 1)
| 1097 | * @param {number} [num=1] |
| 1098 | */ |
| 1099 | async switchToNextTab(num = 1) { |
| 1100 | const pages = await this.browser.pages() |
| 1101 | const index = pages.indexOf(this.page) |
| 1102 | this.withinLocator = null |
| 1103 | const page = pages[index + num] |
| 1104 | |
| 1105 | if (!page) { |
| 1106 | throw new Error(`There is no ability to switch to next tab with offset ${num}`) |
| 1107 | } |
| 1108 | |
| 1109 | await this._setPage(page) |
| 1110 | return this._waitForAction() |
| 1111 | } |
| 1112 | |
| 1113 | /** |
| 1114 | * Switch focus to a particular tab by its number. It waits tabs loading and then switch tab |
no test coverage detected