Merge "Resolving some tests in CreatePortMirroringConfigurationTest by merging instantiate.html ecomp+onap"
diff --git a/epsdk-app-onap/src/main/webapp/app/fusion/external/ebz/fn-ebz.css b/epsdk-app-onap/src/main/webapp/app/fusion/external/ebz/fn-ebz.css
index a0341b2..aee471e 100755
--- a/epsdk-app-onap/src/main/webapp/app/fusion/external/ebz/fn-ebz.css
+++ b/epsdk-app-onap/src/main/webapp/app/fusion/external/ebz/fn-ebz.css
@@ -1614,6 +1614,7 @@
 	top:60px; 

 	right:20px;

 	z-index: 999;

+	display: none;

 }

 @font-face {

   font-family: 'icoPrimary';

@@ -1688,4 +1689,4 @@
 	float: left;

 	text-align: left;

 	margin-left: 50px;

-}
\ No newline at end of file
+}

diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
index 2d54563..92f9b4e 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
@@ -21,9 +21,9 @@
 
 package org.onap.vid.aai.model.AaiGetPnfs;
 
-import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import org.onap.vid.aai.model.AaiRelationResponse;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
@@ -39,10 +39,10 @@
 
     @JsonCreator
     public Pnf(
-        @JsonAlias("pnf-id") String pnfId, @JsonAlias("pnf-name") String pnfName,
-        @JsonAlias("pnf-name2") String pnfName2, @JsonAlias("pnf-name2-source") String pnfName2Source,
-        @JsonAlias("equip-type") String equipType, @JsonAlias("equip-vendor") String equipVendor,
-        @JsonAlias("equip-model") String equipModel) {
+            @JsonProperty("pnf-id") String pnfId, @JsonProperty("pnf-name") String pnfName,
+            @JsonProperty("pnf-name2") String pnfName2, @JsonProperty("pnf-name2-source") String pnfName2Source,
+            @JsonProperty("equip-type") String equipType, @JsonProperty("equip-vendor") String equipVendor,
+            @JsonProperty("equip-model") String equipModel) {
 
         this.pnfId = pnfId;
         this.pnfName = pnfName;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
index 386d236..4b0f8bb 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
@@ -53,7 +53,11 @@
         CreationService.getParameters(handleGetParametersResponse);
 
         $scope.setTenant = function(field)  {
-            $scope.nodeTemplateFields.tenant.optionList = _.filter($scope.tenantList, {'cloudRegionId': field.value, 'isPermitted': true});
+            var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(field.value);
+            $scope.nodeTemplateFields.cloudRegionId = cloudOwnerAndLcpCloudRegion.cloudRegionId;
+            $scope.nodeTemplateFields.cloudOwner = cloudOwnerAndLcpCloudRegion.cloudOwner;
+            $scope.nodeTemplateFields.tenant.optionList = _.filter($scope.tenantList,
+                {'cloudRegionId': cloudOwnerAndLcpCloudRegion.cloudRegionId, 'isPermitted': true});
         };
 
         $scope.cancel = function()  {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
index f775bed..8e3b5b8 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
@@ -292,7 +292,7 @@
                     serviceType,
                     serviceProxy.sourceModelUuid,
                     serviceProxy.sourceModelInvariant,
-                    configNodeTemplateFields.lcpRegion.value,
+                    configNodeTemplateFields.cloudRegionId,
                     configurationModel.properties.equip_vendor,
                     configurationModel.properties.equip_model
                 )
@@ -311,7 +311,7 @@
                     serviceType,
                     serviceProxy.sourceModelUuid,
                     serviceProxy.sourceModelInvariant,
-                    configNodeTemplateFields.lcpRegion.value
+                    configNodeTemplateFields.cloudRegionId
                 )
                     .then(function (response) {
                         var results = response.results || [];
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
index 1949f5a..1a296ca 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
@@ -779,13 +779,13 @@
         var cloudOwner;
 
         var lcpRegionOptionId = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-        var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+        var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
         if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
             lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
                 parameterList);
             cloudOwner = undefined;
         } else {
-            var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+            var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
             lcpRegion = cloudOwnerAndLcpCloudRegion.cloudRegionId;
             cloudOwner = cloudOwnerAndLcpCloudRegion.cloudOwner;
         }
