allow LOB multi-selection for network 54/103754/6
authorEinat Vinouze <einat.vinouze@intl.att.com>
Mon, 16 Mar 2020 17:08:22 +0000 (19:08 +0200)
committerEinat Vinouze <einat.vinouze@intl.att.com>
Wed, 18 Mar 2020 08:58:23 +0000 (10:58 +0200)
Issue-ID: VID-788
Change-Id: I03674ea0c04567291ba647c76b7c88bc11a7cf0e
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
15 files changed:
vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateNetworkALaCarteServiceCypress2.java
vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java
vid-automation/src/test/java/org/onap/vid/api/AsyncInstantiationALaCarteApiTest3.java
vid-automation/src/test/resources/asyncInstantiation/vidRequestDelete1Create1Network.json
vid-webpack-master/cypress/integration/iFrames/ala-carte.e2e.ts
vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts
vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts
vid-webpack-master/cypress/integration/iFrames/network.popup.e2e.ts
vid-webpack-master/cypress/integration/iFrames/vnf.popup.e2e.ts
vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json
vid-webpack-master/cypress/support/steps/fill.network.step.ts
vid-webpack-master/cypress/support/steps/fill.vnf.popup.step.ts
vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/networkGenerator/network.control.generator.ts
vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.ts

index b7f629c..2df43b8 100644 (file)
@@ -6,21 +6,25 @@ public class PresetMSOCreateNetworkALaCarteServiceCypress2 extends PresetMSOBase
     private String serviceModelName;
     private String serviceModelVersionId;
     private String platformName;
+    private String lineOfBusinessName;
+
 
 
     public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId, String networkName) {
         this(overrideRequestId, serviceInstanceId, networkName, "ComplexService", "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
-            "xxx1");
+            "xxx1", "zzz1");
     }
 
     public PresetMSOCreateNetworkALaCarteServiceCypress2(String overrideRequestId, String serviceInstanceId,
-        String networkName, String serviceModelName, String serviceModelVersionId, String platformName) {
+        String networkName, String serviceModelName, String serviceModelVersionId, String platformName,
+        String lineOfBusinessName) {
         super(overrideRequestId);
         this.serviceInstanceId = serviceInstanceId;
         this.networkName = networkName;
         this.serviceModelName = serviceModelName;
         this.serviceModelVersionId = serviceModelVersionId;
         this.platformName = platformName;
+        this.lineOfBusinessName = lineOfBusinessName;
     }
 
     @Override
@@ -42,7 +46,7 @@ public class PresetMSOCreateNetworkALaCarteServiceCypress2 extends PresetMSOBase
                     "\"source\":\"VID\"," +
                     "\"suppressRollback\":false," +
                     "\"requestorId\":\"us16807000\"}," +
-                "\"lineOfBusiness\":{\"lineOfBusinessName\":\"zzz1\"}," +
+            "\"lineOfBusiness\":{\"lineOfBusinessName\":\"" + lineOfBusinessName + "\"}," +
                 "\"cloudConfiguration\":" +
                     "{\"lcpCloudRegionId\":\"hvf6\"," +
                     addCloudOwnerIfNeeded() +
index 99e8240..7ce3500 100644 (file)
@@ -1205,9 +1205,11 @@ public class NewServiceInstanceTest extends ModernUITestBase {
         if(!isNetwork){
             SelectOption.byTestIdAndVisibleText("TYLER SILVIA", Constants.ViewEdit.PRODUCT_FAMILY_SELECT_TESTS_ID);
             browseASDCPage.selectProductFamily("e433710f-9217-458d-a79d-1c7aff376d89");
+            browseASDCPage.selectLineOfBusiness("ONAP");
+        } else {
+            SelectOption.selectOptionsFromMultiselectById("multi-lineOfBusiness",ImmutableList.of("ONAP"));
         }
 
-        browseASDCPage.selectLineOfBusiness("ONAP");
         assertSetButtonEnabled(VNF_SET_BUTTON_TEST_ID);
 
         browseASDCPage.setLegacyRegion("some legacy region");
index 70ded1c..07b81a4 100644 (file)
@@ -379,7 +379,7 @@ public class AsyncInstantiationALaCarteApiTest3 extends AsyncInstantiationBase {
                 new PresetMSOOrchestrationRequestGet(COMPLETE, deleteRequestId),
                 new PresetMSOCreateNetworkALaCarteServiceCypress2(createRequestId, serviceInstanceId,
                     "ExtVL", "action-data",
-                    "6b528779-44a3-4472-bdff-9cd15ec93450", "xxx1,platform"),
+                    "6b528779-44a3-4472-bdff-9cd15ec93450", "xxx1,platform", "zzz1,ONAP"),
                 new PresetMSOOrchestrationRequestGet(COMPLETE, createRequestId),
                 PresetAAIGetCloudOwnersByCloudRegionId.PRESET_MTN6_TO_ATT_AIC
         ), RegistrationStrategy.CLEAR_THEN_SET);
