[ADF-4957] Use Replace JS instead of sed to run e2e (#5160)

* use replace js

* Update app-config-replace.js

* update replace

* update replace

* fix folder
This commit is contained in:
Eugenio Romano
2019-10-28 16:51:36 +00:00
committed by Denys Vuika
parent 450b20eca4
commit 27fa7a4725
7 changed files with 28 additions and 31 deletions

View File

@@ -0,0 +1,21 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
require('dotenv').config({ path: process.env.ENV_FILE });
const fs = require('fs');
const PROXY_HOST_ADF = process.env.PROXY_HOST_ADF;
const NOTIFICATION_LAST = process.env.NOTIFICATION_LAST || 8000;
const configPath = './demo-shell/dist/app.config.json';
fs.readFile(configPath, (err, appConfigString) => {
if (err) throw err;
let appConfig = JSON.parse(appConfigString);
appConfig.bpmHost = PROXY_HOST_ADF;
appConfig.ecmHost = PROXY_HOST_ADF;
appConfig.notificationDefaultDuration = NOTIFICATION_LAST;
let appConfigReplacedJson = JSON.stringify(appConfig);
fs.writeFileSync(configPath, appConfigReplacedJson);
});