Run e2e tests from bash script

fix-debugger
ioedeveloper 4 years ago
parent 25bad3ebc1
commit da598ce00d
  1. 18
      apps/remix-ide-e2e/script.js
  2. 17
      apps/remix-ide-e2e/script.sh

@ -1,9 +1,23 @@
/* eslint-disable */
// TEST_SCRIPT='node_modules/.bin/nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js'; if [ {args.env} != undefined ]; then TEST_SCRIPT=${TEST_SCRIPT}' --env {args.env}'; else TEST_SCRIPT=${TEST_SCRIPT}' --env chrome'; fi; if [ {args.filePath} != undefined ]; then TEST_SCRIPT=${TEST_SCRIPT}' {args.filePath}'; fi; eval $TEST_SCRIPT;
const { spawn } = require('child_process')
const commands = process.argv
let filePath = '', env = ''
commands.forEach(val => {
if (val.indexOf('--filePath') !== -1) filePath = val.split('=')[1]
else if (val.indexOf('--env') !== -1) env = val.split('=')[1]
})
})
const bash = spawn('apps/remix-ide-e2e/script.sh', [env, filePath]);
bash.stdout.on('data', (data) => {
console.log(data.toString());
});
bash.stderr.on('data', (data) => {
console.log(data.toString());
});
bash.on('exit', (code) => {
console.log(`Process exited with code ${code}`);
});

@ -0,0 +1,17 @@
#!/bin/bash
TEST_SCRIPT='node_modules/.bin/nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js';
if [ {$1} != undefined ]
then
TEST_SCRIPT=${TEST_SCRIPT}' --env '$1;
else
TEST_SCRIPT=${TEST_SCRIPT}' --env chrome';
fi
if [ {$2} != undefined ]
then
TEST_SCRIPT=${TEST_SCRIPT}' '$2;
fi
eval $TEST_SCRIPT;
Loading…
Cancel
Save