MCPcopy
hub / github.com/codeceptjs/CodeceptJS / _createContextPage

Method _createContextPage

lib/helper/Playwright.js:1213–1222  ·  view source on GitHub ↗

* Create a new browser context with a page. \ * Usually it should be run from a custom helper after call of `_startBrowser()` * @param {object} [contextOptions] See https://playwright.dev/docs/api/class-browser#browser-new-context

(contextOptions)

Source from the content-addressed store, hash-verified

1211 * @param {object} [contextOptions] See https://playwright.dev/docs/api/class-browser#browser-new-context
1212 */
1213 async _createContextPage(contextOptions) {
1214 if (!this.browser) {
1215 throw new Error('Browser not started. Call _startBrowser() first or disable manualStart option.')
1216 }
1217 this.browserContext = await this.browser.newContext(contextOptions)
1218
1219 const page = await this.browserContext.newPage()
1220 targetCreatedHandler.call(this, page)
1221 await this._setPage(page)
1222 }
1223
1224 _getType() {
1225 return this.browser._type

Callers 1

Calls 1

_setPageMethod · 0.95

Tested by

no test coverage detected