@@ -1155,15 +1155,6 @@
         return parameter;
     };
 
-    var getCloudOwnerAndLcpCloudRegionFromOptionId = function (cloudRegionOptionId) {
-      var cloudRegionTenantList = DataService.getCloudRegionTenantList();
-      var cloudRegionTenant = _.find(cloudRegionTenantList, {"cloudRegionOptionId": cloudRegionOptionId});
-      return {
-        cloudOwner: cloudRegionTenant.cloudOwner,
-        cloudRegionId: cloudRegionTenant.cloudRegionId
-      }
-    };
-
     var getTenantList = function(cloudRegionOptionId) {
         var cloudRegionTenantList = DataService.getCloudRegionTenantList();
         var parameter = "";
@@ -1257,7 +1248,7 @@
                     .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
             }
 
-            var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
+            var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
             if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
                 parameterListControl
                     .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
index 26adcf4..84413f8 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
@@ -37,6 +37,14 @@
 		setCloudRegionTenantList : function(cloudRegionTenantList) {

 			_this.cloudRegionTenantList = cloudRegionTenantList;

 		},

+		getCloudOwnerAndLcpCloudRegionFromOptionId : function (cloudRegionOptionId) {

+			var cloudRegionTenantList = this.getCloudRegionTenantList();

+			var cloudRegionTenant = _.find(cloudRegionTenantList, {"cloudRegionOptionId": cloudRegionOptionId});

+			return {

+				cloudOwner: cloudRegionTenant.cloudOwner,

+				cloudRegionId: cloudRegionTenant.cloudRegionId

+			}

+		},

 		getGlobalCustomerId : function() {

 			return _this.globalCustomerId;

 		},

diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
index aac0ed4..559174d 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -293,7 +293,7 @@
 		var cloudOwner;
 
 		var lcpRegionOptionId = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
-		var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+		var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
 		if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
 			lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
 				parameterList);
@@ -416,15 +416,6 @@
 		return parameter;
 	};
 
-	var getCloudOwnerAndLcpCloudRegionFromOptionId = function (cloudRegionOptionId) {
-		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
-		var cloudRegionTenant = _.find(cloudRegionTenantList, {"cloudRegionOptionId": cloudRegionOptionId});
-		return {
-			cloudOwner: cloudRegionTenant.cloudOwner,
-			cloudRegionId: cloudRegionTenant.cloudRegionId
-		}
-	};
-
 	var getTenantList = function(cloudRegionOptionId) {
 		var parameter = "";
 		var cloudRegionTenantList = DataService.getCloudRegionTenantList();
@@ -478,7 +469,7 @@
 						.updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
 			}
 
-			var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
+			var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
 			if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
 				parameterListControl
 						.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
