Class DialogLocator
- All Implemented Interfaces:
Clickable<Dialog>,HasThemeFilter<Dialog,DialogLocator>
Dialog, derived from
DialogTester. Filter steps are inherited from
Locator; action methods delegate to a fresh tester
around the resolved component, so behavioral changes belong on the
tester, not here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSimulates clicking outside the dialog to close it.voidclose()Close the dialog from the server side, like the application callingDialog.close().voidEnsures the component is in a usable state before interaction.Gets the component being tested.booleanisOpen()Check if the dialog is open.voidopen()Open the dialog.voidSimulates pressing Escape to close the dialog.Methods inherited from class com.vaadin.browserless.locator.Locator
atIndex, component, components, exists, inside, inside, invalidate, self, with, withAttribute, withAttribute, withClassName, withCondition, withId, withinSlot, withoutAttribute, withoutAttribute, withoutClassName, withTestIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.browserless.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClickMethods inherited from interface com.vaadin.browserless.locator.HasThemeFilter
withoutTheme, withoutTheme, withTheme, withTheme
-
Constructor Details
-
DialogLocator
public DialogLocator() -
DialogLocator
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<Dialog>- Returns:
- the component under test
-
ensureComponentIsUsable
public void ensureComponentIsUsable()Description copied from interface:ClickableEnsures the component is in a usable state before interaction.- Specified by:
ensureComponentIsUsablein interfaceClickable<Dialog>
-
open
public void open()Open the dialog. Javadoc copied fromDialogTester.open(). -
close
public void close()Close the dialog from the server side, like the application callingDialog.close().This is not something the user can do: the dialog is closed regardless of
Dialog.isCloseOnEsc()andDialog.isCloseOnOutsideClick(), and noDialog.DialogCloseActionEventis fired, so a close action listener cannot veto it. To simulate the user dismissing the dialog, usepressEscape()orclickOutside()instead. Javadoc copied fromDialogTester.close(). -
pressEscape
public void pressEscape()Simulates pressing Escape to close the dialog.If the application has registered a close action listener, a
Dialog.DialogCloseActionEventis fired instead of closing the dialog, leaving it up to the listener whether to close it. Javadoc copied fromDialogTester.pressEscape().- Throws:
IllegalStateException- if the dialog is not usable, e.g. not open, or close-on-Esc is disabled
-
clickOutside
public void clickOutside()Simulates clicking outside the dialog to close it.If the application has registered a close action listener, a
Dialog.DialogCloseActionEventis fired instead of closing the dialog, leaving it up to the listener whether to close it. Javadoc copied fromDialogTester.clickOutside().- Throws:
IllegalStateException- if the dialog is not usable, e.g. not open, or close-on-outside-click is disabled
-
isOpen
public boolean isOpen()Check if the dialog is open. Javadoc copied fromDialogTester.isOpen().- Returns:
- true if the dialog is open
-