From 3f55e8e7cff615f2f97d3e0d5def0c2f0d80cea5 Mon Sep 17 00:00:00 2001 From: shrikantawachar Date: Sat, 14 Jul 2018 00:18:09 +0530 Subject: Enhancement in md5 field of Image Implementation and Flow tests Change-Id: I4c7e3dfe077ba43317cf0b06b0ea4d85bfb50da8 Issue-ID: SDC-1502 Signed-off-by: shrikantawachar --- openecomp-bdd/stepDefinitions/InputData_steps.js | 11 +++++++++++ openecomp-bdd/stepDefinitions/Questionnaire_steps.js | 19 +++++++++++++++++++ openecomp-bdd/stepDefinitions/VSP_steps.js | 7 +++++-- 3 files changed, 35 insertions(+), 2 deletions(-) (limited to 'openecomp-bdd/stepDefinitions') 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 @@ -62,6 +62,17 @@ Then('I want to update the input property {string} with value {string}', functio _.set(this.context.inputData, string, string2); }); +/** + * @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 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}; -- cgit 1.2.3-korg