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

Method _setConfig

lib/helper/Playwright.js:426–456  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

424 }
425
426 _setConfig(config) {
427 this.options = this._validateConfig(config)
428 setRestartStrategy(this.options)
429 this.playwrightOptions = {
430 headless: !this.options.show,
431 ...this._getOptionsForBrowser(config),
432 }
433
434 if (this.options.channel && this.options.browser === 'chromium') {
435 this.playwrightOptions.channel = this.options.channel
436 }
437
438 if (this.options.video) {
439 // set the video resolution with window size
440 let size = parseWindowSize(this.options.windowSize)
441
442 // if the video resolution is passed, set the record resoultion with that resolution
443 if (this.options.recordVideo && this.options.recordVideo.size) {
444 size = parseWindowSize(this.options.recordVideo.size)
445 }
446 this.options.recordVideo = { size }
447 }
448 if (this.options.recordVideo && !this.options.recordVideo.dir) {
449 this.options.recordVideo.dir = `${store.outputDir}/videos/`
450 }
451 this.isRemoteBrowser = !!this.playwrightOptions.browserWSEndpoint
452 this.isElectron = this.options.browser === 'electron'
453 this.userDataDir = this.playwrightOptions.userDataDir ? `${this.playwrightOptions.userDataDir}_${Date.now().toString()}` : undefined
454 this.isCDPConnection = this.playwrightOptions.cdpConnection
455 popupStore.defaultAction = this.options.defaultPopupAction
456 }
457
458 static _config() {
459 return [

Callers 1

constructorMethod · 0.95

Calls 5

_validateConfigMethod · 0.95
_getOptionsForBrowserMethod · 0.95
setRestartStrategyFunction · 0.90
parseWindowSizeFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected