Adding unlimited max value to VNF, NETWORK
[vid.git] / vid-webpack-master / cypress / integration / iFrames / drawingBoard.e2e.ts
index e150b93..b678702 100644 (file)
@@ -4,15 +4,13 @@ import {ServiceModel} from "../../support/jsonBuilders/models/service.model";
 
 describe('Drawing board', function () {
   beforeEach(() => {
-    cy.window().then((win) => {
-      win.sessionStorage.clear();
+      cy.clearSessionStorage();
       cy.setReduxState();
       cy.preventErrorsOnLoading();
       cy.initAAIMock();
       cy.initVidMock();
       cy.initActiveNetworks();
       cy.login();
-    });
   });
 
   afterEach(() => {
@@ -22,12 +20,12 @@ describe('Drawing board', function () {
   describe('duplicate', () => {
 
     it('delete vf module reduce the number of vf modules ', function () {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+      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().then(() => {
+        cy.fillVnfPopup(true).then(() => {
           cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true});
           cy.fillVnfPopup().then(() => {
             cy.drawingBoardNumberOfExistingElementsShouldContains(2);
@@ -40,12 +38,12 @@ 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.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().then(() => {
+        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});
@@ -58,12 +56,12 @@ describe('Drawing board', function () {
     });
 
     it('duplicate vnf multi - should update number of vf modules on left side and disable duplicate when created max', () => {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+      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')
           .drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true});
-        cy.fillVnfPopup().then(() => {
+        cy.fillVnfPopup(true).then(() => {
           cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0')
             .drawingBoardTreeClickOnContextMenuOptionByName('Duplicate')
             .get('.quantity-select option').should('have.length', 9)
@@ -267,7 +265,7 @@ describe('Drawing board', function () {
     });
 
     xit('should display service model name', () => {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+      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.get('#service-model-name').contains('action-data');
@@ -275,7 +273,7 @@ describe('Drawing board', function () {
     });
 
     it('should display icon and message if no vnf and vnfModules', () => {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+      cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
         res.global.drawingBoardStatus = "CREATE";
         cy.setReduxState(<any>res);
         cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
@@ -290,7 +288,7 @@ describe('Drawing board', function () {
     });
 
     it('should show alert on remove vnf with modules', () => {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+      cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
         cy.setReduxState(<any>res);
         cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
         cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0');
@@ -309,7 +307,7 @@ describe('Drawing board', function () {
     });
 
     it('should not show alert on remove vnf without modules', () => {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+      cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
         cy.setReduxState(<any>res);
         cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
         cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-0903e1c0-8e03-4936-b5c2-260653b96413-2017-388_PASQUALE-vPE 1');
@@ -318,7 +316,7 @@ describe('Drawing board', function () {
     });
 
     it('should show <Automatically Assigned> if ecomp is true', () => {
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+      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-388_PASQUALE-vPE 0').click({force: true});
@@ -327,7 +325,7 @@ describe('Drawing board', function () {
         cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
         cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-testalexandria');
         cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP');
-        cy.selectDropdownOptionByText('platform', 'platform');
+        cy.selectPlatformValue('platform');
         cy.genericFormSubmitForm();
 
         cy.getElementByDataTestsId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_PASQUALE-vPE 0').contains('<Automatically Assigned>');
@@ -338,7 +336,7 @@ describe('Drawing board', function () {
     it('should show model name if ecomp is false', () => {
       const vnfModelKey: string = '2017-488_PASQUALE-vPE 0',
         vnfModelName: string = '2017-488_PASQUALE-vPE';
-      cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
+      cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
         res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs[vnfModelKey].properties.ecomp_generated_naming = 'false';
         cy.setReduxState(<any>res);
         cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
@@ -347,8 +345,9 @@ describe('Drawing board', function () {
         cy.selectDropdownOptionByText('productFamily', 'ERICA');
         cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
         cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-testalexandria');
-        cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP');
-        cy.selectDropdownOptionByText('platform', 'platform');
+        cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP')
+        cy.selectPlatformValue('platform');
+
         cy.genericFormSubmitForm();
 
         cy.getElementByDataTestsId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0').contains(vnfModelName);
@@ -358,7 +357,7 @@ describe('Drawing board', function () {
     describe('add instance open a popup', () => {
 
       it('should add vfModule with popup with empty required instance name', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties.ecomp_generated_naming = "false";
           res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules = [];
           cy.setReduxState(<any>res);
@@ -369,7 +368,7 @@ describe('Drawing board', function () {
       });
 
       it('should add vfModule with popup if empty required dynamic input', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1"].inputs["pasqualevpe0_bandwidth"].default = '';
           res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules = [];
           cy.setReduxState(<any>res);
@@ -385,7 +384,7 @@ describe('Drawing board', function () {
 
     describe('show warning and disable deploy button on vnf missing data', () => {
       it('show warning on vnf, and disable button, remove warning and enable button after edit', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/serviceWithVnfAndVfModules.json').then((res) => {
           res.service.serviceInstance['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].existingVNFCounterMap['0903e1c0-8e03-4936-b5c2-260653b96413'] = 1;
           res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].validationCounter = 1;
           res.service.serviceInstance["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-388_PASQUALE-vPE 1"] = {
@@ -426,7 +425,7 @@ describe('Drawing board', function () {
     describe('vnf should automatically displayed or not according its min value and its vf-modules min value', () => {
 
       it('vnf with min_instances value > 0 without required VF modules, should be created automatically without children', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties['min_instances'] = 1;
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"].properties['initialCount'] = 0;
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vfModules["2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0"].properties['initialCount'] = 0;
@@ -445,7 +444,7 @@ describe('Drawing board', function () {
       });
 
       it('vnf with min_instances value > 1 with required VF modules, should be created automatically with children only once', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties['min_instances'] = 3;
           cy.setReduxState(<any>res);
           cy.fillServicePopup().then(() => {
@@ -461,7 +460,7 @@ describe('Drawing board', function () {
 
 
       it('vnf with min_instances value = 0 with required VF modules should be created automatically with its children', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
           res.service.serviceHierarchy["2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd"].vnfs["2017-488_PASQUALE-vPE 0"].properties['min_instances'] = 0;
           cy.setReduxState(<any>res);
           cy.fillServicePopup().then(() => {
@@ -478,7 +477,7 @@ describe('Drawing board', function () {
 
 
       it('vnf without min_instances and without required VF modules, should not exist automatically in right side', () => {
-        cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
+        cy.readFile('cypress/support/jsonBuilders/mocks/jsons/basicRedux.json').then((res) => {
           cy.setReduxState(<any>res);
           cy.fillServicePopup().then(() => {
             cy.visit("welcome.htm").then(() => {
@@ -579,14 +578,13 @@ describe('Drawing board', function () {
         "flags": {
           "FLAG_SHOW_ASSIGNMENTS": true,
           "FLAG_SHOW_VERIFY_SERVICE": false,
-          "EMPTY_DRAWING_BOARD_TEST": false,
           "FLAG_ADD_MSO_TESTAPI_FIELD": true,
           "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
           "FLAG_SERVICE_MODEL_CACHE": true,
-          "CREATE_INSTANCE_TEST": false,
-          "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
-          "FLAG_1906_COMPONENT_INFO" : false
+          "FLAG_1906_COMPONENT_INFO" : false,
+          "FLAG_2002_VNF_PLATFORM_MULTI_SELECT" : false,
+          "FLAG_2002_UNLIMITED_MAX" : true
         },
         "type": "[FLAGS] Update"
       },
@@ -2213,9 +2211,6 @@ describe('Drawing board', function () {
           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
           "FLAG_SHOW_VERIFY_SERVICE": false,
           "FLAG_SERVICE_MODEL_CACHE": true,
-          "CREATE_INSTANCE_TEST": false,
-          "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true,
-          "EMPTY_DRAWING_BOARD_TEST": false,
           "FLAG_ADD_MSO_TESTAPI_FIELD": true
         },
         "type": "[FLAGS] Update"
@@ -3866,9 +3861,6 @@ describe('Drawing board', function () {
           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
           "FLAG_SHOW_VERIFY_SERVICE": false,
           "FLAG_SERVICE_MODEL_CACHE": true,
-          "CREATE_INSTANCE_TEST": false,
-          "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true,
-          "EMPTY_DRAWING_BOARD_TEST": false,
           "FLAG_ADD_MSO_TESTAPI_FIELD": true
         },
         "type": "[FLAGS] Update"
@@ -5605,7 +5597,6 @@ describe('Drawing board', function () {
         "name": null,
         "type": "UPDATE_DRAWING_BOARD_STATUS",
         "flags": {
-          "CREATE_INSTANCE_TEST": false,
           "EMPTY_DRAWING_BOARD_TEST": false,
           "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
           "FLAG_ADD_MSO_TESTAPI_FIELD": true,
@@ -5613,7 +5604,6 @@ describe('Drawing board', function () {
           "FLAG_SHOW_ASSIGNMENTS": true,
           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
           "FLAG_DEFAULT_VNF": true,
-          "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true,
           "FLAG_A_LA_CARTE_AUDIT_INFO": true,
           "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST": true,
           "FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS": true,
@@ -6305,9 +6295,6 @@ describe('Drawing board', function () {
           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
           "FLAG_SHOW_VERIFY_SERVICE": false,
           "FLAG_SERVICE_MODEL_CACHE": true,
-          "CREATE_INSTANCE_TEST": false,
-          "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
-          "EMPTY_DRAWING_BOARD_TEST": false,
           "FLAG_ADD_MSO_TESTAPI_FIELD": true,
           "FLAG_SUPPLEMENTARY_FILE": true
         },