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
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) {
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) {
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;
}
})();