index d5baa1a..3f902e8 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
@@ -341,7 +341,8 @@
                         "modelCustomizationName": requestParams.configurationModelInfo.modelCustomizationName

                     },

                     "cloudConfiguration": {

-                        "lcpCloudRegionId": requestParams.portMirroringConfigFields.lcpRegion.value

+                        "lcpCloudRegionId": requestParams.portMirroringConfigFields.cloudRegionId,

+                        "cloudOwner" : requestParams.portMirroringConfigFields.cloudOwner

                     },

                     "requestInfo": {

                         "instanceName": requestParams.portMirroringConfigFields.instanceName.value,

diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
index 8b33690..e1dad40 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
@@ -40,12 +40,12 @@
                         <input data-tests-id="instanceNameInput" name="{{field.id}}" id="{{field.id}}" type="text" required ng-model="field.value" ng-pattern="regexInstanceName">
                         <span class="error" data-ng-show="!networkNodeForm.instanceName.$error.required && networkNodeForm.instanceName.$dirty && networkNodeForm.instanceName.$invalid">{{errorMsg}}</span>
                     </div>
-                    <select id="{{field.id}}" data-tests-id="regionDropDown" ng-if="key === 'lcpRegion'" required ng-model="field.value"
+                    <select id="{{field.id}}" data-tests-id="lcpRegion" ng-if="key === 'lcpRegion'" required ng-model="field.value"
                             placeholder="Choose {{field.name}}"
                             data-ng-change="setTenant(field)">
                         <option value="" selected>LCP region</option>
                         <option data-ng-disabled="!option.isPermitted" ng-repeat="option in field.optionList"
-                                value="{{option.id}}" data-tests-id="{{'region-' + option.id}}">{{option.id}}</option>
+                                value="{{option.id}}" data-tests-id="{{'region-' + option.id}}">{{option.name}}</option>
                     </select>
                     <select id="{{field.id}}" data-tests-id="tenantDropDown" ng-if="key === 'tenant'" required ng-model="field.value"
                             data-ng-options="option.tenantName for option in field.optionList" placeholder="Choose {{field.name}}"
@@ -59,4 +59,4 @@
             <service-metadata title-txt="info" service-metadata-fields="serviceMetadataFields"></service-metadata>
         </div>
     </div>
-</div>
\ No newline at end of file
+</div>
diff --git a/vid-automation/src/main/java/vid/automation/test/Constants.java b/vid-automation/src/main/java/vid/automation/test/Constants.java
index 0e614de..a81757e 100644
--- a/vid-automation/src/main/java/vid/automation/test/Constants.java
+++ b/vid-automation/src/main/java/vid/automation/test/Constants.java
@@ -440,7 +440,7 @@
         public static final String BACK_BUTTON_TEST_ID = "backButton";
         public static final String SUPPRESS_ROLLBACK_INPUT_TEST_ID = "suppressRollbackInput";
         public static final String INSTANCE_NAME_INPUT_TEST_ID = "instanceNameInput";
-        public static final String REGION_DROPDOWN_TEST_ID = "regionDropDown";
+        public static final String REGION_DROPDOWN_TEST_ID = "lcpRegion";
         public static final String TENANT_DROPDOWN_TEST_ID = "tenantDropDown";
         public static final String ENABLE_NEXT_ERROR_MESSAGE = "The Next button is not enabled";
         public static final String DISABLE_NEXT_ASSOCIATE_ERROR_MESSAGE = "The Next button enabled when fields are empty";
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java b/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java
index 6f6b9f5..b1a0b9a 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/CreateConfigurationPage.java
@@ -2,6 +2,7 @@
 
 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
 import vid.automation.test.Constants;
+import vid.automation.test.infra.Get;
 import vid.automation.test.infra.SelectOption;
 
 public class CreateConfigurationPage extends VidBasePage {
@@ -11,11 +12,6 @@
         return this;
     }
 
-    public CreateConfigurationPage chooseRegion(String region){
-        SelectOption.byTestIdAndVisibleText(region, Constants.ConfigurationCreation.REGION_DROPDOWN_TEST_ID);
-        return this;
-    }
-
     public CreateConfigurationPage chooseTenant(String tenant){
         SelectOption.byTestIdAndVisibleText(tenant, Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID);
         return this;
@@ -35,7 +31,7 @@
         return getInputValue(Constants.ConfigurationCreation.INSTANCE_NAME_INPUT_TEST_ID);
     }
     public String getRegion() {
-        return getInputValue(Constants.ConfigurationCreation.REGION_DROPDOWN_TEST_ID);
+        return Get.selectedOptionText(Constants.ConfigurationCreation.REGION_DROPDOWN_TEST_ID);
     }
     public String getTenant() {
        return SelectOption.getSelectedOption(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID);
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java b/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java
index 5b7239a..7290204 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java
@@ -57,8 +57,7 @@
 
     public String getInputValue(String inputTestsId) {
         WebElement instanceNameInput = GeneralUIUtils.getInputElement(inputTestsId);
-        String value =instanceNameInput.getAttribute("value");
-        return value;
+        return instanceNameInput.getAttribute("value");
     }
 
     public String generateInstanceName(String prefix) {
diff --git a/vid-automation/src/main/java/vid/automation/test/test/AssociatePnfTest.java b/vid-automation/src/main/java/vid/automation/test/test/AssociatePnfTest.java
index 7bec560..03d7d4a 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/AssociatePnfTest.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/AssociatePnfTest.java
@@ -56,6 +56,7 @@
         vidBasePage.assertMsoRequestModal("Error");
         vidBasePage.clickCloseButton();
     }
+
     @Test
     public void testRainyChoosePnf() throws Exception {
         SimulatorApi.clearAll();
@@ -70,6 +71,7 @@
         boolean waitForElementResult = Wait.waitByTestId(Constants.ViewEdit.VNF_OPTION_TEST_ID_PREFIX + pnfName, 60);
         Assert.assertTrue(message, !waitForElementResult);
     }
+
     @Test
     public void testRainySearchPnfInstance() throws Exception {
         SimulatorApi.clearAll();
@@ -98,6 +100,7 @@
         }
         GeneralUIUtils.ultimateWait();
     }
+
     private void associatePNF() throws InterruptedException {
         pnfSearchAssociationPage.clickAssociateButton();
     }
@@ -118,6 +121,7 @@
         Wait.angularHttpRequestsLoaded();
         assertAssociateButtonState(true);
     }
