Fix for adding BDD config changes 23/32223/1
authorilanap <ilanap@amdocs.com>
Tue, 20 Feb 2018 09:57:12 +0000 (11:57 +0200)
committerilanap <ilanap@amdocs.com>
Tue, 20 Feb 2018 09:57:12 +0000 (11:57 +0200)
Change-Id: I62f79a56a73ff8a546ecef407c3966b93de23a2e
Issue-ID: SDC-990
Signed-off-by: ilanap <ilanap@amdocs.com>
openecomp-bdd/stepDefinitions/General_Steps.js
openecomp-bdd/stepDefinitions/Utils.js
openecomp-bdd/stepDefinitions/world.js

index bf35cb8..13c03f7 100644 (file)
@@ -45,15 +45,6 @@ Given('Response Data:', function (docString) {
        this.context.responseData = JSON.parse(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
index 4a54ebe..4653407 100644 (file)
@@ -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) {
index fd72505..75f93af 100644 (file)
@@ -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;
                        }
                })();