MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / openNewTab

Method openNewTab

lib/helper/Playwright.js:1947–1955  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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 }}

Callers

nothing calls this directly

Calls 2

_setPageMethod · 0.95
_waitForActionMethod · 0.95

Tested by

no test coverage detected