From fece2e2737fc5b2b974e4d8aa790288dcd296474 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Wed, 18 May 2016 07:41:48 +0200 Subject: [PATCH] configurable e2e host --- conf.e2e.js | 5 +++++ run-e2e.js | 27 ++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/conf.e2e.js b/conf.e2e.js index 54d04d11..a88f4a79 100644 --- a/conf.e2e.js +++ b/conf.e2e.js @@ -183,4 +183,9 @@ if (argv.seleniumAddress) { config.seleniumAddress = argv.seleniumAddress; } + +if (argv.host) { + config.params.glob.host = argv.host; +} + exports.config = config; diff --git a/run-e2e.js b/run-e2e.js index 9a74844f..77d8e48b 100644 --- a/run-e2e.js +++ b/run-e2e.js @@ -37,20 +37,21 @@ function backup() { function launchProtractor(suit) { let protractorParams = ['conf.e2e.js', '--suite=' + suit, '--back=' + taigaBackPath]; - if (argv.json) { - protractorParams.push('--json'); - } + var discard = [ + "_", + "s", + "a", + "b" + ]; - if (argv.ie) { - protractorParams.push('--ie'); - } - - if (argv.firefox) { - protractorParams.push('--firefox'); - } - - if (argv.seleniumAddress) { - protractorParams.push('--seleniumAddress=' + argv.seleniumAddress); + for(var arg in argv) { + if (discard.indexOf(arg) === -1) { + if(typeof argv[arg] === 'boolean') { + protractorParams.push('--' + arg); + } else { + protractorParams.push('--' + arg + "=" + argv[arg]); + } + } } child_process.spawnSync('protractor', protractorParams, {stdio: "inherit"});