Class LoginOverlayTester<T extends LoginOverlay>

Type Parameters:
T - component type
All Implemented Interfaces:
Clickable<T>

public class LoginOverlayTester<T extends LoginOverlay> extends AbstractLoginTester<T>
Tester for LoginOverlay components.
Since:
1.0
  • Constructor Details

    • LoginOverlayTester

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

    • isUsable

      public boolean isUsable()
      Description copied from class: ComponentTester
      Validate that component can be interacted with and should be visible in the UI. Subclasses overriding this method should also override ComponentTester.notUsableReasons(Consumer) to provide additional details to the potential exception thrown by ComponentTester.ensureComponentIsUsable().
      Overrides:
      isUsable in class ComponentTester<T extends LoginOverlay>
      Returns:
      true if component can be interacted with by the user
      See Also:
    • notUsableReasons

      protected void notUsableReasons(Consumer<String> collector)
      Description copied from class: ComponentTester
      Provides messages explaining why the component is actually not usable. Subclasses overriding ComponentTester.isUsable() should also override this method to provide additional details to the potential exception throw by ComponentTester.ensureComponentIsUsable().
      Overrides:
      notUsableReasons in class ComponentTester<T extends LoginOverlay>
      See Also:
    • openOverlay

      public void openOverlay()
      Open LoginOverlay to enable logging in through it.
    • isOpen

      public boolean isOpen()
      Check if login overlay is open.
      Returns:
      true if overlay is open and visible
    • findInFooter

      public <R extends Component> ComponentQuery<R> findInFooter(Class<R> componentType)
      Searches the overlay's footer for components of the given type.

      The footer is the area below the login form, filled with login.getFooter().add(...). Components nested inside the footer content are found too, so a button inside a footer layout is reached as well as a button added to the footer directly.

      Type Parameters:
      R - the type of the components to search for
      Parameters:
      componentType - the type of the components to search for
      Returns:
      a query for components of the given type in the overlay's footer
      Throws:
      IllegalStateException - if the overlay is not usable, e.g. not open
    • findInCustomFormArea

      public <R extends Component> ComponentQuery<R> findInCustomFormArea(Class<R> componentType)
      Searches the overlay's custom form area for components of the given type.

      The custom form area is the area inside the login form, filled with login.getCustomFormArea().add(...). Components nested inside it are found too, so a field inside a layout added to the area is reached as well as a field added to the area directly.

      Type Parameters:
      R - the type of the components to search for
      Parameters:
      componentType - the type of the components to search for
      Returns:
      a query for components of the given type in the overlay's custom form area
      Throws:
      IllegalStateException - if the overlay is not usable, e.g. not open