diff options
author | ilanap <ilanap@amdocs.com> | 2018-02-18 11:02:03 +0200 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-02-18 13:15:44 +0000 |
commit | 6c872743f110fee1efd1d846b7642e6162efa1ea (patch) | |
tree | f03bab2b41fb95b1388fcd60fb0bf8b021d29a65 /openecomp-bdd/stepDefinitions | |
parent | aad2781298db9c48ef4be167709b905af39bf9e4 (diff) |
Adding BDD prefixes for different environments
Change-Id: I393f7e68b209b2a29134073453ee5ec92339330b
Issue-ID: SDC-990
Signed-off-by: ilanap <ilanap@amdocs.com>
Diffstat (limited to 'openecomp-bdd/stepDefinitions')
-rw-r--r-- | openecomp-bdd/stepDefinitions/Utils.js | 5 | ||||
-rw-r--r-- | openecomp-bdd/stepDefinitions/VF_steps.js | 2 | ||||
-rw-r--r-- | openecomp-bdd/stepDefinitions/world.js | 8 |
3 files changed, 8 insertions, 7 deletions
diff --git a/openecomp-bdd/stepDefinitions/Utils.js b/openecomp-bdd/stepDefinitions/Utils.js index ff49727409..08d0a2b10f 100644 --- a/openecomp-bdd/stepDefinitions/Utils.js +++ b/openecomp-bdd/stepDefinitions/Utils.js @@ -17,8 +17,9 @@ const request = require('request'); const fs = require('fs'); require('node-zip'); -function _request(context, method, path, data, isBinary=false, isVFCall=false) { - let server = (isVFCall) ? context.vf_server : context.onboarding_server; +function _request(context, method, path, data, isBinary=false, prefix='onboarding') { + let server = context.server + '/' + context.prefix[prefix]; + let options = { method: method, url: server + path, diff --git a/openecomp-bdd/stepDefinitions/VF_steps.js b/openecomp-bdd/stepDefinitions/VF_steps.js index d00cf9ca6a..268c371687 100644 --- a/openecomp-bdd/stepDefinitions/VF_steps.js +++ b/openecomp-bdd/stepDefinitions/VF_steps.js @@ -37,7 +37,7 @@ Then('I want to create a VF for this Item', function () { this.context.inputData.tags[0] = result.data.name; this.context.inputData.vendorName = result.data.vendorName; this.context.inputData.csarUUID = this.context.item.id; - return util.request(this.context, 'POST', '/catalog/resources', this.context.inputData, false, true); + return util.request(this.context, 'POST', '/catalog/resources', this.context.inputData, false, 'vf'); }); }); diff --git a/openecomp-bdd/stepDefinitions/world.js b/openecomp-bdd/stepDefinitions/world.js index e87a9b588f..ba6d57a09b 100644 --- a/openecomp-bdd/stepDefinitions/world.js +++ b/openecomp-bdd/stepDefinitions/world.js @@ -40,8 +40,7 @@ class CustomWorld { } else { this.context.server = config.server; } - this.context.onboarding_server = (config.protocol + '://' + this.context.server + ':' + config.port + '/' + config.prefix); - this.context.vf_server = (config.protocol + '://' + this.context.server + ':' + config.port + '/' + config.vf_prefix); + this.context.server = (config.protocol + '://' + this.context.server + ':' + config.port); this.context.headers = {}; @@ -56,9 +55,10 @@ class CustomWorld { this.context.inputData = null; this.context.responseData = null; + this.context.prefix = config.prefix; + this.setServer = function(server) { - this.context.onboarding_server = (config.protocol + '://' +server + ':' + config.port + '/' + config.prefix); - this.context.vf_server = (config.protocol + '://' +server + ':' + config.port + '/' + config.vf_prefix); + this.context.server = (config.protocol + '://' + this.context.server + ':' + config.port); } setDefaultTimeout(60 * 1000); |