diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-04-13 11:12:48 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-13 11:12:48 +0300 |
commit | 03d1f694685f7713ac6c24ae97fca9296fe11d4d (patch) | |
tree | 934bc8c0807944b6f39ebe7e27664babc6df915b /testbench-api/src/main/java/com | |
parent | cf93a67297f8936cd3b6456806bcc4a1e804a732 (diff) | |
download | vaadin-framework-03d1f694685f7713ac6c24ae97fca9296fe11d4d.tar.gz vaadin-framework-03d1f694685f7713ac6c24ae97fca9296fe11d4d.zip |
Remove sendKeys workaround from ComboBoxElement (#9046)
Diffstat (limited to 'testbench-api/src/main/java/com')
-rw-r--r-- | testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java | 28 |
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 */ |