From 5082ac877cab66770e1cce651e49d634c77e8057 Mon Sep 17 00:00:00 2001 From: mojahidi Date: Fri, 7 Sep 2018 11:07:49 +0530 Subject: Interface operation support for service - BDD Added flow test for Interface operation support for service Change-Id: I0f4ed8fbc6c124b63ff167cbeaf0921c544b5b79 Issue-ID: SDC-1739 Signed-off-by: mojahidi --- .../TestInterfaceOperation.feature | 96 ------------------- .../TestResourceInterfaceOperation.feature | 98 ++++++++++++++++++++ .../TestServiceInterfaceOperation.feature | 37 ++++++++ .../resources/json/operation/createOperation.json | 22 +---- .../operation/createOperationWithInputOutput.json | 29 ++++++ .../resources/json/operation/createService.json | 102 ++++++++++++++++++++ .../resources/json/operation/createVF.json | 101 ++++++++++++++++++++ .../json/operation/createVF_From_Catalog.json | 70 -------------- .../resources/json/operation/updateOperation.json | 17 +++- .../stepDefinitions/InterfaceOperationSteps.js | 103 ++++++++++++--------- 10 files changed, 445 insertions(+), 230 deletions(-) delete mode 100644 openecomp-bdd/features/InterfaceOperation/TestInterfaceOperation.feature create mode 100644 openecomp-bdd/features/InterfaceOperation/TestResourceInterfaceOperation.feature create mode 100644 openecomp-bdd/features/InterfaceOperation/TestServiceInterfaceOperation.feature create mode 100644 openecomp-bdd/resources/json/operation/createOperationWithInputOutput.json create mode 100644 openecomp-bdd/resources/json/operation/createService.json create mode 100644 openecomp-bdd/resources/json/operation/createVF.json delete mode 100644 openecomp-bdd/resources/json/operation/createVF_From_Catalog.json (limited to 'openecomp-bdd') diff --git a/openecomp-bdd/features/InterfaceOperation/TestInterfaceOperation.feature b/openecomp-bdd/features/InterfaceOperation/TestInterfaceOperation.feature deleted file mode 100644 index dfd754f74e..0000000000 --- a/openecomp-bdd/features/InterfaceOperation/TestInterfaceOperation.feature +++ /dev/null @@ -1,96 +0,0 @@ -Feature: Interface Operation Feature - - Background: Init - Given I want to create a VF - - 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 - - #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 VF - 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" - - Scenario: Test InterfaceOperation CREATE - #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 - - #List All Operations - When I want to list Operations - -#Checkin - When I want to checkin this VF - 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" - - - Scenario: Test InterfaceOperation UPDATE - #Create Operation - When I want to create an Operation - Then I want to check property "uniqueId" exists - - #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 - - #Checkin - When I want to checkin this VF - 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" - - - Scenario: Test InterfaceOperation DELETE - #Create Operation - When I want to create an Operation - Then I want to check property "uniqueId" exists - - #Get Operation By OperationId - When I want to get an Operation by Id - Then I want to check property "uniqueId" exists - - #Delete Operation - When I want to delete an Operation - - #Checkin - When I want to checkin this VF - 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 diff --git a/openecomp-bdd/features/InterfaceOperation/TestResourceInterfaceOperation.feature b/openecomp-bdd/features/InterfaceOperation/TestResourceInterfaceOperation.feature new file mode 100644 index 0000000000..9f3cd5490f --- /dev/null +++ b/openecomp-bdd/features/InterfaceOperation/TestResourceInterfaceOperation.feature @@ -0,0 +1,98 @@ +Feature: Interface Operation Feature + + Background: Init + Given I want to create a VF + + 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" + + #Certify + Then I want to certify this component + And I want to check property "lifecycleState" for value "CERTIFIED" + + Scenario: Test InterfaceOperation CREATE + #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 + + #List All Operations + When I want to list Operations + +#Checkin + When I want to checkin this component + Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN" + +#Certify + Then I want to certify this component + And I want to check property "lifecycleState" for value "CERTIFIED" + + + Scenario: Test InterfaceOperation UPDATE + #Create Operation + When I want to create an Operation + Then I want to check property "uniqueId" exists + + #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 + + #Checkin + When I want to checkin this component + Then I want to check property "lifecycleState" for value "NOT_CERTIFIED_CHECKIN" + + #Certify + Then I want to certify this component + And I want to check property "lifecycleState" for value "CERTIFIED" + + + Scenario: Test InterfaceOperation DELETE + #Create Operation + When I want to create an Operation + Then I want to check property "uniqueId" exists + + #Get Operation By OperationId + When I want to get an Operation by Id + 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" + + #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 index 0000000000..1ad2377e1b --- /dev/null +++ b/openecomp-bdd/features/InterfaceOperation/TestServiceInterfaceOperation.feature @@ -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" diff --git a/openecomp-bdd/resources/json/operation/createOperation.json b/openecomp-bdd/resources/json/operation/createOperation.json index 5d494402e5..10c34ba8f2 100644 --- a/openecomp-bdd/resources/json/operation/createOperation.json +++ b/openecomp-bdd/resources/json/operation/createOperation.json @@ -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 index 0000000000..013d615999 --- /dev/null +++ b/openecomp-bdd/resources/json/operation/createOperationWithInputOutput.json @@ -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 index 0000000000..e7afe2aa21 --- /dev/null +++ b/openecomp-bdd/resources/json/operation/createService.json @@ -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 diff --git a/openecomp-bdd/resources/json/operation/createVF.json b/openecomp-bdd/resources/json/operation/createVF.json new file mode 100644 index 0000000000..6fe9688caa --- /dev/null +++ b/openecomp-bdd/resources/json/operation/createVF.json @@ -0,0 +1,101 @@ +{ + "artifacts": { + + }, + "toscaArtifacts": { + + }, + "contactId": "cs0008", + "categories": [ + { + "name": "Allotted Resource", + "normalizedName": "allotted resource", + "uniqueId": "resourceNewCategory.allotted resource", + "icons": null, + "subcategories": [ + { + "name": "Tunnel XConnect", + "normalizedName": "tunnel xconnect", + "uniqueId": "resourceNewCategory.allotted resource.tunnel xconnect", + "icons": [ + "tunnel_x_connect" + ], + "groupings": null, + "ownerId": null, + "empty": false + } + ], + "ownerId": null, + "empty": false + } + ], + "description": "sd", + "icon": "defaulticon", + "componentInstancesProperties": { + + }, + "componentInstancesAttributes": { + + }, + "name": "REPLACE", + "tags": [ + "REPLACE" + ], + "capabilities": { + + }, + "requirements": { + + }, + "deploymentArtifacts": { + + }, + "componentType": "RESOURCE", + "vendorName": "vendor", + "vendorRelease": "vendor release", + "componentInstances": [ + + ], + "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": [ + + ], + "attributes": [ + + ], + "groups": [ + + ], + "resourceType": "VF" +} \ No newline at end of file diff --git a/openecomp-bdd/resources/json/operation/createVF_From_Catalog.json b/openecomp-bdd/resources/json/operation/createVF_From_Catalog.json deleted file mode 100644 index 7dcafc63c1..0000000000 --- a/openecomp-bdd/resources/json/operation/createVF_From_Catalog.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "artifacts": { - - }, - "toscaArtifacts": { - - }, - "contactId": "cs0008", - "categories": [ - { - "name": "Allotted Resource", - "normalizedName": "allotted resource", - "uniqueId": "resourceNewCategory.allotted resource", - "icons": null, - "subcategories": [ - { - "name": "Tunnel XConnect", - "normalizedName": "tunnel xconnect", - "uniqueId": "resourceNewCategory.allotted resource.tunnel xconnect", - "icons": [ - "tunnel_x_connect" - ], - "groupings": null, - "ownerId": null, - "empty": false - } - ], - "ownerId": null, - "empty": false - } - ], - "description": "sd", - "icon": "defaulticon", - "componentInstancesProperties": { - - }, - "componentInstancesAttributes": { - - }, - "name": "REPLACE", - "tags": [ - "REPLACE" - ], - "capabilities": { - - }, - "requirements": { - - }, - "deploymentArtifacts": { - - }, - "componentType": "RESOURCE", - "vendorName": "vendor", - "vendorRelease": "vendor release", - "componentInstances": [ - - ], - "inputs": [ ], - "properties": [ - - ], - "attributes": [ - - ], - "groups": [ - - ], - "resourceType": "VF" -} \ No newline at end of file diff --git a/openecomp-bdd/resources/json/operation/updateOperation.json b/openecomp-bdd/resources/json/operation/updateOperation.json index b74262f9f4..698d38c612 100644 --- a/openecomp-bdd/resources/json/operation/updateOperation.json +++ b/openecomp-bdd/resources/json/operation/updateOperation.json @@ -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" } ] }, diff --git a/openecomp-bdd/stepDefinitions/InterfaceOperationSteps.js b/openecomp-bdd/stepDefinitions/InterfaceOperationSteps.js index 1bfd4c30a6..f4a81d6110 100644 --- a/openecomp-bdd/stepDefinitions/InterfaceOperationSteps.js +++ b/openecomp-bdd/stepDefinitions/InterfaceOperationSteps.js @@ -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 -- cgit 1.2.3-korg