+
     private void checkServiceModelInfo() {
         Wait.angularHttpRequestsLoaded();
         //Service name
@@ -188,7 +192,4 @@
         infoItemText = GeneralUIUtils.getWebElementByTestID(elementTestId, 60).getText();
         Assert.assertEquals(String.format(Constants.PnfAssociation.PNF_INSTANCE_ERROR_MESSAGE,elementTestId),infoItemText,"ASR1002-X");
     }
-
-
-
 }
diff --git a/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java b/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java
index 835aacd..eac0951 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/CreatePortMirroringConfigurationTest.java
@@ -12,6 +12,7 @@
 import vid.automation.test.infra.Wait;
 import vid.automation.test.sections.CreateConfigurationPage;
 import vid.automation.test.sections.ServiceProxyPage;
+import vid.automation.test.sections.VidBasePage;
 import vid.automation.test.sections.ViewEditPage;
 import vid.automation.test.services.BulkRegistration;
 import vid.automation.test.services.SimulatorApi;
@@ -310,17 +311,15 @@
     private void fillAllFormFields() {
         createConfigurationPage.setInstanceName("dummy_instance");
         createConfigurationPage.assertButtonState(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID,false);
-        //WebElement tenantDDL= Get.byTestId(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID);
-
-        createConfigurationPage.chooseRegion("AAIAIC25");
+        VidBasePage vidBasePage = new VidBasePage();
+        vidBasePage.selectLcpRegion("AAIAIC25", "AIC");
         GeneralUIUtils.ultimateWait();
-       // Wait.waitByTestId(Constants.ConfigurationCreation.TENANT_DROPDOWN_TEST_ID, 30);
         createConfigurationPage.chooseTenant("USP-SIP-IC-24335-T-01");
         createConfigurationPage.assertButtonState(Constants.ConfigurationCreation.NEXT_BUTTON_TEST_ID,true);
     }
     private void assertFormFields() {
         Assert.assertEquals("dummy_instance",createConfigurationPage.getInstanceName());
-        Assert.assertEquals("AAIAIC25", createConfigurationPage.getRegion());
+        Assert.assertEquals("AAIAIC25 (AIC)", createConfigurationPage.getRegion());
         Assert.assertEquals("USP-SIP-IC-24335-T-01",createConfigurationPage.getTenant());
 
         createConfigurationPage.assertButtonState(Constants.ConfigurationCreation.NEXT_BUTTON_TEST_ID,true);