Class ComboBoxLocator<Y>
java.lang.Object
com.vaadin.browserless.locator.Locator<ComboBox<Y>,ComboBoxLocator<Y>>
com.vaadin.flow.component.combobox.ComboBoxLocator<Y>
- All Implemented Interfaces:
Clickable<ComboBox<Y>>,HasAriaLabelFilter<ComboBox<Y>,,ComboBoxLocator<Y>> HasLabelFilter<ComboBox<Y>,,ComboBoxLocator<Y>> HasThemeFilter<ComboBox<Y>,,ComboBoxLocator<Y>> HasValueFilter<ComboBox<Y>,Y, ComboBoxLocator<Y>>
@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor")
public class ComboBoxLocator<Y>
extends Locator<ComboBox<Y>,ComboBoxLocator<Y>>
implements Clickable<ComboBox<Y>>, HasLabelFilter<ComboBox<Y>,ComboBoxLocator<Y>>, HasAriaLabelFilter<ComboBox<Y>,ComboBoxLocator<Y>>, HasValueFilter<ComboBox<Y>,Y,ComboBoxLocator<Y>>, HasThemeFilter<ComboBox<Y>,ComboBoxLocator<Y>>
Generated locator for
ComboBox, derived from
ComboBoxTester. Filter steps are inherited from
Locator; action methods delegate to a fresh tester
around the resolved component, so behavioral changes belong on the
tester, not here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEnsures the component is in a usable state before interaction.Gets the component being tested.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) Selects an item by its string representation (label).voidSimulate writing a filter to the combobox.Methods inherited from class com.vaadin.browserless.locator.Locator
atIndex, component, components, exists, inside, inside, invalidate, self, with, withAttribute, withAttribute, withClassName, withCondition, withId, withoutAttribute, withoutAttribute, withoutClassNameMethods 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, rightClickMethods inherited from interface com.vaadin.browserless.locator.HasAriaLabelFilter
withAriaLabel, withAriaLabelContainingMethods inherited from interface com.vaadin.browserless.locator.HasLabelFilter
withLabel, withLabelContainingMethods inherited from interface com.vaadin.browserless.locator.HasThemeFilter
withoutTheme, withThemeMethods inherited from interface com.vaadin.browserless.locator.HasValueFilter
withValue
-
Constructor Details
-
ComboBoxLocator
-
ComboBoxLocator
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<Y>- Returns:
- the component under test
-
ensureComponentIsUsable
public void ensureComponentIsUsable()Description copied from interface:ClickableEnsures the component is in a usable state before interaction.- Specified by:
ensureComponentIsUsablein interfaceClickable<Y>
-
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. Javadoc copied fromComboBoxTester.setFilter(java.lang.String).- Parameters:
filter- string to use for filtering
-
selectItem
Selects an item by its string representation (label).This method searches for the item among the current suggestions, which are affected by any filter set via
setFilter(String). If no filter is set, all items are available for selection. If a filter is set, only the filtered items can be selected.To select an item when the ComboBox uses custom filtering logic (e.g., set via
setItems(ItemFilter, Collection)), first callsetFilter(String)to apply the filter, then call this method to select from the filtered results.Example usage with filtering:
// Apply filter first comboBoxTester.setFilter("search text"); // Then select from filtered items comboBoxTester.selectItem("Matching Item Label");Javadoc copied fromComboBoxTester.selectItem(java.lang.String).- Parameters:
selection- the item's string representation (label) to select, ornullto clear the selection- Throws:
IllegalArgumentException- if no item with the given label is found among current suggestions- See Also:
-
getSelected
Get the currently selected item. Javadoc copied fromComboBoxTester.getSelected().- Returns:
- current selection
-
getSuggestions
Get dropdown suggestions as String representations sent to the client. Any filter that is set is taken into account. Javadoc copied fromComboBoxTester.getSuggestions().- 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. Javadoc copied fromComboBoxTester.getSuggestionItems().- Returns:
- List of items
-