Class TestingLifecycleHooks

java.lang.Object
com.vaadin.browserless.internal.TestingLifecycleHooks

public final class TestingLifecycleHooks extends Object
Holds the current TestingLifecycleHook and the dialog clean-up.

For internal use only. May be renamed or removed in a future release.

  • Method Details

    • isTemplate

      public static boolean isTemplate(com.vaadin.flow.component.Component component)
      Checks whether the given component is a Lit or Polymer template.
      Parameters:
      component - the component.
      Returns:
      true if the component is a template.
    • getTestingLifecycleHook

      public static TestingLifecycleHook getTestingLifecycleHook()
      If you need to hook into the testing lifecycle (e.g. you need to wait for any async operations to finish), set your custom implementation via setTestingLifecycleHook(TestingLifecycleHook). See TestingLifecycleHook for more info on where exactly you can hook into.
      Returns:
      the current hook.
    • setTestingLifecycleHook

      public static void setTestingLifecycleHook(TestingLifecycleHook testingLifecycleHook)
      Sets the testing lifecycle hook, see TestingLifecycleHook.
      Parameters:
      testingLifecycleHook - the hook, not null.
    • cleanupDialogs

      public static void cleanupDialogs()
      Flow Server does not close the dialog when Dialog.close() is called; instead it tells client-side dialog to close, which then fires event back to the server that the dialog was closed, and removes itself from the DOM. Since there's no browser with browserless testing, we need to cleanup closed dialogs manually, hence this method. Which components are closed dialogs comes from the registered ComponentSupport implementations.