Class PopoverTester

  • All Implemented Interfaces:
    com.vaadin.browserless.Clickable

    
    public class PopoverTester
    extends ComponentTester<Popover>
                        

    Tester for Popover components.

    Since:

    1.0

    • 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
      PopoverTester(Popover component) Wrap given component for testing.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static PopoverTester forTarget(ComponentQuery<out Component> query) Creates a PopoverTester for the popover that targets the component matching the given query.
      static PopoverTester forTarget(Component target) Creates a PopoverTester for the popover that targets the given component.
      void open() Open the popover.
      void close() Close the popover.
      void clickTarget() Simulates clicking the target component to open the popover.
      void hoverTarget() Simulates hovering the target component to open the popover.
      void focusTarget() Simulates focusing the target component to open the popover.
      void pressEscape() Simulates pressing Escape to close the popover.
      void clickOutside() Simulates clicking outside the popover to close it.
      boolean isOpen() Check if the popover is open.
      boolean isUsable() Validate that component can be interacted with and should be visible in the UI.
      • Methods inherited from class com.vaadin.browserless.ComponentTester

        ensureComponentIsUsable, find, getComponent, setModal
      • Methods inherited from class com.vaadin.browserless.Clickable

        click, click, click, middleClick, middleClick, rightClick, rightClick
      • Methods inherited from class java.lang.Object

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

      • PopoverTester

        PopoverTester(Popover component)

        Wrap given component for testing.

        Parameters:
        component - target component
    • Method Detail

      • forTarget

         static PopoverTester forTarget(ComponentQuery<out Component> query)

        Creates a PopoverTester for the popover that targets the component matching the given query.

        Parameters:
        query - a query that resolves to the target component
        Returns:

        a tester for the popover targeting the matched component

      • forTarget

         static PopoverTester forTarget(Component target)

        Creates a PopoverTester for the popover that targets the given component.

        Parameters:
        target - the target component of the popover
        Returns:

        a tester for the popover targeting the given component

      • open

         void open()

        Open the popover.

      • close

         void close()

        Close the popover.

      • clickTarget

         void clickTarget()

        Simulates clicking the target component to open the popover.

      • hoverTarget

         void hoverTarget()

        Simulates hovering the target component to open the popover.

      • focusTarget

         void focusTarget()

        Simulates focusing the target component to open the popover.

      • pressEscape

         void pressEscape()

        Simulates pressing Escape to close the popover.

      • clickOutside

         void clickOutside()

        Simulates clicking outside the popover to close it.

      • isOpen

         boolean isOpen()

        Check if the popover is open.

        Returns:

        true if the popover is open

      • isUsable

         boolean isUsable()

        Validate that component can be interacted with and should be visible in the UI. Subclasses overriding this method should also override notUsableReasons to provide additional details to the potential exception thrown by ensureComponentIsUsable.

        Returns:

        true if component can be interacted with by the user