aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-bdd
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-bdd')
-rw-r--r--openecomp-bdd/stepDefinitions/General_Steps.js9
-rw-r--r--openecomp-bdd/stepDefinitions/Utils.js4
-rw-r--r--openecomp-bdd/stepDefinitions/world.js20
3 files changed, 12 insertions, 21 deletions
diff --git a/openecomp-bdd/stepDefinitions/General_Steps.js b/openecomp-bdd/stepDefinitions/General_Steps.js
index bf35cb8499..13c03f7848 100644
--- a/openecomp-bdd/stepDefinitions/General_Steps.js
+++ b/openecomp-bdd/stepDefinitions/General_Steps.js
@@ -47,15 +47,6 @@ Given('Response Data:', function (docString) {
/**
* @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 4a54ebe3a7..46534072f2 100644
--- a/openecomp-bdd/stepDefinitions/Utils.js
+++ b/openecomp-bdd/stepDefinitions/Utils.js
@@ -25,6 +25,8 @@ function _request(context, method, path, data, isBinary=false, type='onboarding'
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 @@ function download(context, path, filePath, callback, type='onboarding') {
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 fd7250548d..75f93afb89 100644
--- a/openecomp-bdd/stepDefinitions/world.js
+++ b/openecomp-bdd/stepDefinitions/world.js
@@ -60,23 +60,19 @@ class CustomWorld {
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;
}
})();