Class DialogLocator

java.lang.Object
com.vaadin.browserless.locator.Locator<com.vaadin.flow.component.dialog.Dialog,DialogLocator>
com.vaadin.flow.component.dialog.DialogLocator
All Implemented Interfaces:
Clickable<com.vaadin.flow.component.dialog.Dialog>, HasThemeFilter<com.vaadin.flow.component.dialog.Dialog,DialogLocator>

@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor") public class DialogLocator extends Locator<com.vaadin.flow.component.dialog.Dialog,DialogLocator> implements Clickable<com.vaadin.flow.component.dialog.Dialog>, HasThemeFilter<com.vaadin.flow.component.dialog.Dialog,DialogLocator>
Generated locator for 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 Details

    • DialogLocator

      public DialogLocator()
      Creates a locator that searches for a Dialog.
    • DialogLocator

      public DialogLocator(com.vaadin.flow.component.dialog.Dialog component)
      Creates a locator already bound to the given component, so that the action methods run against it instead of against a lookup.
      Parameters:
      component - the component the locator resolves to
  • Method Details

    • getComponent

      public com.vaadin.flow.component.dialog.Dialog getComponent()
      Description copied from interface: Clickable
      Gets the component being tested.
      Specified by:
      getComponent in interface Clickable<com.vaadin.flow.component.dialog.Dialog>
      Returns:
      the component under test
    • ensureComponentIsUsable

      public void ensureComponentIsUsable()
      Description copied from interface: Clickable
      Ensures the component is in a usable state before interaction.
      Specified by:
      ensureComponentIsUsable in interface Clickable<com.vaadin.flow.component.dialog.Dialog>
    • open

      public void open()
      Open the dialog. Javadoc copied from DialogTester.open().
    • close

      public void close()
      Close the dialog from the server side, like the application calling Dialog.close().

      This is not something the user can do: the dialog is closed regardless of Dialog.isCloseOnEsc() and Dialog.isCloseOnOutsideClick(), and no Dialog.DialogCloseActionEvent is fired, so a close action listener cannot veto it. To simulate the user dismissing the dialog, use DialogTester.pressEscape() or DialogTester.clickOutside() instead. Javadoc copied from DialogTester.close().

    • pressEscape

      public 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. Javadoc copied from DialogTester.pressEscape().

      Throws:
      IllegalStateException - if the dialog is not usable, e.g. not open, or close-on-Esc is disabled
      Since:
      25.3
    • clickOutside

      public 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. Javadoc copied from DialogTester.clickOutside().

      Throws:
      IllegalStateException - if the dialog is not usable, e.g. not open, or close-on-outside-click is disabled
      Since:
      25.3
    • isOpen

      public boolean isOpen()
      Check if the dialog is open. Javadoc copied from DialogTester.isOpen().
      Returns:
      true if the dialog is open
      Since:
      25.3