aboutsummaryrefslogtreecommitdiffstats
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/ala-carte.e2e.ts30
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts57
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts92
3 files changed, 109 insertions, 70 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
index 1c91d02ca..fa628d4b5 100644
--- a/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
@@ -2,7 +2,6 @@
/// <reference types="Cypress" />
import {JsonBuilder} from '../../support/jsonBuilders/jsonBuilder';
import {ServiceModel} from '../../support/jsonBuilders/models/service.model';
-import * as _ from 'lodash';
describe('A la carte', function () {
describe('check service name', () => {
@@ -242,11 +241,11 @@ describe('A la carte', function () {
'2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vPFE_BV..module-2',
];
- addVfModule(vnfName, vfModulesNames[0], 'mimazepubi', 'hvf6', '', 'AINWebTool-15-D-iftach', false, false, false)
+ cy.addALaCarteVfModule(vnfName, vfModulesNames[0], 'mimazepubi', 'hvf6', '', 'AINWebTool-15-D-iftach', false, false, false)
.then(() => {
- addVfModule(vnfName, vfModulesNames[1], 'puwesovabe', 'AAIAIC25', 'my region', 'USP-SIP-IC-24335-T-01', true, true, false)
+ cy.addALaCarteVfModule(vnfName, vfModulesNames[1], 'puwesovabe', 'AAIAIC25', 'my region', 'USP-SIP-IC-24335-T-01', true, true, false)
.then(() => {
- addVfModule(vnfName, vfModulesNames[2], 'bnmgtrx', 'hvf6', '', 'AINWebTool-15-D-iftach', false, false, true)
+ cy.addALaCarteVfModule(vnfName, vfModulesNames[2], 'bnmgtrx', 'hvf6', '', 'AINWebTool-15-D-iftach', false, false, true)
.then(() => {
cy.getReduxState().then((state) => {
const vfModules = state.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs[vnfName].vfModules;
@@ -284,28 +283,7 @@ describe('A la carte', function () {
.get('.error').contains(INSTANCE_NAME_NOT_MANDATORY_MESSAGE);
}
- function addVfModule(vnfName: string, vfModuleName: string, instanceName: string, lcpRegion: string, legacyRegion: string, tenant: string, rollback: boolean, sdncPreLoad: boolean, deleteVgName: boolean): Chainable<any> {
- return cy.getElementByDataTestsId('node-' + vnfName).click({force: true}).then(() => {
- cy.getElementByDataTestsId('node-' + vfModuleName + '-add-btn').click({force: true}).then(() => {
- cy.getElementByDataTestsId('instanceName').clear().type(instanceName, {force: true}).then(() => {
- if (deleteVgName) {
- cy.getElementByDataTestsId('volumeGroupName').clear();
- }
- }).then(() => {
- cy.selectDropdownOptionByText('lcpRegion', lcpRegion);
- if (!_.isEmpty(legacyRegion)) {
- cy.typeToInput("lcpRegionText", legacyRegion);
- }
- cy.selectDropdownOptionByText('tenant', tenant);
- cy.selectDropdownOptionByText('rollback', String(rollback));
- if (sdncPreLoad) {
- cy.getElementByDataTestsId('sdncPreLoad').check();
- }
- cy.getElementByDataTestsId('form-set').click({force: true});
- });
- });
- });
- }
+
});
diff --git a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
index b678702ff..133dbe72a 100644
--- a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
@@ -17,6 +17,22 @@ describe('Drawing board', function () {
cy.screenshot();
});
+ function addSameVnfMultipleTimes() {
+ cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
+ const vnfNodeName = 'node-2017-488_PASQUALE-vPE 0';
+ cy.drawingBoardPressAddButtonByElementName(vnfNodeName).get('i').should('have.class', 'fa-plus-circle');
+ cy.drawingBoardPressAddButtonByElementName(vnfNodeName).click({force: true});
+ cy.fillVnfPopup(true).then(() => {
+ cy.drawingBoardPressAddButtonByElementName(vnfNodeName).click({force: true});
+ cy.fillVnfPopup().then(() => {
+ cy.drawingBoardPressAddButtonByElementName(vnfNodeName).click({force: true});
+ cy.fillVnfPopup().then(() => {
+ cy.drawingBoardNumberOfExistingElementsShouldContains(3);
+ });
+ });
+ });
+ }
+
describe('duplicate', () => {
it('delete vf module reduce the number of vf modules ', function () {
@@ -40,18 +56,7 @@ describe('Drawing board', function () {
it('create new vf module update the number of vf modules ', () => {
cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
cy.setReduxState(<any>res);
- cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
- cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle');
- cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true});
- cy.fillVnfPopup(true).then(() => {
- cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true});
- cy.fillVnfPopup().then(() => {
- cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true});
- cy.fillVnfPopup().then(() => {
- cy.drawingBoardNumberOfExistingElementsShouldContains(3);
- });
- });
- });
+ addSameVnfMultipleTimes();
});
});
@@ -238,6 +243,32 @@ describe('Drawing board', function () {
});
+ describe('default max instances value', () => {
+
+ it('when there is no maxCountInstances for vfModule, it can be added unlimited times', () => {
+ let reduxState = getReduxWithVNFS(false);
+ (<any> reduxState.global.flags)['FLAG_2002_UNLIMITED_MAX'] = true;
+ cy.setReduxState(<any>reduxState);
+ cy.openIframe('app/ui/#/servicePlanning?serviceModelId=6e59c5de-f052-46fa-aa7e-2fca9d674c44');
+ const vfModuleName = 'vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2';
+ const vnfName = "VF_vGeraldine 0";
+ cy.addMacroVfModule(vnfName, vfModuleName, 'module-1');
+ cy.addMacroVfModule(vnfName, vfModuleName, 'module-2');
+ cy.addMacroVfModule(vnfName, vfModuleName, 'module-3');
+ cy.getElementByDataTestsId('node-d6557200-ecf2-4641-8094-5393ae3aae60-VF_vGeraldine 0').click();
+ cy.getElementByDataTestsId('node-41708296-e443-4c71-953f-d9a010f059e1-vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2').should('have.length', 3);
+ });
+
+ it('when there is no max_instances for VNF, it can be added multiple times ', () => {
+ cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxState) => {
+ reduxState.global['flags'] = { 'FLAG_2002_UNLIMITED_MAX' : true };
+ delete reduxState.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].properties.max_instances;
+ cy.setReduxState(<any>reduxState);
+ addSameVnfMultipleTimes();
+ });
+ });
+ });
+
describe('multiple tests', () => {
it('remove vfModule with missing data should update deploy button status', () => {
let res = getReduxWithVFModuleMissingData();
@@ -6285,7 +6316,7 @@ describe('Drawing board', function () {
}
}
- function getReduxWithVNFS(isEcompGeneratedNaming: boolean) {
+ function getReduxWithVNFS(isEcompGeneratedNaming: boolean){
return {
"global": {
"name": null,
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 8eb70b1fe..afad68747 100644
--- a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
@@ -1,10 +1,13 @@
+import ObjectLike = Cypress.ObjectLike;
+
describe('Drawing Board: Instantiation Templates', function () {
- describe('Load Page and Deploy', () => {
+ describe('Instantiation templates ', () => {
beforeEach(() => {
cy.clearSessionStorage();
cy.setTestApiParamToVNF();
+ cy.initAAIMock();
cy.initVidMock();
cy.initDrawingBoardUserPermission();
cy.login();
@@ -16,41 +19,28 @@ describe('Drawing Board: Instantiation Templates', function () {
cy.screenshot();
});
- it(`Given a stored template - when click "deploy" - then a coherent request should be sent upon deploy`, function () {
- const serviceModelId = '6cfeeb18-c2b0-49df-987a-da47493c8e38';
- const templateUuid = "46390edd-7100-46b2-9f18-419bd24fb60b";
-
- const drawingBoardAction = `RECREATE`;
- const templateTopologyEndpoint = "templateTopology";
-
- // Given...
+ describe('Load Page and Deploy', () => {
- cy.route(`**/rest/models/services/${serviceModelId}`,
- 'fixture:../support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__service_model.json')
- .as('serviceModel');
+ it(`Given a stored template - when click "deploy" - then a coherent request should be sent upon deploy`, function () {
- cy.route(`**/asyncInstantiation/${templateTopologyEndpoint}/${templateUuid}`,
- 'fixture:../../../vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json')
- .as('templateTopology');
+ loadDrawingBoardWithRecreateMode();
- // When...
-
- cy.openIframe(`app/ui/#/servicePlanning/${drawingBoardAction}` +
- `?jobId=${templateUuid}` +
- `&serviceModelId=${serviceModelId}`);
+ // Then...
+ cy.getElementByDataTestsId("node-vProbe_NC_VNF 0").should('be.visible');
+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd();
+ });
- cy.wait('@serviceModel');
- cy.wait('@templateTopology');
- cy.getElementByDataTestsId("node-vProbe_NC_VNF 0").should('be.visible');
+ it('View a template’s details as expected', ()=> {
- cy.getDrawingBoardDeployBtn().click();
+ loadDrawingBoardWithRecreateMode();
- // Then...
+ // Then...
+ cy.drawingBoardTreeOpenContextMenuByElementDataTestId("node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0")
+ .drawingBoardTreeClickOnContextMenuOptionByName('Edit')
+ .getElementByDataTestsId("lcpRegion").should('contain', 'hvf6')
+ .getElementByDataTestsId("cancelButton").click();
- cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
- cy.readFile('../vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json').then((expectedResult) => {
- convertRollbackOnFailureValueFromStringToBoolean(expectedResult);
- cy.deepCompare(xhr.request.body, expectedResult);
+ assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd();
});
});
@@ -58,12 +48,54 @@ describe('Drawing Board: Instantiation Templates', function () {
});
+function loadDrawingBoardWithRecreateMode() {
+ const serviceModelId = '6cfeeb18-c2b0-49df-987a-da47493c8e38';
+ const templateUuid = "46390edd-7100-46b2-9f18-419bd24fb60b";
+
+ const drawingBoardAction = `RECREATE`;
+ const templateTopologyEndpoint = "templateTopology";
+ cy.route(`**/rest/models/services/${serviceModelId}`,
+ 'fixture:../support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__service_model.json')
+ .as('serviceModel');
+
+ cy.route(`**/asyncInstantiation/${templateTopologyEndpoint}/${templateUuid}`,
+ 'fixture:../../../vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json')
+ .as('templateTopology');
+
+ // When...
+
+ cy.openIframe(`app/ui/#/servicePlanning/${drawingBoardAction}` +
+ `?jobId=${templateUuid}` +
+ `&serviceModelId=${serviceModelId}`);
+
+ cy.wait('@serviceModel');
+ cy.wait('@templateTopology');
+}
+
+function assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd() {
+ cy.getDrawingBoardDeployBtn().click();
+ cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
+ cy.readFile('../vid-automation/src/test/resources/asyncInstantiation/templates__instance_template.json').then((expectedResult) => {
+ convertRollbackOnFailureValueFromStringToBoolean(expectedResult);
+
+ let xhrBodyWithoutIsDirtyField = removeIsDirtyFieldFromXhrRequestBody(xhr);
+ cy.deepCompare(xhrBodyWithoutIsDirtyField, expectedResult);
+ });
+ });
+}
+
//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) {
expectedResult.rollbackOnFailure = Boolean(expectedResult.rollbackOnFailure);
}
+function removeIsDirtyFieldFromXhrRequestBody(xhr : any) {
+ let xhrTempBody = JSON.parse(JSON.stringify(xhr.request.body));
+ delete xhrTempBody.isDirty;
+ return xhrTempBody;
+}
+
function mockAsyncBulkResponse() {
cy.server().route({
url: Cypress.config('baseUrl') + '/asyncInstantiation/bulk',
@@ -72,5 +104,3 @@ describe('Drawing Board: Instantiation Templates', function () {
response: "[]",
}).as("expectedPostAsyncInstantiation");
}
-
-});