index 114565e..af7ddd2 100644 (file)
@@ -65,7 +65,7 @@
       "lcpCloudRegionId":"hvf6",
       "tenantId":"229bcdc6eaeb4ca59d55221141d01f8e",
       "platformName":"xxx1,platform" ,
-      "lineOfBusiness":"zzz1",
+      "lineOfBusiness":"zzz1,ONAP",
       "instanceParams":[
         {
 
index 4988ec8..4fa3ae6 100644 (file)
@@ -136,7 +136,7 @@ describe('A la carte', function () {
             cy.selectDropdownOptionByText('tenant', 'USP-SIP-IC-24335-T-01');
             cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
 
-            cy.selectPlatformValue('xxx1');
+            cy.selectPlatformValue(`xxx1`);
 
             cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
 
@@ -144,7 +144,7 @@ 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.getElementByDataTestsId('form-set').click({force: true}).then(() => {
                   cy.getReduxState().then((state) => {
 
@@ -195,11 +195,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(() => {
@@ -229,7 +229,7 @@ describe('A la carte', function () {
           cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
           cy.selectDropdownOptionByText('lcpRegion', 'foo-name');
           cy.selectDropdownOptionByText('tenant', 'tenantID');
-          cy.selectPlatformValue('xxx1');
+          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';
 
@@ -266,7 +266,7 @@ describe('A la carte', function () {
           cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
           cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
           cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
-          cy.selectPlatformValue('xxx1');
+          cy.selectPlatformValue(`xxx1`);
           cy.getElementByDataTestsId('form-set').click({force: true}).then(() => {
             const vnfName = '2017-488_PASQUALE-vPE 0';
             let vfModulesNames: Array<string> = [
index 88ad8e8..87bbb5b 100644 (file)
@@ -377,7 +377,7 @@ describe('Drawing board', function () {
         cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
         cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-testalexandria');
         cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP');
-        cy.selectPlatformValue('platform');
+        cy.selectPlatformValue(`platform`);
         cy.genericFormSubmitForm();
 
         cy.getElementByDataTestsId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_PASQUALE-vPE 0').contains('<Automatically Assigned>');
@@ -397,8 +397,8 @@ 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.selectPlatformValue('platform');
+        cy.selectLobValue("ONAP");
+        cy.selectPlatformValue(`platform`);
 
         cy.genericFormSubmitForm();
 
index bb2c01a..8a68a13 100644 (file)
@@ -99,7 +99,7 @@ describe('Drawing Board: Instantiation Templates', function () {
           .getElementByDataTestsId("lcpRegion").should('contain', 'hvf6')
           .getElementByDataTestsId("lineOfBusiness").should('contain', 'zzz1')
           .getElementByDataTestsId("rollback").should('contain', 'Rollback')
-          .checkPlatformValue('xxx1')
+          cy.checkPlatformValue(`xxx1`)
           .getElementByDataTestsId("cancelButton").click();
 
         cy.editNode("node-c5b26cc1-a66f-4b69-aa23-6abc7c647c88-vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0")
@@ -223,7 +223,7 @@ describe('Drawing Board: Instantiation Templates', function () {
           // edit vnf
           cy.editNode("node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0");
           if (testCase.modifySomeValues) {
-            cy.selectPlatformValue('platform');
+            cy.selectPlatformValue(`platform`);
             cy.selectDropdownOptionByText("tenant", "CESAR-100-D-spjg61909");
           }
           cy.getElementByDataTestsId('form-set').click();
index a174431..5702d5a 100644 (file)
@@ -56,7 +56,7 @@ describe('Network popup', function () {
             cy.checkIsOptionSelected('productFamily', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb');
             cy.checkIsOptionSelected('lcpRegion', 'hvf6');
             cy.checkIsOptionSelected('tenant', '229bcdc6eaeb4ca59d55221141d01f8e');
-            cy.checkIsOptionSelected('lineOfBusiness', 'zzz1');
+            cy.checkLobValue( "zzz1");
             cy.checkPlatformValue('xxx1');
             //change platform value
             cy.selectPlatformValue('platform');
@@ -64,9 +64,9 @@ describe('Network popup', function () {
               cy.getElementByDataTestsId('numberButton').contains('1');
               cy.getElementByDataTestsId('node-ddc3f20c-08b5-40fd-af72-c6d14636b986-ExtVL 0-menu-btn').click({force: true})
                 .getElementByDataTestsId('context-menu-edit').click({force: true}).then(() => {
-                cy.checkPlatformValue( 'platform');
+                cy.checkPlatformValue('platform');
                 // cancel button should close the dialog
-                cy.getElementByDataTestsId('cancelButton').click({force: true}).then(() => {
+                cy.getElementByDataTestsId('cancelButton').click({force: true, multiple: true}).then(() => {
                   // duplicate network
                   cy.getElementByDataTestsId('node-ddc3f20c-08b5-40fd-af72-c6d14636b986-ExtVL 0-menu-btn').click({force: true})
                     .getElementByDataTestsId('context-menu-duplicate').click({force: true}).then(() => {
@@ -129,7 +129,7 @@ describe('Network popup', function () {
         cy.selectDropdownOptionByText('productFamily', 'Emanuel');
         cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
         cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
-        cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
+        cy.selectLobValue("zzz1");
         cy.selectPlatformValue('xxx1');
         cy.getElementByDataTestsId('form-set').should('not.have.attr', 'disabled');
 
@@ -175,7 +175,7 @@ describe('Network popup', function () {
       //add one network
       cy.getElementByDataTestsId('node-ExtVL 0-add-btn').click({force: true}).then(() => {
         verifyServiceModelNameInModelInfo();
-        cy.fillNetworkPopup(true);
+        cy.fillNetworkPopup(true, true);
       });
 
 
@@ -216,7 +216,8 @@ describe('Network popup', function () {
             "FLAG_ADVANCED_PORTS_FILTER": true,
             "FLAG_REGION_ID_FROM_REMOTE": true,
             "FLAG_ADD_MSO_TESTAPI_FIELD": true,
-            "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT": true
+            "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true,
+            "FLAG_2006_NETWORK_LOB_MULTI_SELECT": true,
           },
           "type": "[FLAGS] Update"
         },
index 74ce2a7..3b56ac0 100644 (file)
@@ -81,7 +81,7 @@ describe('Vnf popup', function () {
         cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
         cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
         cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
-        cy.selectPlatformValue('xxx1');
+        cy.selectPlatformValue(`xxx1`);
 
       })
     });
index 148f6b4..7c778c8 100644 (file)
@@ -25,5 +25,6 @@
   "FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE": true,
   "FLAG_2006_VFM_SDNC_PRELOAD_FILES" : true,
   "FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF": true,
-  "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true
+  "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true,
+  "FLAG_2006_NETWORK_LOB_MULTI_SELECT" : true
 }
index 4ca1796..0fa7f6b 100644 (file)
@@ -5,14 +5,17 @@ declare namespace Cypress {
   }
 }
 
-function fillNetworkPopup(shouldSelectAdditionalPlatform: boolean = false): Cypress.Chainable<any> {
+function fillNetworkPopup(shouldSelectAdditionalPlatform: boolean = false, shouldSelectAdditionalLob: boolean = false): Cypress.Chainable<any> {
   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`);
   if(shouldSelectAdditionalPlatform){
-    cy.selectPlatformValue('platform');
+    cy.selectPlatformValue(`platform`);
+  }
+  if(shouldSelectAdditionalLob){
+    cy.selectLobValue("ONAP");
   }
   return cy.getElementByDataTestsId('form-set').click({force : true}).then((done)=>{
     return done;
index 29166f6..7c82cf8 100644 (file)
@@ -12,7 +12,7 @@ function FillVnfPopup(): Chainable<any> {
   cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
   cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2');
   cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1');
-  cy.selectPlatformValue('xxx1');
+  cy.selectPlatformValue(`xxx1`);
   return cy.getElementByDataTestsId('form-set').click({force : true}).then((done)=>{
     return done;
   });
index 1151736..b9c051e 100644 (file)
@@ -1,20 +1,42 @@
 declare namespace Cypress {
   interface Chainable {
     genericFormSubmitForm: typeof genericFormSubmitForm
+    selectMultiselectValue: typeof selectMultiselectValue
     selectPlatformValue: typeof selectPlatformValue
+    selectLobValue: typeof selectLobValue
+    checkMultiSelectValue: typeof checkMultiSelectValue
     checkPlatformValue: typeof checkPlatformValue
+    checkLobValue: typeof checkLobValue
+
   }
 }
 
 
-function selectPlatformValue(selectOption: string) {
-      cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
-      cy.getElementByDataTestsId(`multi-selectPlatform-${selectOption}`).click();
-      cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
+function selectMultiselectValue(dataTestsId: string , selectOptionId: string) {
+  cy.getElementByDataTestsId(dataTestsId).find('.c-btn').eq(0).click({force: true})
+  cy.getElementByDataTestsId(selectOptionId).click();
+  cy.getElementByDataTestsId(dataTestsId).find('.c-btn').eq(0).click({force: true})
+}
+
+function selectPlatformValue(selectOptionId: string) {
+  selectMultiselectValue("multi-selectPlatform", "multi-selectPlatform-" + selectOptionId)
+}
+
+function selectLobValue(selectOptionId: string) {
+  selectMultiselectValue("multi-lineOfBusiness", "multi-lineOfBusiness-" + selectOptionId)
+
 }
 
 function checkPlatformValue(value: string){
-  return cy.getElementByDataTestsId("multi-selectPlatform").should("contain", value)
+  return checkMultiSelectValue("multi-selectPlatform", value)
+}
+
+function checkLobValue(value: string){
+  return checkMultiSelectValue("multi-lineOfBusiness", value)
+}
+
+function checkMultiSelectValue(dataTestsId: string, value: string) {
+  return cy.getElementByDataTestsId(dataTestsId).should("contain", value)
 }
 
 function genericFormSubmitForm(): Chainable<any> {
@@ -23,5 +45,10 @@ function genericFormSubmitForm(): Chainable<any> {
 
 
 Cypress.Commands.add('genericFormSubmitForm', genericFormSubmitForm);
+Cypress.Commands.add('selectMultiselectValue', selectMultiselectValue);
 Cypress.Commands.add('selectPlatformValue', selectPlatformValue);
+Cypress.Commands.add('selectLobValue', selectLobValue);
+Cypress.Commands.add('checkMultiSelectValue', checkMultiSelectValue);
 Cypress.Commands.add('checkPlatformValue', checkPlatformValue);
+Cypress.Commands.add('checkLobValue', checkLobValue);
+
index e0418fc..fe6a258 100644 (file)
@@ -64,7 +64,7 @@ export class NetworkControlGenerator {
       result.push(this._sharedControllersService.getLegacyRegion(networkInstance));
       result.push(this._sharedControllersService.getTenantControl(serviceId, networkInstance));
       result.push(this._sharedControllersService.getPlatformMultiselectControl(networkInstance, result, flags['FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT']));
-      result.push(this._sharedControllersService.getLineOfBusinessControl(networkInstance));
+      result.push(this._sharedControllersService.getMultiSelectLineOfBusinessControl(networkInstance, flags['FLAG_2006_NETWORK_LOB_MULTI_SELECT']));
     }
     return result;
 
@@ -89,7 +89,7 @@ export class NetworkControlGenerator {
       result.push(this._sharedControllersService.getLegacyRegion(networkInstance));
       result.push(this._sharedControllersService.getTenantControl(serviceId, networkInstance));
       result.push(this._sharedControllersService.getPlatformMultiselectControl(networkInstance, result, flags['FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT']));
-      result.push(this._sharedControllersService.getLineOfBusinessControl(networkInstance));
+      result.push(this._sharedControllersService.getMultiSelectLineOfBusinessControl(networkInstance, flags['FLAG_2006_NETWORK_LOB_MULTI_SELECT']));
       result.push(this._sharedControllersService.getRollbackOnFailureControl(networkInstance));
     }
     return result;
index 97c5516..32259b1 100644 (file)
@@ -32,6 +32,10 @@ export class SharedControllersService {
     return this.getLineOfBusinessControlInternal(undefined, instance);
   };
 
+  getMultiSelectLineOfBusinessControl = (instance: any, isMultiSelected: boolean): MultiselectFormControl => {
+    return this.getLobMultiselectControl(instance, isMultiSelected);
+  };
+
   getLineOfBusinessByOwningEntityControl = (instance?: any, serviceId?: string, controls?: FormControlModel[]): DropdownFormControl => {
     const service = this._store.getState().service.serviceInstance[serviceId];
     const owningEntityName: string = service.owningEntityName;
@@ -301,7 +305,7 @@ export class SharedControllersService {
     );
   };
 
-  getLobMultiselectControl = (instance: any, controls: FormControlModel[], isMultiSelected: boolean) : MultiselectFormControl => {
+  getLobMultiselectControl = (instance: any, isMultiSelected: boolean) : MultiselectFormControl => {
     return this.getMultiSelectFormControl(
       'lineOfBusiness',
       'Line of business',