Class MultiSelectComboBoxTester<T extends MultiSelectComboBox<Y>,Y>
java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.combobox.MultiSelectComboBoxTester<T,Y>
- All Implemented Interfaces:
Clickable<T>
public class MultiSelectComboBoxTester<T extends MultiSelectComboBox<Y>,Y>
extends ComponentTester<T>
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the selection by clicking the clear button, as the user would.Get the currently selected item.Get the actual items for the dropdown as a List.Get dropdown suggestions as String representations sent to the client.voidselectItem(String... selection) Select items by client string representation.voidSimulate writing a filter to the combobox.Methods inherited from class com.vaadin.browserless.ComponentTester
canSetValueAsUser, clearAsUser, clickClearButtonAsUser, ensureComponentIsUsable, ensureComponentIsUsable, ensureComponentIsUsableOrDetach, ensureVisible, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isComponentReadOnly, isUsable, isUsable, notUsableReasons, notUsableReasons, roundTrip, setModal, setPropertyAsUser, setValueAsUser, setValueAsUserMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClick
-
Constructor Details
-
MultiSelectComboBoxTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
setFilter
Simulate writing a filter to the combobox. UsegetSuggestions()to get the string values show in the dropdown orgetSuggestionItems()to get the actual items in the suggestion.- Parameters:
filter- string to use for filtering
-
selectItem
Select items by client string representation.- Parameters:
selection- item representations as strings- Throws:
IllegalStateException- if the component is not usable
-
clickClearButton
public void clickClearButton()Clears the selection by clicking the clear button, as the user would. Requires the clear button to be visible ? a hidden clear button is not something the user can click.selectItem(String...)withnullclears the selection without that requirement.- Throws:
IllegalStateException- if the component is not usable, or its clear button is not visible
-
getSelected
Get the currently selected item.- Returns:
- current selection
-
getSuggestions
Get dropdown suggestions as String representations sent to the client. Any filter that is set is taken into account.- Returns:
- List of item representation strings
-
getSuggestionItems
Get the actual items for the dropdown as a List. Any filter that is set is taken into account.- Returns:
- List of items
-