Skip to content

Commit

Permalink
KEYCLOAK-13804 Require chromedriver only if it is not provided by env…
Browse files Browse the repository at this point in the history
…ironment
  • Loading branch information
mhajas authored and Bruno Oliveira da Silva committed Jul 27, 2020
1 parent c6dd008 commit bc86541
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/utils/webdriver.js
Expand Up @@ -18,7 +18,6 @@
* An utility with the specifics for selenium
*/
const chrome = require('selenium-webdriver/chrome');
const chromedriver = require('chromedriver');
const webdriver = require('selenium-webdriver');
const args = require('minimist')(process.argv.slice(2));
const By = webdriver.By;
Expand Down Expand Up @@ -54,7 +53,13 @@ function createDriver () {
}

function determineChromedriverPath () {
let path = args.chromedriverPath || (process.env.CHROMEDRIVER_PATH || chromedriver.path);
let path = args.chromedriverPath || process.env.CHROMEDRIVER_PATH;

if (!path) {
const chromedriver = require('chromedriver');
path = chromedriver.path;
}

console.log('Using chromedriver from path: ' + path);
return path;
}
Expand Down

0 comments on commit bc86541

Please sign in to comment.