Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use dynamic path to selenium server jar #6

Merged
merged 1 commit into from
Apr 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions bin/starrynight.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ var Future = require('fibers/future');
// so we can get the npm install prefix
var npm = require('npm');

// for _.extend()ing the process.env object
var _ = require('underscore');


//==================================================================================================
// FILE LINKING
Expand Down Expand Up @@ -543,12 +546,8 @@ function parseRunTestArguments(npmPrefix){
nightwatchCommand = 'nightwatch';
}

//console.log('Config file location: ' + configFileLocation);

// TODO: can we specify the server path via the command line, so it doesn't need to be in the json file?
// different node versions will break this
// alternatively, can we specify node 0.10.38 in particular?
var nightwatch = childProcess.spawn(nightwatchCommand, ['-c', configFileLocation], function(error, result){
var nightwatchEnv = _.extend(process.env, {npm_config_prefix: npmPrefix});
var nightwatch = childProcess.spawn(nightwatchCommand, ['-c', configFileLocation], {env: nightwatchEnv}, function(error, result){
if(error){
console.log("[StarryNight] ERROR spawning nightwatch: ", error);
//process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion configs/nightwatch/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

"selenium" : {
"start_process" : true,
"server_path" : "/usr/local/lib/node_modules/starrynight/node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-2.45.0.jar",
"server_path" : "${npm_config_prefix}/lib/node_modules/starrynight/node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-2.45.0.jar",
"log_path" : "tests/nightwatch/logs",
"host" : "127.0.0.1",
"port" : 4444,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"request": "2.54.0",
"fibers": "^1.0.2",
"find-files": "^0.0.3",
"replace": "0.3.0"
"replace": "0.3.0",
"underscore": "^1.8.3"
},
"engines": {
"node": ">= 0.4.0"
Expand Down