diff options
Diffstat (limited to 'vid-webpack-master')
-rw-r--r-- | vid-webpack-master/cypress/integration/iFrames/viewEditAddNewInstace.e2e.ts (renamed from vid-webpack-master/cypress/integration/iFrames/viewEditNetwork.e2e.ts) | 46 | ||||
-rw-r--r-- | vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_instance.json | 158 | ||||
-rw-r--r-- | vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_model.json | 117 |
3 files changed, 319 insertions, 2 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditNetwork.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditAddNewInstace.e2e.ts index 084680acd..d4fea70fe 100644 --- a/vid-webpack-master/cypress/integration/iFrames/viewEditNetwork.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/viewEditAddNewInstace.e2e.ts @@ -12,7 +12,7 @@ let jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new let jsonBuilderAAISubViewEditModel: JsonBuilder<AAISubViewEditModel> = new JsonBuilder<AAISubViewEditModel>(); -describe('View Edit page: Add network', () =>{ +describe('View Edit page: Add a second instance', () =>{ beforeEach(() => { cy.clearSessionStorage(); cy.initGetAAISubDetails(); @@ -33,7 +33,6 @@ describe('View Edit page: Add network', () =>{ const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb'; const serviceModelId = 'f93e72e1-77fc-4f54-b207-298d766d0886'; const serviceInstanceId = 'ce2821fc-3b28-4759-9613-1e514d7563c0'; - const serviceInvariantUuid = "8c364754-4c76-4abc-b8f3-88da5f67d588"; cy.initDrawingBoardUserPermission(); cy.route(`**/rest/models/services/${serviceModelId}`, @@ -71,6 +70,49 @@ describe('View Edit page: Add network', () =>{ }); + it(`Add new VNF to service with one existing VNF `, () =>{ + const serviceType = 'Mobility'; + const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb'; + const serviceModelId = '82255513-e19f-46e5-bdfb-957c6bf57b82'; + const serviceInstanceId = 'e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa'; + + cy.initDrawingBoardUserPermission(); + cy.route(`**/rest/models/services/${serviceModelId}`, + 'fixture:../support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_model.json') + .as('serviceModelAddVnf'); + + cy.route(`**/aai_get_service_instance_topology/${subscriberId}/${serviceType}/${serviceInstanceId}`, + 'fixture:../support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_instance.json') + .as('serviceInstanceAddVnf'); + + cy.openIframe(`app/ui/#/servicePlanning/EDIT?serviceModelId=${serviceModelId}&subscriberId=${subscriberId}&serviceType=${serviceType}&serviceInstanceId=${serviceInstanceId}`); + + cy.getElementByDataTestsId('node-iperf_vnf_2002_by5924 0-add-btn').click({force: true}).then(() => { + + cy.fillVnfPopup(); + }); + + mockAsyncBulkResponse(); + // click update + cy.getElementByDataTestsId('deployBtn').should('have.text', 'UPDATE').click(); + + cy.getReduxState().then((state) => { + + const vnfs = state.service.serviceInstance['82255513-e19f-46e5-bdfb-957c6bf57b82'].vnfs; + cy.wait('@expectedPostAsyncInstantiation').then(xhr => { + cy.readFile('../vid-app-common/src/test/resources/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json').then((expectedResult) => { + + //set randomized trackById into bulk expected file + expectedResult.vnfs['iperf_vnf_2002_by5924 0'].trackById = vnfs['iperf_vnf_2002_by5924 0'].trackById; + + cy.deepCompare(xhr.request.body, expectedResult); + }); + }); + }); + + }); + + function mockAsyncBulkResponse() { cy.server().route({ url: Cypress.config('baseUrl') + '/asyncInstantiation/bulk', diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_instance.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_instance.json new file mode 100644 index 000000000..24c2632f7 --- /dev/null +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_instance.json @@ -0,0 +1,158 @@ +{ + "action": "None", + "instanceName": "iperf_vnf_svc1", + "instanceId": "e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": null, + "tenantId": null, + "cloudOwner": null, + "modelInfo": { + "modelInvariantId": "1a94f1d1-ab7a-412e-bf2f-9d02d551e9de", + "modelVersionId": "82255513-e19f-46e5-bdfb-957c6bf57b82", + "modelName": "iperf_vnf_2002_by5924", + "modelType": "service", + "modelVersion": "2.0" + }, + "globalSubscriberId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "subscriptionServiceType": "Mobility", + "owningEntityId": null, + "owningEntityName": null, + "tenantName": null, + "aicZoneId": null, + "aicZoneName": null, + "projectName": null, + "rollbackOnFailure": null, + "isALaCarte": true, + "vnfs": { + "2d324058-615d-4ecf-941f-c95f05253cda": { + "action": "None", + "instanceName": "iperf_vnf_2002_VNF_Instance_101", + "instanceId": "2d324058-615d-4ecf-941f-c95f05253cda", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": "rdm59a", + "tenantId": "11981b4f7fc4426d905edb1487b53bff", + "cloudOwner": "att-nc", + "modelInfo": { + "modelCustomizationName": "iperf_vnf_2002_by5924 0", + "modelCustomizationId": "fe200ee4-96bb-4a10-9022-a188a20cf145", + "modelInvariantId": "0153d3b3-0354-489f-89fd-5e7a54afb783", + "modelVersionId": "c8087818-6f3e-4451-b339-111a1a3e7970", + "modelName": "iperf_vnf_2002_by5924", + "modelType": "vnf", + "modelVersion": "2.0" + }, + "instanceType": "iperf_vnf_2002_by5924/iperf_vnf_2002_by5924 0", + "provStatus": "PREPROV", + "inMaint": false, + "uuid": "c8087818-6f3e-4451-b339-111a1a3e7970", + "originalName": "iperf_vnf_2002_by5924 0", + "legacyRegion": null, + "lineOfBusiness": null, + "platformName": null, + "trackById": "2d324058-615d-4ecf-941f-c95f05253cda", + "vfModules": { + "iperf_vnf_2002_by59240..IperfVnf2002By5924..base..module-0": { + "c9d679cc-ee3e-4c2b-be48-bc3ee797c026": { + "action": "None", + "instanceName": "zrdm59aIperf01_base_01", + "instanceId": "c9d679cc-ee3e-4c2b-be48-bc3ee797c026", + "orchStatus": "Active", + "productFamilyId": null, + "lcpCloudRegionId": "rdm59a", + "tenantId": "11981b4f7fc4426d905edb1487b53bff", + "cloudOwner": "att-nc", + "modelInfo": { + "modelCustomizationName": "IperfVnf2002By5924..base..module-0", + "modelCustomizationId": "949ceef3-366b-4e4e-b0f5-40eb1972ad56", + "modelInvariantId": "4a03b70b-85e3-4e67-a4ff-4123021c1278", + "modelVersionId": "73c3470f-acb9-4180-bd60-31ff7aacc094", + "modelName": "IperfVnf2002By5924..base..module-0", + "modelType": "vfModule", + "modelVersion": "1" + }, + "instanceType": null, + "provStatus": null, + "inMaint": false, + "uuid": "73c3470f-acb9-4180-bd60-31ff7aacc094", + "originalName": "iperf_vnf_2002_by59240..IperfVnf2002By5924..base..module-0", + "legacyRegion": null, + "lineOfBusiness": null, + "platformName": null, + "trackById": "c9d679cc-ee3e-4c2b-be48-bc3ee797c026", + "isBase": true, + "volumeGroupName": null + } + } + }, + "networks": { + "588e6ce0-1c77-45a9-808b-3c4085e3ed70": { + "action": "None", + "instanceName": "GRP-29576-T-E2E-16-SDN_int_iperf_net_1", + "instanceId": "588e6ce0-1c77-45a9-808b-3c4085e3ed70", + "orchStatus": "Active", + "lcpCloudRegionId": "rdm59a", + "tenantId": "11981b4f7fc4426d905edb1487b53bff", + "cloudOwner": "att-nc", + "modelInfo": { + "modelCustomizationId": "bc548bf7-1b6a-428d-a7bf-76e7238a7aa8", + "modelInvariantId": "ffb9e45c-e674-4289-aad3-00040ad746e4", + "modelVersionId": "01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "modelName": "NETWORK_CLOUD_PROVIDER_NETWORK", + "modelType": "network", + "modelVersion": "1.0" + }, + "instanceType": "SR-IOV-PROVIDER2-1", + "inMaint": false, + "uuid": "01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "trackById": "588e6ce0-1c77-45a9-808b-3c4085e3ed70", + "role": "int_iperf_net_1", + "physicalName": "sriovnet1", + "serviceName": "int_iperf_svc1", + "serviceUUID": "a9c285e2-6bb9-4877-876e-62c4ac0eadd2", + "tenantName": "GRP-29576-T-E2E-16-SDN", + "boundToVpn": false + }, + "ca61e4c9-982b-4d5f-b9eb-eaaf1cf23b9e": { + "action": "None", + "instanceName": "GRP-29576-T-E2E-16-SDN_oam_protected_net_2", + "instanceId": "ca61e4c9-982b-4d5f-b9eb-eaaf1cf23b9e", + "orchStatus": "Active", + "lcpCloudRegionId": "rdm59a", + "tenantId": "11981b4f7fc4426d905edb1487b53bff", + "cloudOwner": "att-nc", + "modelInfo": { + "modelCustomizationId": "23c382c9-9405-4780-8794-e57eb015883d", + "modelInvariantId": "ffb9e45c-e674-4289-aad3-00040ad746e4", + "modelVersionId": "01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "modelName": "NETWORK_CLOUD_PROVIDER_NETWORK", + "modelType": "network", + "modelVersion": "1.0" + }, + "instanceType": "NEUTRON-PROVIDER", + "inMaint": false, + "uuid": "01f4c475-3f89-4f00-a2f4-39a873dba0ae", + "trackById": "ca61e4c9-982b-4d5f-b9eb-eaaf1cf23b9e", + "role": "oam_protected_net_2", + "physicalName": "oam", + "serviceName": "oam_protected_net_svc1", + "serviceUUID": "ce2821fc-3b28-4759-9613-1e514d7563c0", + "tenantName": "GRP-29576-T-E2E-16-SDN", + "boundToVpn": false + } + } + } + }, + "networks": {}, + "vrfs": {}, + "vnfGroups": {}, + "collectionResources": {}, + "validationCounter": 0, + "existingVNFCounterMap": { + "fe200ee4-96bb-4a10-9022-a188a20cf145": 1 + }, + "existingNetworksCounterMap": {}, + "existingVnfGroupCounterMap": {}, + "existingVRFCounterMap": {} +}
\ No newline at end of file diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_model.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_model.json new file mode 100644 index 000000000..8ae30b483 --- /dev/null +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_model.json @@ -0,0 +1,117 @@ +{ + "service": { + "uuid": "82255513-e19f-46e5-bdfb-957c6bf57b82", + "invariantUuid": "1a94f1d1-ab7a-412e-bf2f-9d02d551e9de", + "name": "iperf_vnf_2002_by5924", + "version": "2.0", + "toscaModelURL": null, + "category": "Network L4+", + "serviceType": "INFRASTRUCTURE", + "serviceRole": "VNF", + "description": "iperf_vnf_2002_by5924", + "serviceEcompNaming": "false", + "instantiationType": "A-La-Carte", + "inputs": {}, + "vidNotions": { + "instantiationUI": "anyAlacarteWhichNotExcluded", + "modelCategory": "5G Fabric Configuration", + "viewEditUI": "legacy", + "instantiationType": "ALaCarte" + } + }, + "vnfs": { + "iperf_vnf_2002_by5924 0": { + "uuid": "c8087818-6f3e-4451-b339-111a1a3e7970", + "invariantUuid": "0153d3b3-0354-489f-89fd-5e7a54afb783", + "description": "iperf_vnf_2002_by5924_VSP", + "name": "iperf_vnf_2002_by5924", + "version": "2.0", + "customizationUuid": "fe200ee4-96bb-4a10-9022-a188a20cf145", + "inputs": {}, + "commands": {}, + "properties": { + "prf_flavor_name": "p1.c8r16d80e120.n0i2", + "nf_naming": "{ecomp_generated_naming=true}", + "multi_stage_design": "false", + "nf_naming_code": "perf", + "nf_function": "PERFORMANCE-TEST", + "availability_zone_max_count": "1", + "nf_role": "vTOOLS", + "ecomp_generated_naming": "true", + "nf_type": "TEST", + "prf_image_name": "Ubuntu 16.04 for KVM VMs with ATT Supported Tools - NO PP" + }, + "type": "VF", + "modelCustomizationName": "iperf_vnf_2002_by5924 0", + "vfModules": { + "iperf_vnf_2002_by59240..IperfVnf2002By5924..base..module-0": { + "uuid": "73c3470f-acb9-4180-bd60-31ff7aacc094", + "invariantUuid": "4a03b70b-85e3-4e67-a4ff-4123021c1278", + "customizationUuid": "949ceef3-366b-4e4e-b0f5-40eb1972ad56", + "description": null, + "name": "IperfVnf2002By5924..base..module-0", + "version": "1", + "modelCustomizationName": "IperfVnf2002By5924..base..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + } + }, + "volumeGroups": {}, + "vfcInstanceGroups": {} + } + }, + "networks": {}, + "collectionResources": {}, + "configurations": {}, + "fabricConfigurations": { + "Fabric Configuration 0": { + "uuid": "fa069a04-cb85-4915-8ca0-df372dde6a3c", + "invariantUuid": "58fa0e1f-f8db-4dce-8972-b8ee630288cf", + "description": "A fabric Configuration object", + "name": "Fabric Configuration", + "version": "9.0", + "customizationUuid": "aaf36ee9-bf72-4c2a-9573-109c10daf97a", + "inputs": {}, + "commands": {}, + "properties": { + "role": "Fabric Config", + "function": "Network Cloud", + "ecomp_generated_naming": "false", + "type": "5G" + }, + "type": "Configuration" + } + }, + "serviceProxies": {}, + "vfModules": { + "iperf_vnf_2002_by59240..IperfVnf2002By5924..base..module-0": { + "uuid": "73c3470f-acb9-4180-bd60-31ff7aacc094", + "invariantUuid": "4a03b70b-85e3-4e67-a4ff-4123021c1278", + "customizationUuid": "949ceef3-366b-4e4e-b0f5-40eb1972ad56", + "description": null, + "name": "IperfVnf2002By5924..base..module-0", + "version": "1", + "modelCustomizationName": "IperfVnf2002By5924..base..module-0", + "properties": { + "minCountInstances": 1, + "maxCountInstances": 1, + "initialCount": 1, + "vfModuleLabel": "base", + "baseModule": true + }, + "inputs": {}, + "volumeGroupAllowed": false + } + }, + "volumeGroups": {}, + "pnfs": {}, + "vnfGroups": {}, + "vrfs": {} +}
\ No newline at end of file |