summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/integration
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/cypress/integration')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts106
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts48
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/viewEdit.e2e.ts13
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts21
4 files changed, 164 insertions, 24 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
index dbb9bca4d..0075dc240 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
@@ -1,4 +1,5 @@
-import ObjectLike = Cypress.ObjectLike;
+import * as _ from "lodash";
+import {PropertyPath} from "lodash";
describe('Drawing Board: Instantiation Templates', function () {
@@ -6,7 +7,7 @@ describe('Drawing Board: Instantiation Templates', function () {
beforeEach(() => {
cy.clearSessionStorage();
- cy.setTestApiParamToVNF();
+ cy.setTestApiParamToGR();
cy.initAAIMock();
cy.initGetAAISubDetails();
cy.initVidMock();
@@ -31,13 +32,12 @@ describe('Drawing Board: Instantiation Templates', function () {
assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd();
});
- it('View a template’s details as expected', ()=> {
+ it('Given a stored template - when "edit" vnf and vfmodules are opened - then template’s details are visible as expected and deploy without changes', () => {
loadDrawingBoardWithRecreateMode();
// Then...
- cy.drawingBoardTreeOpenContextMenuByElementDataTestId("node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0")
- .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
+ editNode("node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0")
.getElementByDataTestsId("instanceName").should('have.value', 'hvf6arlba007')
.getElementByDataTestsId("productFamily").should('contain', 'Emanuel')
.getElementByDataTestsId("tenant").should('contain', 'DN5242-Nov21-T1')
@@ -47,27 +47,26 @@ describe('Drawing Board: Instantiation Templates', function () {
.checkPlatformValue('xxx1')
.getElementByDataTestsId("cancelButton").click();
- cy.drawingBoardTreeOpenContextMenuByElementDataTestId("node-c5b26cc1-a66f-4b69-aa23-6abc7c647c88-vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0")
- .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
+ editNode("node-c5b26cc1-a66f-4b69-aa23-6abc7c647c88-vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0")
.getElementByDataTestsId("instanceName").should('have.value', 'hvf6arlba007_lba_Base_01')
.getElementByDataTestsId("lcpRegion").should('contain', 'hvf6')
.getElementByDataTestsId("tenant").should('contain', 'DN5242-Nov21-T1')
.getElementByDataTestsId("rollback").should('contain', 'Rollback')
.getElementByDataTestsId("cancelButton").click();
- cy.drawingBoardTreeOpenContextMenuByElementDataTestId("node-c09e4530-8fd8-418f-9483-2f57ce927b05-vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1")
- .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
+ editNode("node-c09e4530-8fd8-418f-9483-2f57ce927b05-vprobe_nc_vnf0..VprobeNcVnf..FE_Add_On_Module_vlbagent_eph..module-1")
+ .getElementByDataTestsId("instanceName").should('have.value', 'my_hvf6arlba007_lba_dj_01')
+ .getElementByDataTestsId("volumeGroupName").should('have.value', 'my_special_hvf6arlba007_lba_dj_01_vol')
.getElementByDataTestsId("lcpRegion").should('contain', 'hvf6')
.getElementByDataTestsId("tenant").should('contain', 'DN5242-Nov21-T1')
.getElementByDataTestsId("rollback").should('contain', 'Rollback')
+ .getElementByDataTestsId("sdncPreLoad").should('have.value', 'on')
.getElementByDataTestsId("cancelButton").click();
-
-
assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd();
});
- it(`Edit the service`, function () {
+ it(`Given a stored template - when "edit" service is opened - then template’s details are visible as expected`, function () {
loadDrawingBoardWithRecreateMode();
@@ -80,13 +79,68 @@ describe('Drawing Board: Instantiation Templates', function () {
.getElementByDataTestsId("project").should('contain', 'WATKINS')
.getElementByDataTestsId("rollback").should('contain', 'Rollback');
+ });
+ [
+ {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 () {
+
+ loadDrawingBoardWithRecreateMode();
+
+ //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
+ 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
+ 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 vnfPath = [
+ "vnfs", "vProbe_NC_VNF 0"
+ ];
+ 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},
+ ] : []);
+ })
-
- });
});
+
});
});
+});
function loadDrawingBoardWithRecreateMode() {
const serviceModelId = '6cfeeb18-c2b0-49df-987a-da47493c8e38';
@@ -112,6 +166,11 @@ function loadDrawingBoardWithRecreateMode() {
cy.wait('@templateTopology');
}
+function editNode(dataTestId: string) {
+ return cy.drawingBoardTreeOpenContextMenuByElementDataTestId(dataTestId)
+ .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
+}
+
function assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd() {
cy.getDrawingBoardDeployBtn().click();
cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
@@ -124,6 +183,25 @@ function assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd() {
});
}
+
+function assertThatBodyFromDeployRequestEqualsToFile(deviationFromExpected: { path: PropertyPath, value: any }[] = []) {
+ cy.getDrawingBoardDeployBtn().click();
+ cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
+
+ cy.readFile('../vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify1.json').then((expectedResult) => {
+ setDeviationInExpected(expectedResult, deviationFromExpected);
+ cy.deepCompare(xhr.request.body, expectedResult);
+ });
+
+ });
+}
+
+function setDeviationInExpected(expectedResult: any, deviation: { path: PropertyPath; value: any }[]) {
+ for (const caveat of deviation) {
+ _.set(expectedResult, caveat.path, caveat.value);
+ }
+}
+
//We use this function because the deployService() on drawing-board-header.component class
// changes rollbackOnFailure value from string type to boolean.
function convertRollbackOnFailureValueFromStringToBoolean(expectedResult: any) {
diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
index 3caa4e81d..b2d3eb578 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation.templates.modal.e2e.ts
@@ -39,6 +39,44 @@ describe('Template', () => {
"serviceModelVersion": "1.0",
"createdBulkDate": 1525075968000,
"isRetryEnabled": true
+ },
+ {
+ "id": 7,
+ "created": 1525075968000,
+ "modified": 1525075971000,
+ "action": "INSTANTIATE",
+ "createdId": null,
+ "modifiedId": null,
+ "rowNum": null,
+ "auditUserId": null,
+ "auditTrail": null,
+ "jobId": "13063a83-924e-4500-a3a1-e53d1b58450b",
+ "templateId": "d42ba7c8-9e19-4e34-ae2c-d8af3f24498e",
+ "userId": "17807000",
+ "aLaCarte": false,
+ "msoRequestId": "c0011670-0e1a-4b74-945d-8bf5aede1d9d",
+ "jobStatus": "IN_PROGRESS",
+ "statusModifiedDate": 1525075968000,
+ "hidden": false,
+ "pause": false,
+ "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
+ "owningEntityName": "WayneHolland",
+ "project": "WATKINS",
+ "aicZoneId": "NFT1",
+ "aicZoneName": "NFTJSSSS-NFT1",
+ "tenantId": "bae71557c5bb4d5aac6743a4e5f1d054",
+ "tenantName": "AIN Web Tool-15-D-testalexandria",
+ "regionId": "hvf6",
+ "regionName": null,
+ "serviceType": "TYLER SILVIA",
+ "subscriberName": "e433710f-9217-458d-a79d-1c7aff376d89",
+ "serviceInstanceId": null,
+ "serviceInstanceName": "nWUfl instance name_001",
+ "serviceModelId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
+ "serviceModelName": "action-data",
+ "serviceModelVersion": "1.0",
+ "createdBulkDate": 1525075968000,
+ "isRetryEnabled": false
}
];
@@ -65,6 +103,7 @@ describe('Template', () => {
});
cy.route(Cypress.config('baseUrl') + "/asyncInstantiation**", asyncInstantiation);
+ cy.route(Cypress.config('baseUrl') + "/getuserID", '16807000');
cy.openIframe('/app/ui/#/servicePopup?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd&isCreate=true');
@@ -106,9 +145,14 @@ describe('Template', () => {
//check load button is disabled
- cy.getElementByDataTestsId('LoadTemplateButton').should('be.disabled')
+ cy.getElementByDataTestsId('LoadTemplateButton').should('be.disabled');
cy.getElementByDataTestsId('row-5c2cd8e5-27d0-42e3-85a1-85db5eaba459').click();
- cy.getElementByDataTestsId('LoadTemplateButton').should('not.be.disabled')
+ cy.getElementByDataTestsId('LoadTemplateButton').should('not.be.disabled');
+
+ //filter by userId
+ cy.get('.member-table-row').should('have.length', 2);
+ cy.getElementByDataTestsId('filterByUserIdTestId').click();
+ cy.get('.member-table-row').should('have.length', 1);
});
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEdit.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEdit.e2e.ts
index 40ba258bd..8421cbd69 100644
--- a/vid-webpack-master/cypress/integration/iFrames/viewEdit.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/viewEdit.e2e.ts
@@ -143,6 +143,7 @@ describe('View Edit Page', function () {
});
cy.initVidMock();
cy.mockLatestVersionForService(commonUuid, serviceInvariantId);
+ cy.initAAIServices();
cy.setReduxState();
cy.permissionVidMock();
cy.login();
@@ -166,6 +167,18 @@ describe('View Edit Page', function () {
});
});
+ it(`when using direct url should select elements in productFamily dropdown `, function () {
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=SILVIA%20ROBBINS&serviceType=TYLER%20SILVIA&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ cy.wait('@aai_getPortMirroringConfigsDate - empty response');
+ cy.wait('@initAAIServices');
+ cy.getElementByDataTestsId('addNetworkButton').click();
+ cy.getElementByDataTestsId('addNetworkOption-MULTI_PROVIDER_PORT_GROUP 0').click();
+ cy.getElementByDataTestsId('productFamily').select('WILKINS');
+ });
+
+
+
it(`Check fabric configuration service with some configuration with diff orchStatus`, function () {
cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=SILVIA%20ROBBINS&serviceType=TYLER%20SILVIA&serviceInstanceId=c187e9fe-40c3-4862-b73e-84ff056205f61234&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d671234&isPermitted=true');
cy.wait('@service-FabricConfig');
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
index 9f2499f3c..09734472c 100644
--- a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
@@ -100,20 +100,20 @@ describe('View Edit Page: Upgrade VFModule', function () {
`servicePlanning/EDIT?serviceModelId=${serviceUuid}&subscriberId=${SUBSCRIBER_ID}&serviceType=${SERVICE_TYPE}&serviceInstanceId=${SERVICE_INSTANCE_ID}`);
});
- it(`Upgrade a VFModule`, function () {
+ it(`Upgrade a VF Module`, function () {
cy.initDrawingBoardUserPermission();
initServicePlanning("EDIT",
'../vid-automation/src/test/resources/viewEdit/ServiceTreeWithMultipleChildren_serviceInstance_withUpdatedLatestVersion.json');
- upgradeTheVFM();
+ upgradeTheVFM('node-522159d5-d6e0-4c2a-aa44-5a542a12a830-vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1', true);
assertVfModuleActionInRedux("None_Upgrade");
undoUpgradeForVFM();
assertVfModuleActionInRedux("None");
- upgradeTheVFM();
+ upgradeTheVFM('node-522159d5-d6e0-4c2a-aa44-5a542a12a830-vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1',true);
cy.getDrawingBoardDeployBtn().click();
cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
const requestBody = Object(xhr.request.body);
const vfModuleRequest = requestBody.vnfs['VNF2_INSTANCE_ID'].vfModules['vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1']['2c1ca484-cbc2-408b-ab86-25a2c15ce280'];
- expect(requestBody.action).to.equal("None_Upgrade");
+ expect(requestBody.action).to.equal("None_Upgrade");
expect(requestBody.vnfs['VNF2_INSTANCE_ID'].action).to.equal("None_Upgrade");
expect(vfModuleRequest.action).to.equal("None_Upgrade");
});
@@ -129,7 +129,7 @@ describe('View Edit Page: Upgrade VFModule', function () {
});
- describe('More UI tests', () => {
+ describe('More UI test', () => {
beforeEach(() => {
cy.clearSessionStorage();
@@ -174,7 +174,7 @@ describe('View Edit Page: Upgrade VFModule', function () {
cy.openIframe(`app/ui/#/servicePlanning/EDIT?serviceModelId=${serviceModelId}&subscriberId=${subscriberId}&serviceType=${serviceType}&serviceInstanceId=${serviceInstanceId}`);
- upgradeTheVFM('node-04b21d26-9780-4956-8329-b22b049329f4-xbitestmodulereplace0..XbiTestModuleReplace..base_ocg..module-0');
+ upgradeTheVFM('node-04b21d26-9780-4956-8329-b22b049329f4-xbitestmodulereplace0..XbiTestModuleReplace..base_ocg..module-0', false);
mockAsyncBulkResponse();
cy.getDrawingBoardDeployBtn().click();
@@ -213,13 +213,18 @@ describe('View Edit Page: Upgrade VFModule', function () {
}).as("expectLatestServiceModelUpgradeVersion");
}
- function upgradeTheVFM(treeNodeId = 'node-522159d5-d6e0-4c2a-aa44-5a542a12a830-vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1') {
+ function upgradeTheVFM(treeNodeId: string, shouldVGCheckboxExist :boolean) {
cy.getElementByDataTestsId(`${treeNodeId}-menu-btn`).click()
.drawingBoardTreeClickOnContextMenuOptionByName("Upgrade");
// The following is needed when enabling FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS
cy.getElementByDataTestsId('retainAssignments').click();
- cy.getElementByDataTestsId('retainVolumeGroups').click();
+ if (shouldVGCheckboxExist) {
+ cy.getElementByDataTestsId('retainVolumeGroups').click();
+ }
+ else {
+ cy.getElementByDataTestsId('retainVolumeGroups').should('not.exist');
+ }
cy.getElementByDataTestsId('sdncPreLoad').click();
cy.screenshot();
cy.getElementByDataTestsId('form-set').click();