Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(runner): running with chromeOnly should try to find chromedriver …
Browse files Browse the repository at this point in the history
…with .exe extension

Closes #283
  • Loading branch information
juliemr committed Nov 22, 2013
1 parent 6676254 commit f3be172
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions example/chromeOnlyConf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// An example configuration file.
exports.config = {
// Do not start a Selenium Standalone sever - only run this using chrome.
chromeOnly: true,
chromeDriver: './selenium/chromedriver',

// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},

// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['example_spec.js'],

// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
7 changes: 7 additions & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ var runJasmineTests = function() {
var runDeferred = webdriver.promise.defer();

if (config.chromeOnly) {
if (!fs.existsSync(config.chromeDriver)) {
if (fs.existsSync(config.chromeDriver + '.exe')) {
config.chromeDriver += '.exe';
} else {
throw 'Could not find chromedriver at ' + config.chromeDriver;
}
}
var service = new chrome.ServiceBuilder(config.chromeDriver).build();
driver = chrome.createDriver(
new webdriver.Capabilities(config.capabilities), service);
Expand Down

0 comments on commit f3be172

Please sign in to comment.