From 6a1c91848858453d0af712588b51c0bdaa0c9445 Mon Sep 17 00:00:00 2001 From: Jeff Cross Date: Mon, 18 Nov 2013 16:53:49 -0800 Subject: [PATCH] feat(runner): add error message for bad jar path Closes #259. If a bad path was provided in the protractor configuration, the runner would fail with an ambiguous error. This fix checks that a file exists at the provided path, and throws an error if not, suggesting that perhaps the version is wrong in the configuration. --- lib/runner.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/runner.js b/lib/runner.js index 1201ac40c..7cdaaa702 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -137,6 +137,12 @@ var setUpSelenium = function() { config.seleniumArgs.push( '-Dwebdriver.chrome.driver=' + config.chromeDriver); } + + if (config.seleniumServerJar && !fs.existsSync(config.seleniumServerJar)) { + throw new Error('there\'s no selenium server jar at the specified location.'+ + 'Do you have the correct version?'); + } + server = new remote.SeleniumServer(config.seleniumServerJar, { args: config.seleniumArgs, port: config.seleniumPort