adding orchestration type to service models view
[vid.git] / vid-automation / src / main / java / vid / automation / test / sections / VidBasePage.java
index 65d0fb6..43dd68f 100644 (file)
@@ -4,10 +4,7 @@ import com.aventstack.extentreports.Status;
 import org.junit.Assert;
 import org.onap.sdc.ci.tests.execute.setup.ExtentTestActions;
 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
+import org.openqa.selenium.*;
 import org.openqa.selenium.support.ui.ExpectedConditions;
 import org.openqa.selenium.support.ui.WebDriverWait;
 import vid.automation.test.Constants;
@@ -57,8 +54,7 @@ public class VidBasePage {
 
     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) {
@@ -114,6 +110,17 @@ public class VidBasePage {
         return this;
     }
 
+    public boolean isModelWithGivenServiceUUIDVisible(String serviceUUID) {
+        String elementTestId = Constants.DEPLOY_BUTTON_TESTS_ID_PREFIX + serviceUUID;
+        try {
+            GeneralUIUtils.getWebElementByTestID(elementTestId, 10);
+            GeneralUIUtils.ultimateWait();
+        } catch (TimeoutException te) {
+            return false;
+        }
+        return true;
+    }
+
     public void screenshotDeployDialog(String serviceUUID) {
         try {
             GeneralUIUtils.ultimateWait();
@@ -185,10 +192,15 @@ public class VidBasePage {
         return this;
     }
 
-
     public VidBasePage selectLcpRegion(String lcpRegion) {
+        return selectLcpRegion(lcpRegion, "AIC");
+    }
+
+    public VidBasePage selectLcpRegion(String lcpRegion, String cloudOwner) {
         GeneralUIUtils.ultimateWait();
-        SelectOption.byValue(lcpRegion, Constants.ViewEdit.LCP_REGION_SELECT_TESTS_ID);
+        String visibleText = (Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST.isActive()) ?
+            String.format("%s (%s)", lcpRegion, cloudOwner) : lcpRegion;
+        SelectOption.byTestIdAndVisibleText(visibleText, Constants.ViewEdit.LCP_REGION_SELECT_TESTS_ID);
         return this;
     }