Class DialogTester
-
- All Implemented Interfaces:
-
com.vaadin.browserless.Clickable
public class DialogTester extends ComponentTester<Dialog>
- Since:
1.0
-
-
Constructor Summary
Constructors Constructor Description DialogTester(Dialog component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description voidopen()Open the dialog. voidclose()Close the dialog from the server side, like the application calling close. voidpressEscape()Simulates pressing Escape to close the dialog. voidclickOutside()Simulates clicking outside the dialog to close it. booleanisOpen()Check if the dialog 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
-
open
void open()
Open the dialog.
-
close
void close()
Close the dialog from the server side, like the application calling close.
This is not something the user can do: the dialog is closed regardless of isCloseOnEsc and isCloseOnOutsideClick, and no Dialog.DialogCloseActionEvent is fired, so a close action listener cannot veto it. To simulate the user dismissing the dialog, use pressEscape or clickOutside instead.
-
pressEscape
void pressEscape()
Simulates pressing Escape to close the dialog.
If the application has registered a close action listener, a Dialog.DialogCloseActionEvent is fired instead of closing the dialog, leaving it up to the listener whether to close it.
-
clickOutside
void clickOutside()
Simulates clicking outside the dialog to close it.
If the application has registered a close action listener, a Dialog.DialogCloseActionEvent is fired instead of closing the dialog, leaving it up to the listener whether to close it.
-
isOpen
boolean isOpen()
Check if the dialog is open.
- Returns:
true if the dialog 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
-
-
-
-