|
|
@ -1,4 +1,5 @@ |
|
|
|
var path = require('path') |
|
|
|
var spawn = require('cross-spawn') |
|
|
|
var httpServer = require('http-server') |
|
|
|
var server = httpServer.createServer({ |
|
|
|
root: path.resolve(__dirname, '../../') |
|
|
@ -6,14 +7,16 @@ var server = httpServer.createServer({ |
|
|
|
|
|
|
|
server.listen(8080) |
|
|
|
|
|
|
|
var spawn = require('cross-spawn') |
|
|
|
var args = [ |
|
|
|
'--config', 'build/nightwatch.config.js', |
|
|
|
'--env', 'chrome,firefox' |
|
|
|
] |
|
|
|
|
|
|
|
if (process.argv[2]) { |
|
|
|
args.push('--test', 'test/e2e/specs/' + process.argv[2]) |
|
|
|
var args = process.argv.slice(2) |
|
|
|
if (args.indexOf('--config') === -1) { |
|
|
|
args = args.concat(['--config', 'build/nightwatch.config.js']) |
|
|
|
} |
|
|
|
if (args.indexOf('--env') === -1) { |
|
|
|
args = args.concat(['--env', 'chrome,firefox']) |
|
|
|
} |
|
|
|
var i = args.indexOf('--test') |
|
|
|
if (i > -1) { |
|
|
|
args[i + 1] = 'test/e2e/specs/' + args[i + 1] |
|
|
|
} |
|
|
|
|
|
|
|
var runner = spawn('./node_modules/.bin/nightwatch', args, { |
|
|
|