* Open new tab and automatically switched to new tab * * ```js * I.openNewTab(); * ``` * * You can pass in [page options](https://github.com/microsoft/playwright/blob/main/docs/api.md#browsernewpageoptions) to emulate device on this page * * ```js * // enable mobile * I
(options)
| 1945 | * ``` |
| 1946 | */ |
| 1947 | async openNewTab(options) { |
| 1948 | if (this.isElectron) { |
| 1949 | throw new Error('Cannot open new tabs inside an Electron container') |
| 1950 | } |
| 1951 | const page = await this.browserContext.newPage(options) |
| 1952 | await targetCreatedHandler.call(this, page) |
| 1953 | await this._setPage(page) |
| 1954 | return this._waitForAction() |
| 1955 | } |
| 1956 | |
| 1957 | /** |
| 1958 | * {{> grabNumberOfOpenTabs }} |
nothing calls this directly
no test coverage detected