summaryrefslogtreecommitdiffstats
path: root/openecomp-bdd
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
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')
-rw-r--r--openecomp-bdd/features/ComponentData.feature52
-rw-r--r--openecomp-bdd/resources/uploads/vMME_Ericsson_small_v2.zipbin0 -> 3247 bytes
-rw-r--r--openecomp-bdd/stepDefinitions/Questionnaire_steps.js30
3 files changed, 82 insertions, 0 deletions
diff --git a/openecomp-bdd/features/ComponentData.feature b/openecomp-bdd/features/ComponentData.feature
new file mode 100644
index 0000000000..62f09a357f
--- /dev/null
+++ b/openecomp-bdd/features/ComponentData.feature
@@ -0,0 +1,52 @@
+Feature: Component - Test Component Composition and Questionnaire Data
+
+ Background: Init
+ Given I want to create a VLM
+
+ Scenario: Test Component Composition and Questionnaire Data After Same Heat Reupload
+ When I want to create a VSP with onboarding type "NetworkPackage"
+ Then I want to make sure this Item has status "Draft"
+
+ When I want to upload a NetworkPackage for this VSP from path "resources/uploads/vMME_Ericsson_small_v2.zip"
+ And I want to process the NetworkPackage file for this VSP
+
+ When I want to get path "/vendor-software-products/{item.id}/versions/{item.versionId}/components"
+ Then I want to copy to property "componentId" from response data path "results[0].id"
+ Then I want to check property "listCount" for value 4
+ Then I want to check property "results[0].id" exists
+
+ #Verify composition data for first component
+ When I want to get path "/vendor-software-products/{item.id}/versions/{item.versionId}/components/{componentId}"
+ Then I want to check property "data.name" exists
+ Then I want to check property "data.displayName" exists
+ Then I want to copy to property "firstCompDisplayName" from response data path "data.displayName"
+ #Ensure composition data does not have vfcCode and nfcFunction since they are moved to questionnaire
+ Then I want to check property "data.vfcCode" does not exist
+ Then I want to check property "data.nfcFunction" does not exist
+
+ When I want to get the questionnaire for this component
+ #Ensure questionnaire data has nfcNamingCode in "general" and populated with value of component displayName
+ Then I want to check value of "general.nfcNamingCode" in the questionnaire data with value of property "firstCompDisplayName"
+
+ #Update questionnaire nfcNamingCode and nfcFunction in "general"
+ And I want to update this questionnaire with value "general/nfcNamingCode" for property "test_update_naming_code"
+ And I want to update this questionnaire with value "general/nfcFunction" for property "test_function"
+ And I want to update this questionnaire
+
+ #Retrive questionnaire and verify nfcNamingCode and nfcFunction in "general" has updated value
+ When I want to get the questionnaire for this component
+ Then I want to check this questionnaire has value "general/nfcNamingCode" for property "test_update_naming_code"
+ Then I want to check this questionnaire has value "general/nfcFunction" for property "test_function"
+
+ #Reupload the same Heat
+ When I want to upload a NetworkPackage for this VSP from path "resources/uploads/vMME_Ericsson_small_v2.zip"
+ And I want to process the NetworkPackage file for this VSP
+
+ When I want to get path "/vendor-software-products/{item.id}/versions/{item.versionId}/components"
+ #Find component id for which nfcNamingCode and nfcFunction were set in previous HEAT based on component display name
+ Then I want to set componentId for component name in property "firstCompDisplayName"
+
+ #Retrive questionnaire and verify nfcNamingCode and nfcFunction in "general" has retained values that were before heat upload
+ When I want to get the questionnaire for this component
+ Then I want to check this questionnaire has value "general/nfcNamingCode" for property "test_update_naming_code"
+ Then I want to check this questionnaire has value "general/nfcFunction" for property "test_function" \ No newline at end of file
diff --git a/openecomp-bdd/resources/uploads/vMME_Ericsson_small_v2.zip b/openecomp-bdd/resources/uploads/vMME_Ericsson_small_v2.zip
new file mode 100644
index 0000000000..f5b1375b03
--- /dev/null
+++ b/openecomp-bdd/resources/uploads/vMME_Ericsson_small_v2.zip
Binary files differ
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