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

Commit

Permalink
fix(runner): only run selenium with spec files
Browse files Browse the repository at this point in the history
Only setup Selenium if there are actual spec files passed in
  • Loading branch information
eddiemonge authored and juliemr committed Jan 22, 2014
1 parent 154ecf7 commit 4b053eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4b053eb

Please sign in to comment.