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

Commit

Permalink
bug(driverProvider): fix driver path generation for *nix platforms
Browse files Browse the repository at this point in the history
Makes error messages better
  • Loading branch information
runk authored and sjelin committed Dec 22, 2015
1 parent 3f622bc commit f533341
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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)
==========

[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.
[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.

Compatibility
-------------
Expand Down Expand Up @@ -40,6 +40,7 @@ Clone the github repository:
git clone https://github.com/angular/protractor.git
cd protractor
npm install
./bin/webdriver-manager update
cd website
npm install
cd ..
Expand Down
17 changes: 8 additions & 9 deletions lib/driverProviders/direct.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,16 @@ DirectDriverProvider.prototype.getNewDriver = function() {
var driver;
switch (this.config_.capabilities.browserName) {
case 'chrome':
var chromeDriverFile = this.config_.chromeDriver ||
path.resolve(__dirname, '../../selenium/chromedriver');
var defaultChromeDriverPath = path.resolve(__dirname, '../../selenium/chromedriver');

if (process.platform.indexOf('win') === 0) {
defaultChromeDriverPath += '.exe';
}

var chromeDriverFile = this.config_.chromeDriver || defaultChromeDriverPath;

// Check if file exists, if not try .exe or fail accordingly
if (!fs.existsSync(chromeDriverFile)) {
chromeDriverFile += '.exe';
// Throw error if the client specified conf chromedriver and its not found
if (!fs.existsSync(chromeDriverFile)) {
throw new Error('Could not find chromedriver at ' +
chromeDriverFile);
}
throw new Error('Could not find chromedriver at ' + chromeDriverFile);
}

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

0 comments on commit f533341

Please sign in to comment.