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;
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;
}
}
}
+ 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);
}
};
}
+
+ 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 + "']");
+ }
}