Changing VNF platform to multiselect + cypress + API
[vid.git] / vid-automation / src / main / java / vid / automation / test / infra / Get.java
index fc1d060..1e0c948 100644 (file)
@@ -1,7 +1,7 @@
 package vid.automation.test.infra;
 
 import org.junit.Assert;
-import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
+import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
 import org.openqa.selenium.*;
 import org.openqa.selenium.support.ui.WebDriverWait;
 
@@ -20,7 +20,7 @@ public class Get {
 
     public static WebElement byTestId(String dataTestId) {
         try {
-            return GeneralUIUtils.getDriver().findElement(By.xpath("//*[@data-tests-id='" + dataTestId + "']"));
+            return GeneralUIUtils.getDriver().findElement(getXpathForDataTestId(dataTestId));
         } catch (Exception var2) {
             return null;
         }
@@ -34,6 +34,14 @@ public class Get {
         }
     }
 
+    public static WebElement byXpath(WebElement context, String xpath) {
+        try {
+            return context.findElement(By.xpath(xpath));
+        } catch (Exception var2) {
+            return null;
+        }
+    }
+
     public static WebElement byXpath(String xpath, int timeout) {
         try {
             return GeneralUIUtils.getWebElementBy(By.xpath(xpath), timeout);
@@ -89,6 +97,9 @@ public class Get {
         return GeneralUIUtils.getSelectedElementFromDropDown(dataTestId).getText();
     }
 
+    public static Boolean isOptionSelectedInMultiSelect(String dataTestId, String option) {
+        return GeneralUIUtils.isOptionSelectedInMultiSelect(dataTestId, option);
+    }
 
     public static List<WebElement> byClass(String className) {
         return GeneralUIUtils.getWebElementsListByContainsClassName(className);
@@ -152,4 +163,16 @@ public class Get {
                        }
                };
        }
+
+    public static List<WebElement> listByTestId(String dataTestId) {
+        try {
+            return GeneralUIUtils.getDriver().findElements(getXpathForDataTestId(dataTestId));
+        } catch (Exception var2) {
+            return null;
+        }
+    }
+
+    public static By getXpathForDataTestId(String dataTestId) {
+        return By.xpath("//*[@data-tests-id='" + dataTestId + "']");
+    }
 }