(config)
| 457 | */ |
| 458 | class 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 = { |
nothing calls this directly
no test coverage detected