diff options
Diffstat (limited to 'testbench-api')
-rw-r--r-- | testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java | 13 |
1 files changed, 11 insertions, 2 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 64023c7d69..e0e4799c15 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 @@ -109,6 +109,15 @@ public class ComboBoxElement extends AbstractSelectElement { return !isReadOnly(getInputField()); } + /** + * Checks whether the suggestion popup is open or not. + * + * @return {@code true} if popup is open, {@code false if not} + */ + public boolean isPopupOpen() { + return isElementPresent(bySuggestionPopup); + } + /* * Workaround selenium's bug: sendKeys() will not send left parentheses * properly. See #14048. @@ -147,7 +156,7 @@ public class ComboBoxElement extends AbstractSelectElement { * @return List of suggestion texts */ public List<String> getPopupSuggestions() { - List<String> suggestionsTexts = new ArrayList<String>(); + List<String> suggestionsTexts = new ArrayList<>(); List<WebElement> suggestions = getPopupSuggestionElements(); for (WebElement suggestion : suggestions) { String text = suggestion.getText(); @@ -280,7 +289,7 @@ public class ComboBoxElement extends AbstractSelectElement { private void clickElement(WebElement element) { if (isFirefox()) { // Workaround for Selenium/TB and Firefox 45 issue - ((TestBenchElement) (element)).clickHiddenElement(); + ((TestBenchElement) element).clickHiddenElement(); } else { element.click(); } |