add cypress test that verify deletion of the not upgraded vfm 22/104522/1
authorAlexey Sandler <alexey.sandler@intl.att.com>
Thu, 26 Mar 2020 17:03:47 +0000 (19:03 +0200)
committerAlexey Sandler <alexey.sandler@intl.att.com>
Thu, 26 Mar 2020 17:05:05 +0000 (19:05 +0200)
Issue-ID: VID-795
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: I9761ccdc3eb3bb06054ddaad06bc56ace9279e2b

vid-app-common/src/test/resources/payload_jsons/vfmodule/delete_vfmodule_expected_bulk.json [new file with mode: 0644]
vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_model.json [new file with mode: 0644]
vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_service_instance.json [new file with mode: 0644]

diff --git a/vid-app-common/src/test/resources/payload_jsons/vfmodule/delete_vfmodule_expected_bulk.json b/vid-app-common/src/test/resources/payload_jsons/vfmodule/delete_vfmodule_expected_bulk.json
new file mode 100644 (file)
index 0000000..2be0662
--- /dev/null
@@ -0,0 +1,117 @@
+{
+  "action": "None",
+  "isDirty": true,
+  "vnfs": {
+    "fa546506-b754-445c-b0d6-d36b6978de77": {
+      "action": "None",
+      "instanceName": "PST-Vf-Phase-1-Vnf",
+      "instanceId": "fa546506-b754-445c-b0d6-d36b6978de77",
+      "orchStatus": "Active",
+      "productFamilyId": null,
+      "lcpCloudRegionId": "olson5a",
+      "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08",
+      "cloudOwner": "irma-aic",
+      "modelInfo": {
+        "modelCustomizationName": "CHARLOTTE 01222020 0",
+        "modelCustomizationId": "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912",
+        "modelInvariantId": "2ef6541d-d5bb-41ea-bcce-8fb2396a74da",
+        "modelVersionId": "803fdb3e-b4c9-451c-a020-f15cd1fda041",
+        "modelName": "CHARLOTTE 01222020",
+        "modelType": "vnf",
+        "modelVersion": "1.0"
+      },
+      "instanceType": "CHARLOTTE 01222020 Svc/CHARLOTTE 01222020 0",
+      "provStatus": "PREPROV",
+      "inMaint": false,
+      "uuid": "803fdb3e-b4c9-451c-a020-f15cd1fda041",
+      "originalName": "CHARLOTTE 01222020 0",
+      "legacyRegion": null,
+      "lineOfBusiness": null,
+      "platformName": null,
+      "trackById": "fa546506-b754-445c-b0d6-d36b6978de77",
+      "vfModules": {
+        "mdns012220200..Mdns01222020..dns_az_01..module-1": {
+          "48b9c7ae-490c-44af-b4dc-09b133d2fb89": {
+            "action": "None_Delete",
+            "instanceName": "PST-Vf-Phase-1-Vf-Addon",
+            "instanceId": "48b9c7ae-490c-44af-b4dc-09b133d2fb89",
+            "orchStatus": "Active",
+            "productFamilyId": null,
+            "cloudOwner": "irma-aic",
+            "modelInfo": {
+              "modelCustomizationName": "Mdns01222020..dns_az_01..module-1",
+              "modelCustomizationId": "2f74b6b2-8627-403e-b696-4c43fe5b19a5",
+              "modelInvariantId": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0",
+              "modelVersionId": "c449aaf8-2467-41a9-9015-730ab48ca19b",
+              "modelName": "Mdns01222020..dns_az_01..module-1",
+              "modelType": "vfModule",
+              "modelVersion": "1"
+            },
+            "instanceType": null,
+            "provStatus": null,
+            "inMaint": false,
+            "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b",
+            "originalName": "mdns012220200..Mdns01222020..dns_az_01..module-1",
+            "legacyRegion": null,
+            "lineOfBusiness": null,
+            "platformName": null,
+            "trackById": "48b9c7ae-490c-44af-b4dc-09b133d2fb89",
+            "isBase": false,
+            "volumeGroupName": null,
+            "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08",
+            "lcpCloudRegionId": "olson5a"
+          }
+        }
+      },
+      "networks": {},
+      "vnfStoreKey": "fa546506-b754-445c-b0d6-d36b6978de77"
+    }
+  },
+  "vrfs": {},
+  "instanceParams": [],
+  "validationCounter": 0,
+  "existingNames": {
+    "pst-vf-phase-1": ""
+  },
+  "existingVNFCounterMap": {
+    "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912": 1
+  },
+  "existingVRFCounterMap": {},
+  "existingVnfGroupCounterMap": {},
+  "existingNetworksCounterMap": {},
+  "networks": {},
+  "vnfGroups": {},
+  "bulkSize": 1,
+  "instanceName": "PST-Vf-Phase-1",
+  "instanceId": "b153e8ce-2d00-4466-adc0-14bad70f150c",
+  "orchStatus": "Active",
+  "productFamilyId": null,
+  "lcpCloudRegionId": null,
+  "tenantId": null,
+  "cloudOwner": null,
+  "modelInfo": {
+    "modelInvariantId": "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6",
+    "modelVersionId": "a243da28-c11e-45a8-9f26-0284a9a789bc",
+    "modelName": "CHARLOTTE 01222020 Svc",
+    "modelType": "service",
+    "modelVersion": "3.0"
+  },
+  "globalSubscriberId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
+  "subscriptionServiceType": "Emanuel",
+  "owningEntityId": null,
+  "owningEntityName": null,
+  "tenantName": null,
+  "aicZoneId": null,
+  "aicZoneName": null,
+  "projectName": null,
+  "rollbackOnFailure": false,
+  "isALaCarte": true,
+  "collectionResources": {},
+  "testApi": "GR_API",
+  "vidNotions": {
+    "instantiationUI": "anyAlacarteWhichNotExcluded",
+    "modelCategory": "other",
+    "viewEditUI": "legacy",
+    "instantiationType": "ALaCarte"
+  }
+}
\ No newline at end of file
index cde41be..b949e66 100644 (file)
@@ -143,6 +143,49 @@ describe('View Edit Page: Upgrade VFModule', function () {
     afterEach(() => {
       cy.screenshot();
     });
+    it(`Delete not upgraded VFM`, () => {
+
+      const serviceType = 'Emanuel';
+      const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb';
+      const serviceModelId = 'a243da28-c11e-45a8-9f26-0284a9a789bc';
+      const serviceInstanceId = 'b153e8ce-2d00-4466-adc0-14bad70f150c';
+      const serviceInvariantUuid = "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6";
+
+      cy.initDrawingBoardUserPermission();
+      cy.route(`**/rest/models/services/${serviceModelId}`,
+        'fixture:../support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_model.json')
+      .as('serviceModel2');
+
+      cy.route(`**/aai_get_service_instance_topology/${subscriberId}/${serviceType}/${serviceInstanceId}`,
+        'fixture:../support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_service_instance.json')
+      .as('serviceInstance2');
+
+      cy.route(`**/aai_get_newest_model_version_by_invariant/${serviceInvariantUuid}`, {
+          "modelVersionId": "a243da28-c11e-45a8-9f26-0284a9a789bc",
+          "modelName": "CHARLOTTE 01222020 Svc",
+          "modelVersion": "4.0",
+          "distributionStatus": "DISTRIBUTION_COMPLETE_OK",
+          "resourceVersion": "1580246673596",
+          "modelDescription": "test model for VF module replacement",
+          "orchestrationType": null
+        }
+      ).as("newestModelVersion2");
+
+      cy.openIframe(`app/ui/#/servicePlanning/EDIT?serviceModelId=${serviceModelId}&subscriberId=${subscriberId}&serviceType=${serviceType}&serviceInstanceId=${serviceInstanceId}`);
+      cy.getElementByDataTestsId(`node-c449aaf8-2467-41a9-9015-730ab48ca19b-mdns012220200..Mdns01222020..dns_az_01..module-1-menu-btn`).click()
+      .drawingBoardTreeClickOnContextMenuOptionByName("Delete");
+      cy.getElementByDataTestsId('delete-status-type').contains('Delete');
+
+      mockAsyncBulkResponse();
+      cy.getDrawingBoardDeployBtn().click();
+
+      cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
+                    cy.readFile('../vid-app-common/src/test/resources/payload_jsons/vfmodule/delete_vfmodule_expected_bulk.json').then((expectedResult) => {
+                      cy.deepCompare(xhr.request.body, expectedResult);
+                    });
+                  });
+    });
+
     it(`Upgrade a VFModule: another case e2e`, function () {
 
       const serviceType = 'Emanuel';
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_model.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_model.json
new file mode 100644 (file)
index 0000000..8c94df0
--- /dev/null
@@ -0,0 +1,101 @@
+{
+  "service": {
+    "uuid": "a243da28-c11e-45a8-9f26-0284a9a789bc",
+    "invariantUuid": "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6",
+    "name": "CHARLOTTE 01222020 Svc",
+    "version": "3.0",
+    "toscaModelURL": null,
+    "category": "Emanuel",
+    "serviceType": "",
+    "serviceRole": "",
+    "description": "test model for VF module replacement",
+    "serviceEcompNaming": "true",
+    "instantiationType": "A-La-Carte",
+    "inputs": {},
+    "vidNotions": {
+      "instantiationUI": "anyAlacarteWhichNotExcluded",
+      "modelCategory": "other",
+      "viewEditUI": "legacy",
+      "instantiationType": "ALaCarte"
+    }
+  },
+  "vnfs": {
+    "CHARLOTTE 01222020 0": {
+      "uuid": "803fdb3e-b4c9-451c-a020-f15cd1fda041",
+      "invariantUuid": "2ef6541d-d5bb-41ea-bcce-8fb2396a74da",
+      "description": "VSP model for VF module replacement testing",
+      "name": "CHARLOTTE 01222020",
+      "version": "3.0",
+      "customizationUuid": "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912",
+      "inputs": {},
+      "commands": {},
+      "properties": {
+        "nf_naming": "{ecomp_generated_naming=true}",
+        "multi_stage_design": "false",
+        "nf_naming_code": "fapn",
+        "nf_function": "FIRSTNET-APN-DNS",
+        "availability_zone_max_count": "1",
+        "nf_role": "vAPNDNS",
+        "ecomp_generated_naming": "true",
+        "node_count": "4.0",
+        "dns_image_name": "16.04 for KVM VMs - NO TOOLS",
+        "nf_type": "DNS",
+        "route_eth0": "172.20.27.128/32 via 172.26.18.1 dev eth0 ",
+        "dns_flavor_name": "nv.c2r4d20"
+      },
+      "type": "VF",
+      "modelCustomizationName": "CHARLOTTE 01222020 0",
+      "vfModules": {
+        "mdns012220200..Mdns01222020..dns_az_01..module-1": {
+          "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b",
+          "invariantUuid": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0",
+          "customizationUuid": "2f74b6b2-8627-403e-b696-4c43fe5b19a5",
+          "description": null,
+          "name": "Mdns01222020..dns_az_01..module-1",
+          "version": "3",
+          "modelCustomizationName": "Mdns01222020..dns_az_01..module-1",
+          "properties": {
+            "minCountInstances": 0,
+            "maxCountInstances": null,
+            "initialCount": 0,
+            "vfModuleLabel": "dns_az_01",
+            "baseModule": false
+          },
+          "inputs": {},
+          "volumeGroupAllowed": false
+        }
+      },
+      "volumeGroups": {},
+      "vfcInstanceGroups": {}
+    }
+  },
+  "networks": {},
+  "collectionResources": {},
+  "configurations": {},
+  "fabricConfigurations": {},
+  "serviceProxies": {},
+  "vfModules": {
+    "mdns012220200..Mdns01222020..dns_az_01..module-1": {
+      "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b",
+      "invariantUuid": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0",
+      "customizationUuid": "2f74b6b2-8627-403e-b696-4c43fe5b19a5",
+      "description": null,
+      "name": "Mdns01222020..dns_az_01..module-1",
+      "version": "3",
+      "modelCustomizationName": "Mdns01222020..dns_az_01..module-1",
+      "properties": {
+        "minCountInstances": 0,
+        "maxCountInstances": null,
+        "initialCount": 0,
+        "vfModuleLabel": "dns_az_01",
+        "baseModule": false
+      },
+      "inputs": {},
+      "volumeGroupAllowed": false
+    }
+  },
+  "volumeGroups": {},
+  "pnfs": {},
+  "vnfGroups": {},
+  "vrfs": {}
+}
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_service_instance.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/deleteVfModule/delete_vfmodule_service_instance.json
new file mode 100644 (file)
index 0000000..0b00415
--- /dev/null
@@ -0,0 +1,101 @@
+{
+  "action": "None",
+  "instanceName": "PST-Vf-Phase-1",
+  "instanceId": "b153e8ce-2d00-4466-adc0-14bad70f150c",
+  "orchStatus": "Active",
+  "productFamilyId": null,
+  "lcpCloudRegionId": null,
+  "tenantId": null,
+  "cloudOwner": null,
+  "modelInfo": {
+    "modelInvariantId": "dd5a69b7-c50c-4dde-adc2-966b79bb8fd6",
+    "modelVersionId": "a243da28-c11e-45a8-9f26-0284a9a789bc",
+    "modelName": "CHARLOTTE 01222020 Svc",
+    "modelType": "service",
+    "modelVersion": "3.0"
+  },
+  "globalSubscriberId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
+  "subscriptionServiceType": "Emanuel",
+  "owningEntityId": null,
+  "owningEntityName": null,
+  "tenantName": null,
+  "aicZoneId": null,
+  "aicZoneName": null,
+  "projectName": null,
+  "rollbackOnFailure": null,
+  "isALaCarte": true,
+  "vnfs": {
+    "fa546506-b754-445c-b0d6-d36b6978de77": {
+      "action": "None",
+      "instanceName": "PST-Vf-Phase-1-Vnf",
+      "instanceId": "fa546506-b754-445c-b0d6-d36b6978de77",
+      "orchStatus": "Active",
+      "productFamilyId": null,
+      "lcpCloudRegionId": "olson5a",
+      "tenantId": "7ff7b1a4fe954f71ab79d3160ec3eb08",
+      "cloudOwner": "irma-aic",
+      "modelInfo": {
+        "modelCustomizationName": "CHARLOTTE 01222020 0",
+        "modelCustomizationId": "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912",
+        "modelInvariantId": "2ef6541d-d5bb-41ea-bcce-8fb2396a74da",
+        "modelVersionId": "803fdb3e-b4c9-451c-a020-f15cd1fda041",
+        "modelName": "CHARLOTTE 01222020",
+        "modelType": "vnf",
+        "modelVersion": "1.0"
+      },
+      "instanceType": "CHARLOTTE 01222020 Svc/CHARLOTTE 01222020 0",
+      "provStatus": "PREPROV",
+      "inMaint": false,
+      "uuid": "803fdb3e-b4c9-451c-a020-f15cd1fda041",
+      "originalName": "CHARLOTTE 01222020 0",
+      "legacyRegion": null,
+      "lineOfBusiness": null,
+      "platformName": null,
+      "trackById": "fa546506-b754-445c-b0d6-d36b6978de77",
+      "vfModules": {
+        "mdns012220200..Mdns01222020..dns_az_01..module-1": {
+          "48b9c7ae-490c-44af-b4dc-09b133d2fb89": {
+            "action": "None",
+            "instanceName": "PST-Vf-Phase-1-Vf-Addon",
+            "instanceId": "48b9c7ae-490c-44af-b4dc-09b133d2fb89",
+            "orchStatus": "Active",
+            "productFamilyId": null,
+            "cloudOwner": "irma-aic",
+            "modelInfo": {
+              "modelCustomizationName": "Mdns01222020..dns_az_01..module-1",
+              "modelCustomizationId": "2f74b6b2-8627-403e-b696-4c43fe5b19a5",
+              "modelInvariantId": "a60135d6-8e3d-47bc-87dd-f56d60d6beb0",
+              "modelVersionId": "c449aaf8-2467-41a9-9015-730ab48ca19b",
+              "modelName": "Mdns01222020..dns_az_01..module-1",
+              "modelType": "vfModule",
+              "modelVersion": "1"
+            },
+            "instanceType": null,
+            "provStatus": null,
+            "inMaint": false,
+            "uuid": "c449aaf8-2467-41a9-9015-730ab48ca19b",
+            "originalName": "mdns012220200..Mdns01222020..dns_az_01..module-1",
+            "legacyRegion": null,
+            "lineOfBusiness": null,
+            "platformName": null,
+            "trackById": "48b9c7ae-490c-44af-b4dc-09b133d2fb89",
+            "isBase": false,
+            "volumeGroupName": null
+          }
+        }
+      },
+      "networks": {}
+    }
+  },
+  "networks": {},
+  "vrfs": {},
+  "vnfGroups": {},
+  "collectionResources": {},
+  "validationCounter": 0,
+  "existingVNFCounterMap": {
+    "94ad4ac3-9c06-4bb3-9ac8-0714ef78a912": 1
+  },
+  "existingNetworksCounterMap": {},
+  "existingVnfGroupCounterMap": {},
+  "existingVRFCounterMap": {}
+}