aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-bdd/stepDefinitions
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-06-12 17:32:56 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-06-13 08:16:41 +0000
commit67e400cc929314f1d66accb2f2f47d489f6b0c4f (patch)
tree1f92e95dd1165944ec57de9e7318850a587cb1c4 /openecomp-bdd/stepDefinitions
parentd932a21e9f99ef5e706975a73c4f17a145445fe1 (diff)
Fix for nfcparameters in component questionnaire
issue - nfc naming code and nfc function fields' values are wiped out with a VSP update Moved the above fields from composition to questionnaire Add BDD test. Add license to java files Change-Id: I2b746fedc17c19b716df35bf0dad2c212f15df30 Issue-ID: SDC-1419 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-bdd/stepDefinitions')
-rw-r--r--openecomp-bdd/stepDefinitions/Questionnaire_steps.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/openecomp-bdd/stepDefinitions/Questionnaire_steps.js b/openecomp-bdd/stepDefinitions/Questionnaire_steps.js
index ce35a1c9ce..c794734735 100644
--- a/openecomp-bdd/stepDefinitions/Questionnaire_steps.js
+++ b/openecomp-bdd/stepDefinitions/Questionnaire_steps.js
@@ -77,4 +77,34 @@ Then('I want to check this questionnaire has value {string} for property {string
**/
Then('I want to update this questionnaire', function () {
return util.request(this.context, 'PUT', this.context.qurl, this.context.qdata);
+});
+
+/**
+ * @module Questionnaire
+ * @description Checks if the value of given property name in questionnaire data on the context is same as provided value
+ * @exampleFile ComponentData.feature
+ * @step I want to check value of {string} in the questionnaire data with value of property {string}
+ */
+Then('I want to check value of {string} in the questionnaire data with value of property {string}', function (string,
+ propertyName) {
+ expectedValue = _.get(this.context, propertyName)
+ data1 = this.context.qdata;
+ assert.equal(_.get(data1, string), expectedValue);
+});
+
+/**
+ * @module Questionnaire - Defined in Questionnaire module since this is used to fetch componentId for which questionnaire is to be fetched
+ * @description Finds and set componentId in context from list of components in responseData for component name in given property
+ * @exampleFile ComponentData.feature
+ * @step I want to set componentId for component name in property {string}
+ */
+Then('I want to set componentId for component name in property {string}', function (string) {
+ displayName = _.get(this.context, string);
+ results = this.context.responseData.results;
+ for (i=0; i<results.length; i++) {
+ if (results[i].displayName == displayName ){
+ this.context.componentId = results[i].id;
+ return;
+ }
+ }
}); \ No newline at end of file