Class TabsTester

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final T component
    • Constructor Summary

      Constructors 
      Constructor Description
      TabsTester(T component) Wrap given component for testing.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void select(String label) Selects the tab with the given label.
      void select(int index) Selects a visible tab based on its zero-based index.
      boolean isSelected(String label) Checks if the tab with the given label is currently selected.
      boolean isSelected(int index) Checks if the visible tab at the given index is currently selected.
      Tab getTab(String label) Gets the visible tab with the given label.
      Tab getTab(int index) Gets the visible tab at given index.
      • Methods inherited from class com.vaadin.testbench.unit.ComponentTester

        find, getComponent, isUsable, setModal
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TabsTester

        TabsTester(T component)
        Wrap given component for testing.
        Parameters:
        component - target component
    • Method Detail

      • select

         void select(String label)

        Selects the tab with the given label.

        Parameters:
        label - the tab label
      • select

         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).

        Parameters:
        index - the zero-based index of the selected tab, negative value to unselect
      • isSelected

         boolean isSelected(String label)

        Checks if the tab with the given label is currently selected.

        Parameters:
        label - the tab label
        Returns:

        true if the tab is selected, false otherwise.

      • isSelected

         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).

        Parameters:
        index - the zero-based index of the tab
        Returns:

        true if the tab is selected, false otherwise.

      • getTab

         Tab getTab(String label)

        Gets the visible tab with the given label.

        Parameters:
        label - the tab label
      • getTab

         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).

        Parameters:
        index - the zero-based index of the selected tab, negative value to unselect