-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Is your feature request related to a problem?
Version 8.14 introduced automatic web driver configuration. While this is great, it can be an annoyance when using the devtools automation protocol. My tests run in a network environment with limited access to the Internet and they fail because of this. While this can be disabled (#11128), it's counterintuitive to specify a port or a driver binary to disable the download despite it will never be used.
Describe the solution you'd like.
At first glance, it should be as simple as wrapping this:
webdriverio/packages/wdio-cli/src/launcher.ts
Lines 138 to 144 in aa35c29
| /** | |
| * pre-configure necessary driver for worker threads | |
| */ | |
| await Promise.all([ | |
| setupDriver(config, caps), | |
| setupBrowser(config, caps) | |
| ]) |
with an if statement as follows:
if (config.automationProtocol !== 'webdriver') {
await Promise.all([
setupDriver(config, caps),
setupBrowser(config, caps)
])
}However, this wouldn't work with configurations where multiple automation protocols are used, for example:
export const config: WebdriverIO.Config = {
beforeSession(config, capabilities) {
if (capabilities.browserName === 'chrome') {
config.automationProtocol = 'devtools'
} else {
config.automationProtocol = 'webdriver'
}
}
// ...
}Thus, in order for this to work, the setup*() method invocations must be moved after the onWorkerStart and before the actual runner is started (e.g. line 437 below):
webdriverio/packages/wdio-cli/src/launcher.ts
Lines 431 to 439 in aa35c29
| // run worker hook to allow modify runtime and capabilities of a specific worker | |
| log.info('Run onWorkerStart hook') | |
| await runLauncherHook(config.onWorkerStart, runnerId, caps, specs, this._args, execArgv) | |
| .catch((error) => this._workerHookError(error)) | |
| await runServiceHook(this._launcher!, 'onWorkerStart', runnerId, caps, specs, this._args, execArgv) | |
| .catch((error) => this._workerHookError(error)) | |
| // prefer launcher settings in capabilities over general launcher | |
| const worker = await this.runner.run({ |
Describe alternatives you've considered.
No response
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct