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

Commit f3be172

Browse files
committed
fix(runner): running with chromeOnly should try to find chromedriver with .exe extension
Closes #283
1 parent 6676254 commit f3be172

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

example/chromeOnlyConf.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// An example configuration file.
2+
exports.config = {
3+
// Do not start a Selenium Standalone sever - only run this using chrome.
4+
chromeOnly: true,
5+
chromeDriver: './selenium/chromedriver',
6+
7+
// Capabilities to be passed to the webdriver instance.
8+
capabilities: {
9+
'browserName': 'chrome'
10+
},
11+
12+
// Spec patterns are relative to the current working directly when
13+
// protractor is called.
14+
specs: ['example_spec.js'],
15+
16+
// Options to be passed to Jasmine-node.
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000
20+
}
21+
};

lib/runner.js

+7
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ var runJasmineTests = function() {
201201
var runDeferred = webdriver.promise.defer();
202202

203203
if (config.chromeOnly) {
204+
if (!fs.existsSync(config.chromeDriver)) {
205+
if (fs.existsSync(config.chromeDriver + '.exe')) {
206+
config.chromeDriver += '.exe';
207+
} else {
208+
throw 'Could not find chromedriver at ' + config.chromeDriver;
209+
}
210+
}
204211
var service = new chrome.ServiceBuilder(config.chromeDriver).build();
205212
driver = chrome.createDriver(
206213
new webdriver.Capabilities(config.capabilities), service);

0 commit comments

Comments
 (0)