(config)
| 332 | */ |
| 333 | class Playwright extends Helper { |
| 334 | constructor(config) { |
| 335 | super(config) |
| 336 | |
| 337 | // playwright will be loaded dynamically in _init method |
| 338 | |
| 339 | // set defaults |
| 340 | this.isRemoteBrowser = false |
| 341 | this.isRunning = false |
| 342 | this.isAuthenticated = false |
| 343 | this.sessionPages = {} |
| 344 | this.activeSessionName = '' |
| 345 | this.isElectron = false |
| 346 | this.isCDPConnection = false |
| 347 | this.electronSessions = [] |
| 348 | this.storageState = null |
| 349 | |
| 350 | // for network stuff |
| 351 | this.requests = [] |
| 352 | this.recording = false |
| 353 | this.recordedAtLeastOnce = false |
| 354 | |
| 355 | // for websocket messages |
| 356 | this.webSocketMessages = [] |
| 357 | this.recordingWebSocketMessages = false |
| 358 | this.recordedWebSocketMessagesAtLeastOnce = false |
| 359 | this.cdpSession = null |
| 360 | |
| 361 | // Add test failure tracking to prevent false positives |
| 362 | this.testFailures = [] |
| 363 | this.hasCleanupError = false |
| 364 | |
| 365 | // override defaults with config |
| 366 | this._setConfig(config) |
| 367 | |
| 368 | // pass storageState directly (string path or object) and let Playwright handle errors/missing file |
| 369 | if (typeof config.storageState !== 'undefined') { |
| 370 | this.storageState = config.storageState |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | _validateConfig(config) { |
| 375 | const defaults = { |
nothing calls this directly
no test coverage detected