+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd([
+ {path: [...vnfPath, "vnfStoreKey"], value: "vProbe_NC_VNF 0"}, // side-effect
+ {path: [...vnfPath2, "vnfStoreKey"], value: "vProbe_NC_VNF 0_1"},
+ {path: [...removed_vfModule_Path], value: undefined},
+ ]);
+ });
+
+ [
+ {desc: "with changes", modifySomeValues: true},
+ {desc: "without changes", modifySomeValues: false},
+ ].forEach((testCase) => {
+
+ it(`Given a stored template - edit service vnf and vfmodule ${testCase.desc} - deploy request should be ${testCase.desc}`, function () {
+
+ cy.loadDrawingBoardWithRecreateMode(templateWithVnfSetup);
+
+ //edit service
+ cy.openServiceContextMenu();
+ cy.getElementByDataTestsId("context-menu-header-edit-item").click();
+ if (testCase.modifySomeValues) {
+ cy.clearInput("instanceName");
+ cy.typeToInput("instanceName", "different.instance.name");
+ }
+ cy.getElementByDataTestsId('form-set').click();
+
+ // edit vnf
+ cy.editNode("node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0");
+ if (testCase.modifySomeValues) {
+ cy.selectPlatformValue('platform');
+ cy.selectDropdownOptionByText("tenant", "CESAR-100-D-spjg61909");
+ }
+ cy.getElementByDataTestsId('form-set').click();
+
+ //edit vf module
+ cy.editNode("node-c5b26cc1-a66f-4b69-aa23-6abc7c647c88-vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0");
+ if (testCase.modifySomeValues) {
+ cy.getElementByDataTestsId('sdncPreLoad').click();
+ }
+ cy.getElementByDataTestsId('form-set').click();
+
+ // Then...
+ let vfModule_0Path = [
+ ...vnfPath, "vfModules",
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0",
+ "vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0ahubg",
+ ];
+
+ assertThatBodyFromDeployRequestEqualsToFile(testCase.modifySomeValues ? [
+ {path: ["instanceName"], value: "different.instance.name"},
+ {path: ["existingNames", "vprobe_nc_service_dg_new_si"], value: undefined},
+ {path: ["existingNames", "different.instance.name"], value: ""},
+
+ {path: [...vnfPath, "platformName"], value: "xxx1,platform"},
+ {path: [...vnfPath, "tenantId"], value: "f2f3830e4c984d45bcd00e1a04158a79"},
+
+ {path: [...vfModule_0Path, "sdncPreLoad"], value: true},
+ ] : []);
+ })
+
+ });
+
+ it(`Given a stored template of Network - - it is loaded`, () => {
+
+ cy.loadDrawingBoardWithRecreateModeNetwork(templateWithNetworkSetup);
+
+ // Then...
+ cy.getElementByDataTestsId("node-SR-IOV Provider 2-1").should('be.visible');
+ cy.getElementByDataTestsId("node-SR-IOV Provider 2-2").should('be.visible');
+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd_network();
+ });
+
+ it(`Given a stored template of Network - User can remove existing network`, () => {
+
+ cy.loadDrawingBoardWithRecreateModeNetwork(templateWithNetworkSetup);
+
+ cy.nodeAction('node-01f4c475-3f89-4f00-a2f4-39a873dba0ae-SR-IOV Provider 2-1', 'Remove');
+ let removed_network_Path = [
+ "networks", "SR-IOV Provider 2-1",
+ ];
+
+ let removed_network_counter_Path = [
+ "existingNetworksCounterMap", "f6b6d141-0d4c-427d-ad35-797f3d1abe71",
+ ];
+
+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd_network([
+ {path: removed_network_Path, value: undefined},
+ {path: removed_network_counter_Path, value: 0},
+ ]);
+ });
+
+ it('Given a template - User can add a new network', () => {
+
+ cy.loadDrawingBoardWithRecreateModeNetwork(templateWithNetworkSetup);
+
+ // add new node
+ addNewNode('node-SR-IOV Provider 2-1-add-btn')
+ .fillNetworkPopup()
+ .getDrawingBoardDeployBtn().click()
+ .wait('@expectedPostAsyncInstantiation').then(xhr => {
+ const networkRequest = bodyOf(xhr).networks['SR-IOV Provider 2-1_1'];
+
+ expect(networkRequest.action).equals("Create");
+ expect(networkRequest.rollbackOnFailure).equals("true");
+ expect(networkRequest.originalName).equals("SR-IOV Provider 2-1");
+ expect(networkRequest.productFamilyId).equals("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
+ expect(networkRequest.lcpCloudRegionId).equals("hvf6");
+ expect(networkRequest.lineOfBusiness).equals("zzz1");
+ expect(networkRequest.platformName).equals("xxx1");
+ expect(networkRequest.tenantId).equals("229bcdc6eaeb4ca59d55221141d01f8e");
+ });