Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Nightwatch.cli(argv => {
adaptArgv(argv)
Nightwatch.CliRunner(argv)
.setup(null, () => {
// NOTE: I don't know when this is running or if it does
// Code to stop browserstack local after end of parallel test
bsLocal.stop(() => {
server && server.close()
process.exit(0)
})
})
.runTests()
.then(() => {
// Code to stop browserstack local after end of single test
bsLocal.stop(() => {
server && server.close()
process.exit(0)
})
})
Nightwatch.cli(function(argv) {
Nightwatch.CliRunner(argv)
.setup(null, function() {
// Code to stop browserstack local after end of parallel test
bs_local.stop(function() {})
})
.runTests(function() {
// Code to stop browserstack local after end of single test
bs_local.stop(function() {})
})
})
}
Nightwatch.cli(argv => {
console.log('run tests');
Nightwatch.CliRunner(argv)
// Code to stop browserstack local after end of parallel test
.setup(null, () => {
local.stop(() => {
server.close()
process.exit(0);
});
})
.runTests(() => {
// Code to stop browserstack local after end of single test
local.stop(() => {
server.close()
process.exit(0);
});
});
});
Nightwatch.cli(function(argv) {
Nightwatch.CliRunner(argv)
.setup(null, function(){
// Code to stop browserstack local after end of parallel test
bs_local.stop(function(){});
})
.runTests(function(){
// Code to stop browserstack local after end of single test
bs_local.stop(function(){});
});
});
});
function createRunner(options: IOptions) {
if (!runner) {
runnerOptions = {
env: (options && options.env) || getDefaultEnvironment(),
configFile: (options && options.configFile) || getDefaultConfigFile(),
silent: (options && options.silent) || false
};
runner = CliRunner({ env: runnerOptions.env, config: runnerOptions.configFile });
runner.isWebDriverManaged = function() {
if (this.baseSettings.selenium) {
this.baseSettings.selenium.start_process = true;
}
return true;
};
runner.setup();
}
return runner;
}
function getConfig(env) {
const jsonConfigFile = './nightwatch.json'
const jsConfigFie = path.resolve('./nightwatch.conf.js');
const configFile = fs.existsSync(jsConfigFie) ? jsConfigFie : jsonConfigFile;
const runner = CliRunner({ config: configFile, env });
runner.setup();
return runner.settings;
}
Nightwatch.cli(args => {
args.config = "test/config/nightwatch.local.js";
Nightwatch.CliRunner(args)
.setup(null, done)
.runTests(null, done);
});
});