Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Chromedriver service uses port & path from config
Browse files Browse the repository at this point in the history
This change makes it so the chromedriver service uses the port and path defined in `wdio.conf.js` rather than the other way round. This makes it easier to install and use the service, without having to worry about configuring special configuration specifically for chromedriver.path defined.

For example, when installing the chromedriver service via the `wdio config` wizard, it is not clear that you have to update the path and port in order to make it work. With this change, it would always work regardless of how port and path are defined.
  • Loading branch information
aberonni committed Oct 28, 2018
1 parent e28d3ea commit f077c70
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ class ChromeDriverLauncher {
this.chromeDriverLogs = config.chromeDriverLogs
this.logToStdout = config.logToStdout

if (!this.chromeDriverArgs.find(arg => arg.startsWith('--port'))) {
this.chromeDriverArgs.push(`--port=${config.port}`);
}

if (!this.chromeDriverArgs.find(arg => arg.startsWith('--url-base'))) {
this.chromeDriverArgs.push(`--url-base=${config.path}`);
}

return new Promise((resolve, reject) => {
this.process = childProcess.execFile(binPath, this.chromeDriverArgs, (err, stdout, stderr) => {
if (err) {
Expand Down

0 comments on commit f077c70

Please sign in to comment.