diff --git a/conf.js b/conf.js index 3b15bc474..83bf8fd81 100644 --- a/conf.js +++ b/conf.js @@ -33,11 +33,7 @@ exports.config = { // Spec patterns are relative to the current working directly when // protractor is called. specs: [ - 'spec/findelements_spec.js', - 'spec/lib_spec.js', - 'spec/mockmodule_spec.js', - 'spec/synchronize_spec.js', - 'spec/testapp_spec.js' + 'spec/*_spec.js', ], // ----- Capabilities to be passed to the webdriver instance. diff --git a/lib/cli.js b/lib/cli.js index 679fd6b35..b689ce653 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -6,6 +6,7 @@ var remote = require('selenium-webdriver/remote'); var minijn = require('minijasminenode'); var protractor = require('./protractor.js'); var SauceLabs = require('saucelabs'); +var glob = require('glob'); var args = process.argv.slice(2); @@ -69,13 +70,21 @@ var run = function() { // 'specs/*.js' // Probably want to use 'glob' for this, but consider the extra dependency. var specs = config.specs; + var resolvedSpecs = []; for (var i = 0; i < specs.length; ++i) { - specs[i] = path.resolve(process.cwd(), specs[i]); - if (!fs.existsSync(specs[i])) { - throw new Error('Test file ' + specs[i] + ' not found.'); + var matches = glob.sync(specs[i]); + if (!matches.length) { + throw new Error('Test file ' + specs[i] + ' did not match any files.'); } + for (var j = 0; j < matches.length; ++j) { + resolvedSpecs.push(matches[j]); + } + // specs[i] = path.resolve(process.cwd(), specs[i]); + // if (!fs.existsSync(specs[i])) { + // throw new Error('Test file ' + specs[i] + ' not found.'); + // } } - minijn.addSpecs(specs); + minijn.addSpecs(resolvedSpecs); if (config.sauceUser && config.sauceKey) { config.capabilities.username = config.sauceUser; diff --git a/package.json b/package.json index 172cf2bb1..10064dff5 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "selenium-webdriver": ">2.32.1", "minijasminenode": "~0.2.0", "saucelabs": "~0.1.0", + "glob": ">=3.1.14", "adm-zip": ">=0.4.2" }, "devDependencies": { @@ -32,5 +33,5 @@ "scripts": { "test": "node lib/cli.js conf.js" }, - "version": "0.6.1" + "version": "0.6.2" }