true
if text input is allowed, false
* otherwise
*/
public boolean isTextInputAllowed() {
return !isReadOnly(getInputField());
}
/*
* 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
*/
public void openPopup() {
findElement(By.vaadin("#button")).click();
}
/**
* Gets the text representation of all suggestions on the current page
*
* @return List of suggestion texts
*/
public List
* Opens the popup if not already open.
*
* @return a list of elements for the suggestions on the current page
*/
public List