aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-04-13 11:12:48 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-05-08 14:46:35 +0300
commit8f1b372a72700c50e4e4a1d7835099087467aeeb (patch)
treeb6b921174afe60aff8630386903ea6c0e40547b8
parent24f7870c17cadae7d7cd1f4d1babb433ab1e2328 (diff)
downloadvaadin-framework-8f1b372a72700c50e4e4a1d7835099087467aeeb.tar.gz
vaadin-framework-8f1b372a72700c50e4e4a1d7835099087467aeeb.zip
Remove sendKeys workaround from ComboBoxElement (#9046)
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java28
1 files changed, 1 insertions, 27 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java
index e0e4799c15..11b823e656 100644
--- a/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java
+++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java
@@ -20,7 +20,6 @@ import java.util.Collections;
import java.util.List;
import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
@@ -54,7 +53,7 @@ public class ComboBoxElement extends AbstractSelectElement {
return;
}
getInputField().clear();
- sendInputFieldKeys(text);
+ getInputField().sendKeys(text);
selectSuggestion(text);
}
@@ -118,31 +117,6 @@ public class ComboBoxElement extends AbstractSelectElement {
return isElementPresent(bySuggestionPopup);
}
- /*
- * Workaround selenium's bug: sendKeys() will not send left parentheses
- * properly. See #14048.
- */
- private void sendInputFieldKeys(String text) {
- WebElement textBox = getInputField();
- if (!text.contains("(")) {
- textBox.sendKeys(text);
- return;
- }
-
- String OPEN_PARENTHESES = "_OPEN_PARENT#H#ESES_";
- String tamperedText = text.replaceAll("\\(", OPEN_PARENTHESES);
- textBox.sendKeys(tamperedText);
-
- JavascriptExecutor js = getCommandExecutor();
- String jsScript = String.format(
- "arguments[0].value = arguments[0].value.replace(/%s/g, '(')",
- OPEN_PARENTHESES);
- js.executeScript(jsScript, textBox);
-
- // refresh suggestions popupBox
- textBox.sendKeys("a" + Keys.BACK_SPACE);
- }
-
/**
* Open the suggestion popup
*/