Interface operation support for service - BDD 31/65131/4
authormojahidi <mojahidul.islam@amdocs.com>
Fri, 7 Sep 2018 05:37:49 +0000 (11:07 +0530)
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>
Thu, 13 Sep 2018 11:56:39 +0000 (11:56 +0000)
Added flow test for Interface operation support for service

Change-Id: I0f4ed8fbc6c124b63ff167cbeaf0921c544b5b79
Issue-ID: SDC-1739
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
openecomp-bdd/features/InterfaceOperation/TestResourceInterfaceOperation.feature [moved from openecomp-bdd/features/InterfaceOperation/TestInterfaceOperation.feature with 75% similarity]
openecomp-bdd/features/InterfaceOperation/TestServiceInterfaceOperation.feature [new file with mode: 0644]
openecomp-bdd/resources/json/operation/createOperation.json
openecomp-bdd/resources/json/operation/createOperationWithInputOutput.json [new file with mode: 0644]
openecomp-bdd/resources/json/operation/createService.json [new file with mode: 0644]
openecomp-bdd/resources/json/operation/createVF.json [moved from openecomp-bdd/resources/json/operation/createVF_From_Catalog.json with 60% similarity]
openecomp-bdd/resources/json/operation/updateOperation.json
openecomp-bdd/stepDefinitions/InterfaceOperationSteps.js

@@ -10,6 +10,8 @@ Feature: Interface Operation Feature
   And  I want to create an Operation
   Then I want to check property "uniqueId" exists
   And  I want to create an Operation
+  Then I want to check property "uniqueId" exists
+  When I want to create an Operation with input output
   Then I want to check property "uniqueId" exists
 
    #List All Operations
@@ -26,12 +28,12 @@ Feature: Interface Operation Feature
   When I want to delete an Operation
 
   #Checkin
-  When I want to checkin this VF
+  When I want to checkin this component
   Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN"
 
-  #Submit
-  Then I want to submit this VF
-  And I want to check property "lifecycleState" for value "READY_FOR_CERTIFICATION"
+  #Certify
+  Then I want to certify this component
+  And I want to check property "lifecycleState" for value "CERTIFIED"
 
  Scenario: Test InterfaceOperation CREATE
   #Create Operations
@@ -46,12 +48,12 @@ Feature: Interface Operation Feature
   When I want to list Operations
 
 #Checkin
-  When I want to checkin this VF
+  When I want to checkin this component
   Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN"
 
-#Submit
-  Then I want to submit this VF
-  And I want to check property "lifecycleState" for value "READY_FOR_CERTIFICATION"
+#Certify
+  Then I want to certify this component
+  And I want to check property "lifecycleState" for value "CERTIFIED"
 
 
  Scenario: Test InterfaceOperation UPDATE
@@ -67,12 +69,12 @@ Feature: Interface Operation Feature
   Then I want to check property "uniqueId" exists
 
   #Checkin
-  When I want to checkin this VF
+  When I want to checkin this component
   Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN"
 
-  #Submit
-  Then I want to submit this VF
-  And I want to check property "lifecycleState" for value "READY_FOR_CERTIFICATION"
+  #Certify
+  Then I want to certify this component
+  And I want to check property "lifecycleState" for value "CERTIFIED"
 
 
  Scenario: Test InterfaceOperation DELETE
@@ -88,9 +90,9 @@ Feature: Interface Operation Feature
   When I want to delete an Operation
 
   #Checkin
-  When I want to checkin this VF
+  When I want to checkin this component
   Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN"
 
