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

Commit f533341

Browse files
runksjelin
authored andcommitted
bug(driverProvider): fix driver path generation for *nix platforms
Makes error messages better
1 parent 3f622bc commit f533341

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Protractor [![Build Status](https://travis-ci.org/angular/protractor.png?branch=master)](https://travis-ci.org/angular/protractor) [![Join the chat at https://gitter.im/angular/protractor](https://badges.gitter.im/angular/protractor.svg)](https://gitter.im/angular/protractor)
22
==========
33

4-
[Protractor](http://angular.github.io/protractor) is an end-to-end test framework for [AngularJS](http://angularjs.org/) applications. Protractor is a [Node.js](http://nodejs.org/) program built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs). Protractor runs tests against your application running in a real browser, interacting with it as a user would.
4+
[Protractor](http://angular.github.io/protractor) is an end-to-end test framework for [AngularJS](http://angularjs.org/) applications. Protractor is a [Node.js](http://nodejs.org/) program built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs). Protractor runs tests against your application running in a real browser, interacting with it as a user would.
55

66
Compatibility
77
-------------
@@ -40,6 +40,7 @@ Clone the github repository:
4040
git clone https://github.com/angular/protractor.git
4141
cd protractor
4242
npm install
43+
./bin/webdriver-manager update
4344
cd website
4445
npm install
4546
cd ..

lib/driverProviders/direct.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ DirectDriverProvider.prototype.getNewDriver = function() {
5151
var driver;
5252
switch (this.config_.capabilities.browserName) {
5353
case 'chrome':
54-
var chromeDriverFile = this.config_.chromeDriver ||
55-
path.resolve(__dirname, '../../selenium/chromedriver');
54+
var defaultChromeDriverPath = path.resolve(__dirname, '../../selenium/chromedriver');
55+
56+
if (process.platform.indexOf('win') === 0) {
57+
defaultChromeDriverPath += '.exe';
58+
}
59+
60+
var chromeDriverFile = this.config_.chromeDriver || defaultChromeDriverPath;
5661

57-
// Check if file exists, if not try .exe or fail accordingly
5862
if (!fs.existsSync(chromeDriverFile)) {
59-
chromeDriverFile += '.exe';
60-
// Throw error if the client specified conf chromedriver and its not found
61-
if (!fs.existsSync(chromeDriverFile)) {
62-
throw new Error('Could not find chromedriver at ' +
63-
chromeDriverFile);
64-
}
63+
throw new Error('Could not find chromedriver at ' + chromeDriverFile);
6564
}
6665

6766
var service = new chrome.ServiceBuilder(chromeDriverFile).build();

0 commit comments

Comments
 (0)