Skip to content

Commit

Permalink
Added ability to specify webdriver based on env var WEBDRIVER_BROWSER
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Jun 23, 2015
1 parent 81e8d1e commit 1e550c5
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions features/support/world.js
Expand Up @@ -6,11 +6,28 @@ var webdriver = require('selenium-webdriver');

var buildPhantomDriver = function() {
return new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
withCapabilities(webdriver.Capabilities.phantomjs())
.build();
};
var buildChromeDriver = function() {
return new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome())
.build();
};

var driver = buildPhantomDriver();
var driver;
switch(process.env.WEBDRIVER_BROWSER){
case 'chrome':
console.log('using chrome driver');
driver = buildChromeDriver();
break;
case 'phantom':
case 'phantomjs':
default:
console.log('using phantom driver');
driver = buildPhantomDriver();
break;
}

var getDriver = function() {
return driver;
Expand Down

0 comments on commit 1e550c5

Please sign in to comment.