Class PopoverTester
-
- All Implemented Interfaces:
-
com.vaadin.browserless.Clickable
public class PopoverTester extends ComponentTester<Popover>
Tester for Popover components.
- Since:
1.0
-
-
Constructor Summary
Constructors Constructor Description PopoverTester(Popover component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description static PopoverTesterforTarget(ComponentQuery<out Component> query)Creates a PopoverTester for the popover that targets the component matching the given query. static PopoverTesterforTarget(Component target)Creates a PopoverTester for the popover that targets the given component. voidopen()Open the popover. voidclose()Close the popover. voidclickTarget()Simulates clicking the target component to open the popover. voidhoverTarget()Simulates hovering the target component to open the popover. voidfocusTarget()Simulates focusing the target component to open the popover. voidpressEscape()Simulates pressing Escape to close the popover. voidclickOutside()Simulates clicking outside the popover to close it. booleanisOpen()Check if the popover is open. booleanisUsable()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
-
-
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:
trueif component can be interacted with by the user
-
-
-
-