diff options
Diffstat (limited to 'vid-webpack-master')
5 files changed, 87 insertions, 20 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts index 6fb667588..027901f0f 100644 --- a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts @@ -235,7 +235,7 @@ describe('View Edit Page: Upgrade VFModule', function () { }); - it(`Upgrade a VFModule: upgrade vfmodule when upgraded already service, vnf and borther vfmodule e2e`, function () { + it(`Upgrade a VFModule: upgrade vfmodule when upgraded already service, vnf and brother vfmodule e2e`, function () { const serviceType = 'Emanuel'; const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb'; diff --git a/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts index 1d94454fb..efe9d5408 100644 --- a/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/viewOnlyDrawingBoard.e2e.ts @@ -96,6 +96,13 @@ describe('View only drawing board', function () { }); cy.readFile('../vid-automation/src/test/resources/aaiGetInstanceTopology/getServiceInstanceTopologyResult.json').then((res) => { + res.vnfs['2017-488_PASQUALE-vPE 0'] + .vfModules['2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0']['2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0uvfot'] + .modelInfo.modelVersion = '2'; + res.vnfs['2017-488_PASQUALE-vPE 0'] + .vfModules['2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1']['2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1fshmc'] + .modelInfo.modelVersion = null; + jsonBuilderAndMock.basicJson( res, Cypress.config('baseUrl') + "/aai_get_service_instance_topology/e433710f-9217-458d-a79d-1c7aff376d89/TYLER SILVIA/f8791436-8d55-4fde-b4d5-72dd2cf13cfb", @@ -127,6 +134,14 @@ describe('View only drawing board', function () { cy.getElementByDataTestsId('node-f8360508-3f17-4414-a2ed-6bc71161e8db-2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0').find("[data-tests-id='status-property-orchStatus']").eq(0).should('have.text', 'Active'); cy.getElementByDataTestsId('node-f8360508-3f17-4414-a2ed-6bc71161e8db-2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0').find("[data-tests-id='status-property-inMaint']").eq(0).should('have.text', ''); + checkVfModuleModelVersion('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0', + 'node-f8360508-3f17-4414-a2ed-6bc71161e8db-2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0', + '2'); + + checkVfModuleModelVersion('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0', + 'node-25284168-24bb-4698-8cb4-3f509146eca5-2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1', + ''); + cy.getElementByDataTestsId("serviceInstance").should('have.text', 'Service instance:'); cy.getElementByDataTestsId("serviceName").should('have.text', 'mCaNkinstancename'); cy.getElementByDataTestsId("orchStatusLabel").should('have.text', 'Orch Status:'); @@ -326,6 +341,11 @@ describe('View only drawing board', function () { }); + function checkVfModuleModelVersion(vnfNodeDataTestId: string, vfModuleDataTestId: string, vfModuleModelVersion: string){ + cy.getElementByDataTestsId(vnfNodeDataTestId) + .getElementByDataTestsId(vfModuleDataTestId) + .find("[data-tests-id='status-property-modelVersion']").eq(0).should('have.text', vfModuleModelVersion); + } function testComponentInfoForVNF(){ const labelsAndValuesForModel = [ ['Model version', '2.0'], diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts index a81c86025..f8a738ac7 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts @@ -2616,10 +2616,10 @@ describe('Model Tree Generator service', () => { "children": [], "statusMessage": "Failed Vnf Message", "statusProperties": [Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: 'prov', testId: 'provStatus' - }), Object({ key: 'Orch Status:', value: 'Active', testId: 'orchStatus' }), Object({ + }), Object({ key: 'Orch Status: ', value: 'Active', testId: 'orchStatus' }), Object({ key: 'In-maintenance', value: '', testId: 'inMaint' @@ -2641,10 +2641,10 @@ describe('Model Tree Generator service', () => { "vnfStoreKey": "2017-488_PASQUALE-vPE 0", "typeName": "VNF", "statusProperties": [Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: undefined, testId: 'provStatus' - }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + }), Object({ key: 'Orch Status: ', value: undefined, testId: 'orchStatus' })], "children": [{ "parentType": 'VNF', "action": 'None', @@ -2674,10 +2674,15 @@ describe('Model Tree Generator service', () => { "dynamicModelName": "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0zssmp", "typeName": "M", "statusProperties": [Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: undefined, testId: 'provStatus' - }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + }), Object({ key: 'Orch Status: ', value: undefined, testId: 'orchStatus' }), + Object({ + key: 'Model Version: ', + value: '5', + testId: 'modelVersion' + })], }] }] } @@ -2698,10 +2703,10 @@ describe('Model Tree Generator service', () => { "vnfStoreKey": "2017-488_PASQUALE-vPE 0", "typeName": "VNF", "statusProperties": [Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: undefined, testId: 'provStatus' - }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + }), Object({ key: 'Orch Status: ', value: undefined, testId: 'orchStatus' })], "children": [ { "action": 'None', @@ -2788,10 +2793,10 @@ describe('Model Tree Generator service', () => { "networkStoreKey": "ExtVL 0", "typeName": "N", "statusProperties": [Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: undefined, testId: 'provStatus' - }), Object({ key: 'Orch Status:', value: undefined, testId: 'orchStatus' })], + }), Object({ key: 'Orch Status: ', value: undefined, testId: 'orchStatus' })], }, { "parentType": '', diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts index fcef504fd..60f59de4c 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts @@ -312,23 +312,55 @@ describe('Shared Tree Service', () => { }); test('statusProperties should be prop on node according to node properties', () => { - let node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: false}); + + let node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', type: 'VFmodule', instanceModelInfo:{modelVersion: '1'}, inMaint: false}); expect(node.statusProperties).toBeDefined(); expect(node.statusProperties).toEqual([Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: 'inProgress', testId: 'provStatus' - }), Object({key: 'Orch Status:', value: 'completed', testId: 'orchStatus'})]); - node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress', inMaint: true}); + }), Object({ + key: 'Orch Status: ', + value: 'completed', + testId: 'orchStatus' + }), + Object({ + key: 'Model Version: ', + value: '1', + testId: 'modelVersion' + })]); + node = service.addingStatusProperty({orchStatus: 'completed', provStatus: 'inProgress',type: 'VFmodule', instanceModelInfo:{}, inMaint: true}); expect(node.statusProperties).toEqual([Object({ - key: 'Prov Status:', + key: 'Prov Status: ', value: 'inProgress', testId: 'provStatus' - }), Object({key: 'Orch Status:', value: 'completed', testId: 'orchStatus'}), Object({ + }), Object({ + key: 'Orch Status: ', + value: 'completed', + testId: 'orchStatus' + }), Object({ + key: 'Model Version: ', + value: undefined, + testId: 'modelVersion' + }), Object({ key: 'In-maintenance', value: '', testId: 'inMaint' - })]); + }) +]); + }); + each([ + ['version 2', '2', '2'], + ['undefined', null, undefined] + ]). + test('getNodeModelVersion should return %s', (description, nodeVersion, expectedVersion) => { + let node = <any>{ + instanceModelInfo:{ + modelVersion: nodeVersion + } + }; + let actualVersion = service.getNodeModelVersion(node); + expect(actualVersion).toEqual(expectedVersion); }); each([ diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts index 1e8512784..249f9ec85 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts @@ -120,14 +120,24 @@ export class SharedTreeService { addingStatusProperty(node) { node['statusProperties'] = []; - node['statusProperties'].push({key: 'Prov Status:', value: node.provStatus, testId: 'provStatus'}); - node['statusProperties'].push({key: 'Orch Status:', value: node.orchStatus, testId: 'orchStatus'}); + node['statusProperties'].push({key: 'Prov Status: ', value: node.provStatus, testId: 'provStatus'}); + node['statusProperties'].push({key: 'Orch Status: ', value: node.orchStatus, testId: 'orchStatus'}); + if(node.type === 'VFmodule') { + node['statusProperties'].push({key: 'Model Version: ', value: this.getNodeModelVersion(node), testId: 'modelVersion'}); + } if (node.inMaint) { node['statusProperties'].push({key: 'In-maintenance', value: '', testId: 'inMaint'}); } return node; } + getNodeModelVersion(node): string | undefined { + if(!_.isNil(node.instanceModelInfo) && !_.isNil(node.instanceModelInfo.modelVersion)){ + return node.instanceModelInfo.modelVersion; + } + return undefined; + } + /********************************************** * should delete or remove child instance's "new" -> should remove |