com.vaadin.flow.component.listbox.

Class ListBoxTester<T extends ListBox<V>,V>

java.lang.Object
com.vaadin.testbench.unit.ComponentTester<T>
com.vaadin.flow.component.listbox.ListBoxTester<T,V>

Type Parameters:

T - component type

V - value type

public class ListBoxTester<T extends ListBox<V>,V> extends ComponentTester<T>

Tester for ListBox components.

  • Constructor Details

    • ListBoxTester

      public ListBoxTester(T component)

      Wrap given component for testing.

      Parameters:

      component - target component

  • Method Details

    • getSelected

      public V getSelected()

      Get the currently selected item.

      Returns:

      current selection

    • selectItem

      public void selectItem(String selection)

      Select item by client string representation.

      Parameters:

      selection - item representation string

    • getSuggestions

      public List<String> getSuggestions()

      Get available items as String representations sent to the client. Any filter that is set is taken into account.

      Returns:

      List of item representation strings

    • getSuggestionItems

      public List<V> getSuggestionItems()

      Get the actual items for the dropdown as a List. Any filter that is set is taken into account.

      Returns:

      List of items