aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/infra/Input.java
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@intl.att.com>2018-08-12 12:20:55 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-12 12:20:55 +0000
commit91b057331b92ecf7f3c2d495681b05295dc8346c (patch)
tree0ce3f821ada8ad518784f7f9869db4b537ba3237 /vid-automation/src/main/java/vid/automation/test/infra/Input.java
parent9152b2ae03c4751b492a219993d85d522c58b383 (diff)
parent4a4dcc5185f8ba5a28c7f9fef509f32c0c2389e6 (diff)
Merge "vid-automation selenium tests"
Diffstat (limited to 'vid-automation/src/main/java/vid/automation/test/infra/Input.java')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/Input.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Input.java b/vid-automation/src/main/java/vid/automation/test/infra/Input.java
index 15fa2254..896ceae5 100644
--- a/vid-automation/src/main/java/vid/automation/test/infra/Input.java
+++ b/vid-automation/src/main/java/vid/automation/test/infra/Input.java
@@ -1,9 +1,8 @@
package vid.automation.test.infra;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.lang3.SystemUtils;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openqa.selenium.WebElement;
+import vid.automation.test.utils.ReadFile;
/**
* Created by itzikliderman on 11/09/2017.
@@ -14,6 +13,13 @@ public class Input {
inputElement.sendKeys(text);
}
+ public static void replaceText(String text, String inputTestsId) {
+ WebElement inputElement = GeneralUIUtils.getWebElementByTestID(inputTestsId, 30);
+ inputElement.clear();
+ inputElement.sendKeys(text);
+ }
+
+
public static String getValueByTestId(String testId) {
WebElement input = GeneralUIUtils.getInputElement(testId);
return input.getAttribute("value");
@@ -25,13 +31,8 @@ public class Input {
*/
public static void file(String pathInResources, String inputId) {
- String path = Input.class.getResource("../../../../"+pathInResources).getPath().toString();
- if (SystemUtils.IS_OS_WINDOWS) {
- path = FilenameUtils.separatorsToSystem(path);
- if (path.charAt(0)=='\\') {
- path = path.substring(1);
- }
- }
+ // Copy files from resources upon file-input field, so files will be accessible from inside a jar
+ String path = ReadFile.copyOfFileFromResources(pathInResources);
WebElement inputElement = Get.byId(inputId);
inputElement.sendKeys(path);
}