Fix for adding BDD config changes
Change-Id: I62f79a56a73ff8a546ecef407c3966b93de23a2e
Issue-ID: SDC-990
Signed-off-by: ilanap <ilanap@amdocs.com>
diff --git a/openecomp-bdd/stepDefinitions/General_Steps.js b/openecomp-bdd/stepDefinitions/General_Steps.js
index bf35cb8..13c03f7 100644
--- a/openecomp-bdd/stepDefinitions/General_Steps.js
+++ b/openecomp-bdd/stepDefinitions/General_Steps.js
@@ -47,15 +47,6 @@
/**
* @module ContextData
- * @description Sets the server for the test. overrides configuration.
- * @step Server with IP
- **/
-Given('Server host {string}', function (string) {
- this.setServer(string);
-});
-
-/**
- * @module ContextData
* @description Copy a property from the response data to context Item/VLM/VSP data, example: vsp.componentId
* @step I want to save on the context for {string} property {string} with value {string}
**/
diff --git a/openecomp-bdd/stepDefinitions/Utils.js b/openecomp-bdd/stepDefinitions/Utils.js
index 4a54ebe..4653407 100644
--- a/openecomp-bdd/stepDefinitions/Utils.js
+++ b/openecomp-bdd/stepDefinitions/Utils.js
@@ -25,6 +25,8 @@
url: server + path,
headers: context.headers
};
+ console.log('--> Calling REST ' + options.method +' url: ' + options.url);
+
return new Promise(function (resolve, reject) {
if (method === 'POST' || method === 'PUT') {
if (isBinary) {
@@ -106,6 +108,8 @@
url: server + path,
headers: context.headers
};
+ console.log('--> Calling REST download url: ' + options.url);
+
var file = fs.createWriteStream(filePath);
var r = request(options).pipe(file);
r.on('error', function (err) {
diff --git a/openecomp-bdd/stepDefinitions/world.js b/openecomp-bdd/stepDefinitions/world.js
index fd72505..75f93af 100644
--- a/openecomp-bdd/stepDefinitions/world.js
+++ b/openecomp-bdd/stepDefinitions/world.js
@@ -60,23 +60,19 @@
this.context.defaultServerType = 'onboarding';
- this.context.prefix = config.prefix;
- this.context.port = config.port;
- this.context.protocol = config.protocol;
-
- this.setServer = function(server) {
- this.context.server = server;
- };
+ this.config = config;
let context = this.context;
this.context.getUrlForType = (function(type) {
- var that = context;
+ var _server = context.server;
+ var _config = config;
return function(type) {
- let typeData = that[type];
- return (config.protocol + '://' +
- that.server + ':' +
+ let typeData = _config[type];
+ let _url = _config.protocol + '://' +
+ _server + ':' +
typeData.port + '/' +
- typeData.prefix);
+ typeData.prefix;
+ return _url;
}
})();