From b093d05e886192dc1413bc0c5f38c4f2a392b17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gro=C3=9Fmann?= Date: Thu, 15 Aug 2024 15:05:28 +0200 Subject: [PATCH] Removed custom type method --- .../AppiumGuiElementCoreAdapter.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/guielement/AppiumGuiElementCoreAdapter.java b/appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/guielement/AppiumGuiElementCoreAdapter.java index 87dc6cf..82b252e 100644 --- a/appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/guielement/AppiumGuiElementCoreAdapter.java +++ b/appium/src/main/java/eu/tsystems/mms/tic/testframework/mobile/guielement/AppiumGuiElementCoreAdapter.java @@ -32,7 +32,6 @@ import eu.tsystems.mms.tic.testframework.utils.AppiumUtils; import eu.tsystems.mms.tic.testframework.utils.ExecutionUtils; import io.appium.java_client.AppiumDriver; -import org.apache.commons.lang3.NotImplementedException; import org.openqa.selenium.Dimension; import org.openqa.selenium.Point; import org.openqa.selenium.WebDriver; @@ -172,45 +171,7 @@ public boolean isSelected() { @Override @Deprecated public boolean isSelectable() { - throw new MobileActionNotSupportedException("isSelectable() is not supported on mobile elements"); } - /** - * Appium on apps does not support webElement.getAttribute("value"), but webElement.getText() is working - */ - @Override - public void type(String text) { - if (text == null) { - log().warn("Text to type is null. Typing nothing."); - return; - } - if (text.isEmpty()) { - log().warn("Text to type is empty!"); - } - - findWebElement(webElement -> { - webElement.clear(); - webElement.sendKeys(text); - -// String valueProperty = webElement.getAttribute("value"); - String valueProperty = webElement.getText(); - if (valueProperty != null) { - if (!valueProperty.equals(text)) { - log().warn("Writing text to input field didn't work. Trying again."); - - webElement.clear(); - webElement.sendKeys(text); - -// if (!webElement.getAttribute("value").equals(text)) { - if (!webElement.getText().equals(text)) { - log().error("Writing text to input field didn't work on second try!"); - } - } - } else { - log().warn("Cannot perform value check after type() because " + this.toString() + - " doesn't have a value property. Consider using sendKeys() instead."); - } - }); - } }