1 package vid.automation.test.infra;
3 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
4 import org.openqa.selenium.WebElement;
5 import vid.automation.test.utils.ReadFile;
8 * Created by itzikliderman on 11/09/2017.
11 public static void text(String text, String inputTestsId) {
12 WebElement inputElement = GeneralUIUtils.getWebElementByTestID(inputTestsId, 30);
13 inputElement.sendKeys(text);
16 public static void replaceText(String text, String inputTestsId) {
17 WebElement inputElement = GeneralUIUtils.getWebElementByTestID(inputTestsId, 30);
19 inputElement.sendKeys(text);
23 public static String getValueByTestId(String testId) {
24 WebElement input = GeneralUIUtils.getInputElement(testId);
25 return input.getAttribute("value");
29 Get relative path to resource and id of file input element,
30 and send the resource full path to the input element
32 public static void file(String pathInResources, String inputId) {
34 // Copy files from resources upon file-input field, so files will be accessible from inside a jar
35 String path = ReadFile.copyOfFileFromResources(pathInResources);
36 WebElement inputElement = Get.byId(inputId);
37 inputElement.sendKeys(path);