aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-bdd/stepDefinitions
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-bdd/stepDefinitions')
-rw-r--r--openecomp-bdd/stepDefinitions/InputData_steps.js11
-rw-r--r--openecomp-bdd/stepDefinitions/Questionnaire_steps.js19
-rw-r--r--openecomp-bdd/stepDefinitions/VSP_steps.js7
3 files changed, 35 insertions, 2 deletions
diff --git a/openecomp-bdd/stepDefinitions/InputData_steps.js b/openecomp-bdd/stepDefinitions/InputData_steps.js
index 73695d0e7f..57a374b9bb 100644
--- a/openecomp-bdd/stepDefinitions/InputData_steps.js
+++ b/openecomp-bdd/stepDefinitions/InputData_steps.js
@@ -64,6 +64,17 @@ Then('I want to update the input property {string} with value {string}', functio
/**
* @module InputData
+ * @description sets the input property on the input data to the value from property
+ * @exampleFile TestMD5.feature
+ * @step I want to update the input property {string} from property {string}
+ **/
+Then('I want to update the input property {string} from property {string}', function(string, string2) {
+ let val = _.get(this.context, string2);
+ _.set(this.context.inputData, string, val);
+});
+
+/**
+ * @module InputData
* @description removes a property from the input data object
* @exampleFile Example_Rest_Calls.feature
* @step I want to remove {string} from the input data
diff --git a/openecomp-bdd/stepDefinitions/Questionnaire_steps.js b/openecomp-bdd/stepDefinitions/Questionnaire_steps.js
index c794734735..2e169fadc8 100644
--- a/openecomp-bdd/stepDefinitions/Questionnaire_steps.js
+++ b/openecomp-bdd/stepDefinitions/Questionnaire_steps.js
@@ -18,6 +18,11 @@ const assert = require('assert');
const util = require('./Utils.js');
const _ = require('lodash');
+function getPath(path, context) {
+ let compiled = _.template(path);
+ return compiled(context);
+}
+
/**
* @module Questionnaire
* @description Gets the questionnaire for the current item and saves it on the context
@@ -48,6 +53,20 @@ Then('I want to get the questionnaire for this component', function () {
});
});
+/**
+ * @module Questionnaire
+ * @description Gets the questionnaire from path and saves it on the context
+ * @exampleFile TestMD5.feature
+ * @step I want to get the questionnaire for this path {string}
+ **/
+Then('I want to get the questionnaire for this path {string}', function (string) {
+ let path = getPath(string, this.context);
+ return util.request(this.context, 'GET', path).then(result => {
+ this.context.qdata = JSON.parse(result.data.data);
+ this.context.qschema = result.data.schema;
+ this.context.qurl = path;
+ });
+});
/**
* @module Questionnaire
diff --git a/openecomp-bdd/stepDefinitions/VSP_steps.js b/openecomp-bdd/stepDefinitions/VSP_steps.js
index 1f753fef5e..b9b928a7f6 100644
--- a/openecomp-bdd/stepDefinitions/VSP_steps.js
+++ b/openecomp-bdd/stepDefinitions/VSP_steps.js
@@ -48,11 +48,14 @@ When('I want to create a VSP with onboarding type {string}', function(string) {
* @exampleFile Example_VSP.feature
* @step I want to create a VSP with onboarding type {string}
**/
-When('I want to create a VSP', function() {
- let inputData = util.getJSONFromFile('resources/json/createVSP.json');
+When('I want to create a VSP with onboarding type Manual', function() {
+ let inputData = util.getJSONFromFile('resources/json/createManualVSP.json');
inputData.vendorName = this.context.vlm.name;
inputData.vendorId = this.context.vlm.id;
inputData.name = util.random();
+ inputData.licensingVersion = this.context.licensingVersion;
+ inputData.licensingData.licenseAgreement = this.context.licenseAgreement;
+ inputData.licensingData.featureGroups[0] = this.context.featureGroupId;
let path = '/vendor-software-products';
return util.request(this.context, 'POST', path, inputData).then(result => {
this.context.item = {id : result.data.itemId, versionId: result.data.version.id};