aboutsummaryrefslogtreecommitdiffstats
path: root/testbench-api/src/main/java
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2017-02-16 10:14:38 +0200
committerHenri Sara <henri.sara@gmail.com>2017-02-16 10:14:38 +0200
commit1891ffa6e1c4db8bc0d0f60eca255895a6448bdd (patch)
treee93a79a4be27fdecaadab7effc002d2f5492f9f2 /testbench-api/src/main/java
parent20947e0e0893c955ec6e42579a29a913c3c74883 (diff)
downloadvaadin-framework-1891ffa6e1c4db8bc0d0f60eca255895a6448bdd.tar.gz
vaadin-framework-1891ffa6e1c4db8bc0d0f60eca255895a6448bdd.zip
Reduce ComboBox initial requests (#8571)
* Reduce ComboBox initial requests Use initial fetched data on client side, do not request data from server side for each time popup is opened. Fixed initial filter being null for ComboBox on DataProvider, causing unnecessary size & fetch for not-changed filter. Fixed ComboBox sending default filter unnecessarily to server. Fixed wrong page indexing in VComboBox -> ComboBoxConnector. Fixes #8496 Fixes vaadin/framework8-issues#488 * Fix last item missing When pageLength was 0 and nullSelectionAllowed, the last item was not shown. Tried to sensify the API for total suggestions versus total suggestions + null selection item. * Fix ComboBox selected item updates Handles changing of ItemCaptionGenerator or ItemIconGenerator, need to update the selected item caption and icon separately. Previously it worked because all data was sent all the time to client. Doesn't fix the issue, when selected item is updated with refreshItem(), and it is not on the active range that will be sent to client. For that, ComboBox would need a separate notification about item update. * Updated screenshots
Diffstat (limited to 'testbench-api/src/main/java')
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/ComboBoxElement.java13
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();
}