This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258609 - netbeans-configuration.js messes up chrome driver location, cannot run protractor chrome tests
Summary: netbeans-configuration.js messes up chrome driver location, cannot run protra...
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Testing (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-01 05:35 UTC by chrisl08
Modified: 2016-04-01 05:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (169.61 KB, text/plain)
2016-04-01 05:35 UTC, chrisl08
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chrisl08 2016-04-01 05:35:22 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.25-b02

Reproducibility: Happens every time

STEPS:
1. Create protractor test configuration file and specify chrome driver location using enviromental variable, ie: 
chromeDriver: process.env.USERPROFILE + '/AppData/Roaming/npm/node_modules/protractor/selenium/chromedriver.exe'

The chrome driver **IS** at the specified location above.  The enviroment variable in the path is used so all members of team can run the tests regardless of where they checked out the project

2. Right click and select menu "Run Selenium Tests".  
You will get error : 
C:\Users\xxx\java\projects\ProtractorTestsProject\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108
  var template = new Error(this.message);
                 ^
UnknownError: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
    at new bot.Error (C:\Users\xxx\java\projects\Poleodomia\javaApplications\ProtractorTests\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
    at Object.bot.response.checkResponse (C:\Users\xxx\java\projects\Poleodomia\javaApplications\ProtractorTests\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
    at C:\Users\xxx\java\projects\Poleodomia\javaApplications\ProtractorTests\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:160:24
    at [object Object].promise.ControlFlow.runInFrame_ (C:/Users/xxx/java/projects/Poleodomia/javaApplications/ProtractorTests/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1857:20)
    at [object Object].goog.defineClass.notify (C:/Users/xxx/java/projects/Poleodomia/javaApplications/ProtractorTests/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2448:25)
    at [object Object].promise.Promise.notify_ (C:/Users/xxx/java/projects/Poleodomia/javaApplications/ProtractorTests/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:564:12)
 

I managed to track the error in the netbeans-configuration.js , line that says :

if(USER_CONFIG.chromeDriver) {
    CHROME_DRIVER = path.join(path.dirname(USER_CONFIG_FILE), USER_CONFIG.chromeDriver);
}

I wonder why this logic is in the file, since it completely renders the USER_CONFIG.chromeDriver useless unless the user happens to specify a chrome driver in a path relative to the USER_CONFIG_FILE path.
I believe that the USER_CONFIG.chromeDriver should be left alone.

Note that a console log inside netbeans-configuration.js verifies that before the  path.join call, USER_CONFIG.chromeDriver has the correct value from user config file.
Comment 1 chrisl08 2016-04-01 05:35:31 UTC
Created attachment 159082 [details]
IDE log