Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const run = async ({cwd}) => {
const server = await createServer({cwd});
const finish = () => new Promise(resolve => server.close(() => process.nextTick(resolve)));
const die = async err => {
console.error(err.message);
console.log(err.stack);
await finish();
process.exit(1);
};
process.on('uncaughtException', die);
process.on('unhandledRejection', die);
const client = nightwatch.initClient({
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
output: true,
detailed_output: true
});
const browser = client.api();
browser
.url(`http://${DOCKER_IP}:${server.port}`)
.waitForElementVisible('body', 1000)
.assert.containsText('body', require(`${cwd}/package.json`).name)
.end();
const run = async ({cwd}) => {
const server = await createServer({cwd});
const finish = () => new Promise(resolve => server.close(() => process.nextTick(resolve)));
const die = async err => {
console.error(err.message);
console.log(err.stack);
await finish();
process.exit(1);
};
process.on('uncaughtException', die);
process.on('unhandledRejection', die);
const client = nightwatch.initClient({
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
output: true,
detailed_output: true
});
const browser = client.api();
browser
.url(`http://${DOCKER_IP}:${server.port}`)
.waitForElementVisible('body', 1000)
.assert.containsText('body', require(`${cwd}/package.json`).name)
.end();
function World() {
//Initiate our client and get it back from the Manager
var client = nightwatch.initClient(config.test_settings.default)['@client'];
client.api.silent = true;
//Set the client and api to a scope for all features and hooks
this.client = client;
this.browser = client.api;
}