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

Method constructor

lib/helper/WebDriver.js:459–488  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

457 */
458class WebDriver extends Helper {
459 constructor(config) {
460 super(config)
461 // webdriverio will be loaded dynamically in _init method
462
463 // set defaults
464 this.root = webRoot
465 this.isWeb = true
466 this.isRunning = false
467 this.sessionWindows = {}
468 this.activeSessionName = ''
469 this.customLocatorStrategies = config.customLocatorStrategies
470
471 // for network stuff
472 this.requests = []
473 this.recording = false
474 this.recordedAtLeastOnce = false
475
476 this._setConfig(config)
477
478 Locator.addFilter((locator, result) => {
479 if (typeof locator === 'string' && locator.indexOf('~') === 0) {
480 // accessibility locator
481 if (this.isWeb) {
482 result.value = `[aria-label="${locator.slice(1)}"]`
483 result.type = 'css'
484 result.output = `aria-label=${locator.slice(1)}`
485 }
486 }
487 })
488 }
489
490 _validateConfig(config) {
491 const defaults = {

Callers

nothing calls this directly

Calls 1

_setConfigMethod · 0.45

Tested by

no test coverage detected