aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/cypress')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts2
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/vnfGroups.e2e.ts38
-rw-r--r--vid-webpack-master/cypress/support/application/application.session.actions.ts35
3 files changed, 39 insertions, 36 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
index 87875f1ba..ac5790ddf 100644
--- a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts
@@ -16,6 +16,8 @@ export const initServicePlanning = function (viewOrEdit: string, customModelFile
}
cy.readFile('../vid-automation/src/test/resources/aaiGetInstanceTopology/ServiceTreeWithMultipleChildren_serviceModel.json').then((res) => {
+ res.service.instantiationType = "A-La-Carte";
+ res.service.vidNotions.instantiationType = "ALaCarte";
jsonBuilderAndMock.basicJson(
res,
Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d674c44",
diff --git a/vid-webpack-master/cypress/integration/iFrames/vnfGroups.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/vnfGroups.e2e.ts
index 60fbfeaba..a0882f5bf 100644
--- a/vid-webpack-master/cypress/integration/iFrames/vnfGroups.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/vnfGroups.e2e.ts
@@ -20,6 +20,42 @@ describe('Vnf Groups', function () {
cy.screenshot();
});
+ function updateObject(obj: any, key: string, val: any, value:any) {
+ return JSON.parse(JSON.stringify(obj)
+ .replace(new RegExp(`"${key}":"${val}"`), `"${key}":"${value}"`))
+ }
+
+ function buildReduxStateWithServiceRespone(res: any, serviceId:string, isEcompGeneratedNaming:boolean) :void {
+ res = updateObject(res, "ecomp_generated_naming", !isEcompGeneratedNaming, isEcompGeneratedNaming);
+ cy.window().then((win) => {
+ win.sessionStorage.setItem('reduxState', JSON.stringify({
+ "global": {
+ "name": null
+ },
+ "service": {
+ "serviceHierarchy": {
+ [serviceId] : res
+ },
+ "serviceInstance": {
+ [serviceId]: {
+ "modelInfo" : {
+ "modelVersionId" : serviceId
+ },
+ "existingVNFCounterMap": {},
+ "existingVnfGroupCounterMap": {},
+ "existingNetworksCounterMap": {},
+ "vnfs": {},
+ "vnfGroups": {},
+ "isEcompGeneratedNaming": isEcompGeneratedNaming,
+ "existingNames": {},
+ "vidNotions": res.service.vidNotions
+ }
+ }
+ }
+ }));
+ });
+ }
+
describe('Vnf Group model basic view', function () {
it('Vnf group open new view edit', function () {
@@ -36,7 +72,7 @@ describe('Vnf Groups', function () {
"ServiceWithVnfGroup",
);
- cy.buildReduxStateWithServiceRespone(res, serviceId, false);
+ buildReduxStateWithServiceRespone(res, serviceId, false);
cy.openIframe('app/ui/#/servicePlanning?serviceModelId=' + serviceId);
cy.getElementByDataTestsId('node-' + groupName).find(`[data-tests-id='node-type-indicator']`).contains('G');
cy.getElementByDataTestsId('node-' + groupName).contains('' + groupName);
diff --git a/vid-webpack-master/cypress/support/application/application.session.actions.ts b/vid-webpack-master/cypress/support/application/application.session.actions.ts
index c054b2640..9126ae1a4 100644
--- a/vid-webpack-master/cypress/support/application/application.session.actions.ts
+++ b/vid-webpack-master/cypress/support/application/application.session.actions.ts
@@ -5,7 +5,6 @@ declare namespace Cypress {
clearSessionStorage: typeof clearSessionStorage;
setTestApiParamToGR: typeof setTestApiParamToGR;
setTestApiParamToVNF: typeof setTestApiParamToVNF;
- buildReduxStateWithServiceRespone: typeof buildReduxStateWithServiceRespone;
}
}
@@ -44,42 +43,8 @@ function setTestApiParamToVNF() : void {
});
}
-function updateObject(obj: any, key: string, val: any, value:any) {
- return JSON.parse(JSON.stringify(obj)
- .replace(new RegExp(`"${key}":"${val}"`), `"${key}":"${value}"`))
-}
-
-function buildReduxStateWithServiceRespone(res: any, serviceId:string, isEcompGeneratedNaming:boolean) :void {
- res = updateObject(res, "ecomp_generated_naming", !isEcompGeneratedNaming, isEcompGeneratedNaming);
- cy.window().then((win) => {
- win.sessionStorage.setItem('reduxState', JSON.stringify({
- "global": {
- "name": null
- },
- "service": {
- "serviceHierarchy": {
- [serviceId] : res
- },
- "serviceInstance": {
- [serviceId]: {
- "existingVNFCounterMap": {},
- "existingVnfGroupCounterMap": {},
- "existingNetworksCounterMap": {},
- "vnfs": {},
- "vnfGroups": {},
- "isEcompGeneratedNaming": isEcompGeneratedNaming,
- "existingNames": {},
- "vidNotions": res.service.vidNotions
- }
- }
- }
- }));
- });
-}
-
Cypress.Commands.add('setReduxState', setReduxState);
Cypress.Commands.add('getReduxState', getReduxState);
Cypress.Commands.add('clearSessionStorage', clearSessionStorage);
Cypress.Commands.add('setTestApiParamToGR', setTestApiParamToGR);
Cypress.Commands.add('setTestApiParamToVNF',setTestApiParamToVNF);
-Cypress.Commands.add('buildReduxStateWithServiceRespone', buildReduxStateWithServiceRespone);