allow LOB multi-selection for vnf - fix cypress
[vid.git] / vid-webpack-master / cypress / integration / iFrames / ala-carte.e2e.ts
index 4988ec8..4ececb0 100644 (file)
@@ -92,6 +92,7 @@ describe('A la carte', function () {
     it(`VNF a-la-carte`, () => {
       cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json').then((res) => {
         res['FLAG_2002_VNF_PLATFORM_MULTI_SELECT'] = true;
+        res['FLAG_2006_VNF_LOB_MULTI_SELECT'] = true;
         cy.server()
           .route({
             method: 'GET',
@@ -134,9 +135,9 @@ describe('A la carte', function () {
             cy.selectDropdownOptionByText('lcpRegion', 'AAIAIC25');
             cy.typeToInput("lcpRegionText", "just another region");
             cy.selectDropdownOptionByText('tenant', 'USP-SIP-IC-24335-T-01');
-            cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
+            cy.selectLobValue('zzz1');
 
-            cy.selectPlatformValue('xxx1');
+            cy.selectPlatformValue(`xxx1`);
 
             cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
 
@@ -144,7 +145,8 @@ describe('A la carte', function () {
 
               cy.getElementByDataTestsId(vnfMenuBtnDataTestId).click({force: true}).then(() => {
                 cy.getElementByDataTestsId('context-menu-edit').click({force: true});
-                cy.selectPlatformValue('platform');
+                cy.selectPlatformValue(`platform`);
+                cy.selectLobValue('ONAP');
                 cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
                   cy.getReduxState().then((state) => {
 
@@ -195,11 +197,11 @@ describe('A la carte', function () {
         cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
         cy.getElementByDataTestsId("node-ExtVL 0-add-btn").click({force: true});
 
-        cy.selectPlatformValue("xxx1");
+        cy.selectPlatformValue(`xxx1`);
         cy.selectDropdownOptionByText("lcpRegion", "AAIAIC25");
         cy.selectDropdownOptionByText("tenant", "USP-SIP-IC-24335-T-01");
         cy.selectDropdownOptionByText("productFamily", "ERICA");
-        cy.selectDropdownOptionByText("lineOfBusiness", "zzz1");
+        cy.selectMultiselectValue("multi-lineOfBusiness", "multi-lineOfBusiness-zzz1");
         cy.typeToInput("lcpRegionText", "lcpRegionText");
 
         cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
@@ -215,35 +217,6 @@ describe('A la carte', function () {
       });
     });
 
-    it(`Add ALaCarte vnf where FLAG_2006_LCP_REGIONS_BY_LINE_OF_BUSINESS`, () => {
-      cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => {
-        cy.setTestApiParamToGR();
-        res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.vidNotions.instantiationType = 'ALaCarte';
-        res.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].service.inputs = null;
-        res.global['flags'] = {'FLAG_2006_LCP_REGIONS_BY_LINE_OF_BUSINESS': true};
-        cy.setReduxState(<any>res);
-        cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd');
-
-        cy.getElementByDataTestsId('node-2017-488_PASQUALE-vPE 0-add-btn').click({force: true}).then(() => {
-          cy.selectDropdownOptionByText('productFamily', 'Emanuel');
-          cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
-          cy.selectDropdownOptionByText('lcpRegion', 'foo-name');
-          cy.selectDropdownOptionByText('tenant', 'tenantID');
-          cy.selectPlatformValue('xxx1');
-          cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
-            const vnfMenuBtnDataTestId = 'node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0-menu-btn';
-
-            cy.getElementByDataTestsId(vnfMenuBtnDataTestId).click({force: true}).then(() => {
-              cy.getElementByDataTestsId('context-menu-edit').click({force: true})
-              .getElementByDataTestsId("lineOfBusiness").should('contain', 'zzz1')
-              .getElementByDataTestsId("lcpRegion").should('contain', 'foo-name')
-              .getElementByDataTestsId("tenant").should('contain', 'tenantName')
-            });
-          });
-        })
-      });
-    });
-
     it(`Add ALaCarte VfModule Without LcpRegion Tenant Id And Legacy`, () => {
       addAlacarteVfmoduleByFlag(true, 'redux-a-la-carte-no-lcp-tenant.json');
     });
@@ -265,8 +238,8 @@ describe('A la carte', function () {
           cy.selectDropdownOptionByText('productFamily', 'Emanuel');
           cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
           cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
-          cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
-          cy.selectPlatformValue('xxx1');
+          cy.selectLobValue('zzz1');
+          cy.selectPlatformValue(`xxx1`);
           cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
             const vnfName = '2017-488_PASQUALE-vPE 0';
             let vfModulesNames: Array<string> = [