Class BreadcrumbsTester<T extends Breadcrumbs>

java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.breadcrumbs.BreadcrumbsTester<T>
All Implemented Interfaces:
Clickable<T>

public class BreadcrumbsTester<T extends Breadcrumbs> extends ComponentTester<T>
  • Constructor Details

    • BreadcrumbsTester

      public BreadcrumbsTester(T component)
      Wrap given component for testing.
      Parameters:
      component - target component
  • Method Details

    • getItemTexts

      public List<String> getItemTexts()
      Gets the labels of the breadcrumb items, in trail order.
      Returns:
      the item labels
    • clickItem

      public void clickItem(String text)
      Simulates a click on the item that matches the given label, navigating to its path.
      Parameters:
      text - the label of the breadcrumb item, not null
      Throws:
      IllegalArgumentException - if no item matches the label
      IllegalStateException - if more than one item matches, or the item has no path (e.g. the current-page item)
    • clickItem

      public void clickItem(int index)
      Simulates a click on the item at the given position in the trail, navigating to its path.
      Parameters:
      index - the zero-based position of the item in the trail
      Throws:
      IllegalArgumentException - if there is no item at the given index
      IllegalStateException - if the item has no path (e.g. the current-page item)