(config)
| 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 [ |
no test coverage detected