From 4b053ebe587d51562d77ca512848be28195ae0cc Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Mon, 20 Jan 2014 18:45:10 -0800 Subject: [PATCH] fix(runner): only run selenium with spec files Only setup Selenium if there are actual spec files passed in --- lib/runner.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/runner.js b/lib/runner.js index 1a640ae37..5512a2508 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -219,9 +219,6 @@ var runTests = function() { 'since Protractor 0.6.0. Please switch to config.specs.'); } var specs = config.specs; - if (!specs || specs.length == 0) { - throw new Error('No spec files found.'); - } var resolvedSpecs = []; for (var i = 0; i < specs.length; ++i) { var matches = glob.sync(specs[i], {cwd: config.configDir}); @@ -361,6 +358,12 @@ var runTests = function() { * Run Protractor once. */ var runOnce = function() { + var specs = config.specs; + if (!specs || specs.length === 0) { + util.puts('No spec files found'); + process.exit(0); + } + return setUpSelenium().then(function() { // cleanUp must be registered directly onto runTests, not onto // the chained promise, so that cleanUp is still called in case of a