Class TabsLocator

java.lang.Object
com.vaadin.browserless.locator.Locator<Tabs,TabsLocator>
com.vaadin.flow.component.tabs.TabsLocator
All Implemented Interfaces:
Clickable<Tabs>, HasThemeFilter<Tabs,TabsLocator>

@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor") public class TabsLocator extends Locator<Tabs,TabsLocator> implements Clickable<Tabs>, HasThemeFilter<Tabs,TabsLocator>
Generated locator for Tabs, derived from TabsTester. 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 Details

    • TabsLocator

      public TabsLocator()
    • TabsLocator

      public TabsLocator(Tabs component)
  • Method Details

    • getComponent

      public Tabs getComponent()
      Description copied from interface: Clickable
      Gets the component being tested.
      Specified by:
      getComponent in interface Clickable<Tabs>
      Returns:
      the component under test
    • ensureComponentIsUsable

      public void ensureComponentIsUsable()
      Description copied from interface: Clickable
      Ensures the component is in a usable state before interaction.
      Specified by:
      ensureComponentIsUsable in interface Clickable<Tabs>
    • select

      public void select(String label)
      Selects the tab with the given label. Javadoc copied from TabsTester.select(java.lang.String).
      Parameters:
      label - the tab label
    • select

      public void select(int index)
      Selects a visible tab based on its zero-based index.

      The index refers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to select tab 'C', the call must be select(1) and not select(2). Javadoc copied from TabsTester.select(int).

      Parameters:
      index - the zero-based index of the selected tab, negative value to unselect
      Throws:
      IllegalStateException - if tab at given index is not visible in the browser
      IllegalArgumentException - if the index is less than zero or greater than the number of visible tabs.
    • isSelected

      public boolean isSelected(String label)
      Checks if the tab with the given label is currently selected. Javadoc copied from TabsTester.isSelected(java.lang.String).
      Parameters:
      label - the tab label
      Returns:
      true if the tab is selected, false otherwise.
    • isSelected

      public boolean isSelected(int index)
      Checks if the visible tab at the given index is currently selected.

      The index refers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to check if tab 'C' is selected, the call must be isSelected(1) and not isSelected(2). Javadoc copied from TabsTester.isSelected(int).

      Parameters:
      index - the zero-based index of the tab
      Returns:
      true if the tab is selected, false otherwise.
      Throws:
      IllegalStateException - if tab at given index is not visible in the browser
      IllegalArgumentException - if the index is less than zero or greater than the number of visible tabs.
    • getTab

      public Tab getTab(String label)
      Gets the visible tab with the given label. Javadoc copied from TabsTester.getTab(java.lang.String).
      Parameters:
      label - the tab label
      Throws:
      IllegalStateException - if tab is not visible
    • getTab

      public Tab getTab(int index)
      Gets the visible tab at given index.

      The index refers to the zero-base position of the currently visible tabs. For example, if there are three tabs A (position 0), B (position 1) and C (position 2), but tab 'B' is hidden, then to get tab 'C', the call must be getTab(1) and not getTab(2). Javadoc copied from TabsTester.getTab(int).

      Parameters:
      index - the zero-based index of the selected tab, negative value to unselect
      Throws:
      IllegalStateException - if tab at given index is not visible in the browser
      IllegalArgumentException - if the index is less than zero or greater than the number of visible tabs.