-  #Submit
-  Then I want to submit this VF
-  And I want to check property "lifecycleState" for value "READY_FOR_CERTIFICATION"
\ No newline at end of file
+  #certify
+  Then I want to certify this component
+  And I want to check property "lifecycleState" for value "CERTIFIED"
\ No newline at end of file
diff --git a/openecomp-bdd/features/InterfaceOperation/TestServiceInterfaceOperation.feature b/openecomp-bdd/features/InterfaceOperation/TestServiceInterfaceOperation.feature
new file mode 100644 (file)
index 0000000..1ad2377
--- /dev/null
@@ -0,0 +1,37 @@
+Feature: Interface Operation Feature
+
+ Background: Init
+  Given I want to create a Service
+
+ Scenario: Test InterfaceOperation CRUD
+   #Create Operations
+  When I want to create an Operation
+  Then I want to check property "uniqueId" exists
+  And  I want to create an Operation
+  Then I want to check property "uniqueId" exists
+  And  I want to create an Operation
+  Then I want to check property "uniqueId" exists
+  When I want to create an Operation with input output
+  Then I want to check property "uniqueId" exists
+
+   #List All Operations
+  When I want to list Operations
+
+   #Get Operation By OperationId
+  When I want to get an Operation by Id
+  Then I want to check property "uniqueId" exists
+
+   #Update Operation
+  When I want to update an Operation
+  Then I want to check property "uniqueId" exists
+
+   #Delete Operation
+  When I want to delete an Operation
+
+   #Checkin
+  When I want to checkin this component
+  Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN"
+
+   #Submit
+  Then I want to submit this component
+  And I want to check property "lifecycleState" for value "READY_FOR_CERTIFICATION"
index 5d49440..10c34ba 100644 (file)
@@ -1,30 +1,14 @@
 {
   "interfaceOperations": {
-    "create": {
+    "operation": {
       "description": "abcd description",
       "inputParams": {
-        "listToscaDataDefinition": [
-          {
-            "paramName": "sd",
-            "paramId": "67c72959-0a05-4436-9339-534aa44c9fd0.nf_naming"
-          },
-          {
-            "paramName": "sdf",
-            "paramId": "67c72959-0a05-4436-9339-534aa44c9fd0.nf_naming_code"
-          }
-        ]
       },
       "outputParams": {
-        "listToscaDataDefinition": [
-          {
-            "paramName": "op1",
-            "paramId": "68443b9d-9405-458e-811f-b62dd4975fcb.nf_naming"
-          }
-        ]
       },
       "operationType": "create",
-      "workflowId" : "w_id1",
-      "workflowVersionId" : "w_version_id11"
+      "workflowId" : null,
+      "workflowVersionId" : null
     }
   }
 }
\ No newline at end of file
diff --git a/openecomp-bdd/resources/json/operation/createOperationWithInputOutput.json b/openecomp-bdd/resources/json/operation/createOperationWithInputOutput.json
new file mode 100644 (file)
index 0000000..013d615
--- /dev/null
@@ -0,0 +1,29 @@
+{
+  "interfaceOperations": {
+    "operation": {
+      "description": "abcd description",
+      "inputParams": {
+        "listToscaDataDefinition": [
+          {
+            "name": "inp1",
+            "type": "string",
+            "property": "97477d27-8fe2-45a1-83cb-83368ef2a402.nf_naming_code",
+            "mandatory": true
+          }
+        ]
+      },
+      "outputParams": {
+        "listToscaDataDefinition": [
+          {
+            "name": "op",
+            "mandatory": true,
+            "type": "String"
+          }
+        ]
+      },
+      "operationType": "create",
+      "workflowId" : null,
+      "workflowVersionId" : null
+    }
+  }
+}
\ No newline at end of file
diff --git a/openecomp-bdd/resources/json/operation/createService.json b/openecomp-bdd/resources/json/operation/createService.json
new file mode 100644 (file)
index 0000000..e7afe2a
--- /dev/null
@@ -0,0 +1,102 @@
+{
+  "artifacts": {
+
+  },
+  "toscaArtifacts": {
+
+  },
+  "contactId": "cs0008",
+  "categories": [
+    {
+      "name": "Network L4+",
+      "normalizedName": "network l4+",
+      "uniqueId": "serviceNewCategory.network l4+",
+      "icons": [
+        "network_l_4"
+      ],
+      "subcategories": null,
+      "version": null,
+      "ownerId": null,
+      "empty": false,
+      "type": null
+    }
+  ],
+  "description": "service1 for bdd",
+  "icon": "defaulticon",
+  "componentInstancesProperties": {
+
+  },
+  "componentInstancesAttributes": {
+
+  },
+  "name": "service1",
+  "tags": [
+    "service1"
+  ],
+  "capabilities": {
+
+  },
+  "requirements": {
+
+  },
+  "deploymentArtifacts": {
+
+  },
+  "componentType": "SERVICE",
+  "projectCode": "010203",
+  "componentInstances": [
+
+  ],
+  "properties": [
+
+  ],
+
+  "inputs": [
+    {
+      "uniqueId": "03eeb10e-cf2a-41b8-9d8e-d2dbd094f9d4.test1_dasddas",
+      "type": "scalar-unit.size",
+      "required": false,
+      "definition": false,
+      "schema": {
+        "properties": {
+
+        },
+        "property": {
+          "type": "",
+          "required": false,
+          "definition": true,
+          "password": false,
+          "hidden": false,
+          "immutable": false,
+          "getInputProperty": false,
+          "empty": false
+        },
+        "empty": false
+      },
+      "password": false,
+      "name": "test1_dasddas",
+      "hidden": false,
+      "immutable": false,
+      "instanceUniqueId": "03eeb10e-cf2a-41b8-9d8e-d2dbd094f9d4",
+      "propertyId": "03eeb10e-cf2a-41b8-9d8e-d2dbd094f9d4.dasddas",
+      "parentUniqueId": "cs0008",
+      "schemaType": "",
+      "getInputProperty": false,
+      "ownerId": "cs0008",
+      "empty": false
+    }
+  ],
+
+  "attributes": [
+
+  ],
+  "forwardingPaths": {
+
+  },
+  "ecompGeneratedNaming": true,
+  "serviceApiArtifacts": {
+
+  },
+  "instantiationType": "A-la-carte",
+  "environmentContext": "General_Revenue-Bearing"
+}
\ No newline at end of file
   "componentInstances": [
 
   ],
-  "inputs": [ ],
+  "inputs": [{
+    "uniqueId": "abcdef",
+    "type": "org.openecomp.datatypes.Naming",
+    "required": false,
+    "definition": false,
+    "defaultValue": null,
+    "description": null,
+    "schema": null,
+    "password": false,
+    "name": "abcdef",
+    "value": null,
+    "label": null,
+    "hidden": false,
+    "immutable": false,
+    "inputPath": null,
+    "status": null,
+    "inputId": null,
+    "instanceUniqueId": null,
+    "propertyId": null,
+    "annotations": null,
+    "parentUniqueId": "abcd",
+    "getInputValues": null,
+    "constraints": null,
+    "inputs": null,
+    "properties": null,
+    "getInputProperty": false,
+    "schemaType": null,
+    "schemaProperty": null,
+    "version": null,
+    "ownerId": null,
+    "empty": false
+  } ],
   "properties": [
 
   ],
index b74262f..698d38c 100644 (file)
@@ -1,12 +1,23 @@
 {
   "interfaceOperations": {
-    "create": {
+    "operation": {
       "description": "create operation_Updated",
       "inputParams": {
         "listToscaDataDefinition": [
           {
-            "paramName": "inp1",
-            "paramId": "REPLACE FROM CONTEXT"
+            "name": "inp1",
+            "type": "string",
+            "property": "97477d27-8fe2-45a1-83cb-83368ef2a402.nf_naming_code",
+            "mandatory": true
+          }
+        ]
+      },
+      "outputParams": {
+        "listToscaDataDefinition": [
+          {
+            "name": "op",
+            "mandatory": true,
+            "type": "String"
           }
         ]
       },
index 1bfd4c3..f4a81d6 100644 (file)
@@ -19,15 +19,28 @@ const util = require('./Utils.js');
 
 
 When('I want to create a VF', function()  {
-    let inputData = util.getJSONFromFile('resources/json/operation/createVF_From_Catalog.json');
+    let inputData = util.getJSONFromFile('resources/json/operation/createVF.json');
 
     inputData.name =  util.random();
     inputData.tags[0] = util.random();
 
-    let path = '/catalog/resources';
+    var type = "resources";
+    let path = '/catalog/' + type;
     return util.request(this.context, 'POST', path,  inputData, false, 'vf').then(result => {
-        this.context.item = {uniqueId : result.data.uniqueId, id : result.data.inputs[0].uniqueId, name : result.data.inputs[0].name};
-        this.context.vf = {uniqueId : result.data.uniqueId, id : result.data.inputs[0].uniqueId, name : result.data.inputs[0].name};
+        this.context.component = {uniqueId : result.data.uniqueId, type : type, id : result.data.inputs[0].uniqueId};
+});
+});
+
+When('I want to create a Service', function()  {
+    let inputData = util.getJSONFromFile('resources/json/operation/createService.json');
+
+    inputData.name =  util.random();
+    inputData.tags[0] = util.random();
+
+    var type = "services";
+    let path = '/catalog/' + type;
+    return util.request(this.context, 'POST', path,  inputData, false, 'vf').then(result => {
+        this.context.component = {uniqueId : result.data.uniqueId, type : type, id : result.data.inputs[0].uniqueId};
 });
 });
 
@@ -41,82 +54,88 @@ function makeType() {
     return text;
 }
 
-When('I want to create an Operation', function()  {
-    let inputData = util.getJSONFromFile('resources/json/operation/createOperation.json');
-    let path = '/catalog/resources/' + this.context.vf.uniqueId +'/interfaceOperations';
-
-    inputData.interfaceOperations.create.operationType = makeType();
-    inputData.interfaceOperations.create.description = makeType();
-    inputData.interfaceOperations.create.inputParams.listToscaDataDefinition[0].paramName = util.random();
-    inputData.interfaceOperations.create.inputParams.listToscaDataDefinition[0].paramId = this.context.vf.id;
-    inputData.interfaceOperations.create.outputParams.listToscaDataDefinition[0].paramName = util.random();
-    inputData.interfaceOperations.create.outputParams.listToscaDataDefinition[0].paramId = this.context.vf.id;
-    inputData.interfaceOperations.create.workflowId = makeType();
-    inputData.interfaceOperations.create.workflowVersionId = makeType();
+When('I want to create an Operation with input output', function()  {
+    let path = '/catalog/' + this.context.component.type + '/' + this.context.component.uniqueId + '/interfaceOperations';
+    let inputData = util.getJSONFromFile('resources/json/operation/createOperationWithInputOutput.json');
+
+    inputData.interfaceOperations.operation.inputParams.listToscaDataDefinition[0].name = util.random();
+    inputData.interfaceOperations.operation.inputParams.listToscaDataDefinition[0].property = this.context.component.id;
+    inputData.interfaceOperations.operation.outputParams.listToscaDataDefinition[0].name = util.random();
+    inputData.interfaceOperations.operation.operationType = makeType();
+    inputData.interfaceOperations.operation.description = makeType();
 
     return util.request(this.context, 'POST', path, inputData, false, 'vf').then(result => {
-        this.context.item = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
     this.context.operation = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
 });
 });
 
 
+When('I want to create an Operation', function()  {
+    let path = '/catalog/' + this.context.component.type + '/' + this.context.component.uniqueId + '/interfaceOperations';
+       let inputData  = util.getJSONFromFile('resources/json/operation/createOperation.json');
+    inputData.interfaceOperations.operation.operationType = makeType();
+    inputData.interfaceOperations.operation.description = makeType();
 
-When('I want to list Operations', function () {
-    let path = '/catalog/resources/' + this.context.vf.uniqueId + '/filteredDataByParams?include=interfaces';
-    return util.request(this.context, 'GET', path, null, false, 'vf').then((result)=> {
+    return util.request(this.context, 'POST', path, inputData, false, 'vf').then(result => {
+        this.context.operation = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
 });
 });
 
 
+When('I want to list Operations', function () {
+    let path = '/catalog/'+ this.context.component.type + '/' + this.context.component.uniqueId + '/filteredDataByParams?include=interfaces';
+    return util.request(this.context, 'GET', path, null, false, 'vf').then((result)=> {
+    });
+});
+
 When('I want to get an Operation by Id', function () {
-    let path = '/catalog/resources/' + this.context.vf.uniqueId + '/interfaceOperations/' + this.context.operation.uniqueId;
+    let path = '/catalog/'+ this.context.component.type + '/' + this.context.component.uniqueId + '/interfaceOperations/' + this.context.operation.uniqueId;
     return util.request(this.context, 'GET', path, null, false, 'vf').then((result)=> {
-        this.context.item ={uniqueId : result.data.uniqueId, operationType: result.data.operationType};
-        this.context.operation = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
+    this.context.operation = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
 });
 });
 
-
 When('I want to update an Operation', function () {
     let inputData = util.getJSONFromFile('resources/json/operation/updateOperation.json');
-    let path = '/catalog/resources/' + this.context.vf.uniqueId + '/interfaceOperations/';
-    inputData.interfaceOperations.create.uniqueId = this.context.operation.uniqueId;
-    inputData.interfaceOperations.create.operationType = this.context.operation.operationType;
-    inputData.interfaceOperations.create.inputParams.listToscaDataDefinition[0].paramName = util.random();
-    inputData.interfaceOperations.create.inputParams.listToscaDataDefinition[0].paramId = this.context.vf.id;
+    let path = '/catalog/'+ this.context.component.type + '/'+ this.context.component.uniqueId +'/interfaceOperations';
+    inputData.interfaceOperations.operation.uniqueId = this.context.operation.uniqueId;
+    inputData.interfaceOperations.operation.operationType = this.context.operation.operationType;
+    inputData.interfaceOperations.operation.inputParams.listToscaDataDefinition[0].name = util.random();
+    inputData.interfaceOperations.operation.inputParams.listToscaDataDefinition[0].property = this.context.component.id;
+    inputData.interfaceOperations.operation.outputParams.listToscaDataDefinition[0].name = util.random();
     return util.request(this.context, 'PUT', path, inputData, false, 'vf').then((result)=> {
-        this.context.item ={uniqueId : result.data.uniqueId, operationType: result.data.operationType};
-        this.context.operation = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
+    this.context.operation = {uniqueId : result.data.uniqueId, operationType : result.data.operationType};
 });
 });
 
 
 When('I want to delete an Operation', function()  {
-    let path = '/catalog/resources/' + this.context.vf.uniqueId + '/interfaceOperations/' + this.context.operation.uniqueId;
+    let path = '/catalog/'+ this.context.component.type + '/'+ this.context.component.uniqueId +'/interfaceOperations/' + this.context.operation.uniqueId;
     return util.request(this.context, 'DELETE', path, null, false, 'vf');
 });
 
 
-When('I want to checkin this VF', function () {
-    let path = '/catalog/resources/' + this.context.vf.uniqueId + '/lifecycleState/CHECKIN' ;
+When('I want to checkin this component', function () {
+    let path = '/catalog/'+ this.context.component.type + '/' + this.context.component.uniqueId + '/lifecycleState/CHECKIN' ;
     let inputData = {userRemarks: 'checkin'};
     return util.request(this.context, 'POST', path, inputData, false, 'vf').then((result)=> {
-        this.context.item ={uniqueId : result.data.uniqueId};
-    this.context.vf = {uniqueId : result.data.uniqueId};
+    this.context.component = {uniqueId : result.data.uniqueId, type : this.context.component.type};
 });
 });
 
 
-Then('I want to submit this VF', function () {
-    let path = '/catalog/resources/' + this.context.vf.uniqueId + '/lifecycleState/certificationRequest' ;
+Then('I want to submit this component', function () {
+    let path = '/catalog/'+ this.context.component.type + '/' + this.context.component.uniqueId + '/lifecycleState/certificationRequest' ;
     let inputData = {userRemarks: 'submit'};
     return util.request(this.context, 'POST', path, inputData, false, 'vf').then((result)=> {
-        this.context.item ={uniqueId : result.data.uniqueId};
     this.context.vf = {uniqueId : result.data.uniqueId};
 });
 });
 
-
-
-
+Then('I want to certify this component', function () {
+    let path = '/catalog/'+ this.context.component.type +'/' + this.context.component.uniqueId + '/lifecycleState/certify' ;
+    let inputData = {userRemarks: 'certify'};
+    return util.request(this.context, 'POST', path, inputData, false, 'vf').then((result)=> {
+    this.context.component = {uniqueId : result.data.uniqueId};
+});
+});
\ No newline at end of file