Package com.vaadin.browserless.internal
Class TestingLifecycleHooks
java.lang.Object
com.vaadin.browserless.internal.TestingLifecycleHooks
Holds the current
TestingLifecycleHook and the dialog clean-up.
For internal use only. May be renamed or removed in a future release.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidFlow Server does not close the dialog whenDialog.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.static TestingLifecycleHookIf you need to hook into the testing lifecycle (e.g. you need to wait for any async operations to finish), set your custom implementation viasetTestingLifecycleHook(TestingLifecycleHook).static booleanisTemplate(Component component) Checks whether the given component is a Lit or Polymer template.static voidsetTestingLifecycleHook(TestingLifecycleHook testingLifecycleHook) Sets the testing lifecycle hook, seeTestingLifecycleHook.
-
Method Details
-
isTemplate
Checks whether the given component is a Lit or Polymer template.- Parameters:
component- the component.- Returns:
- true if the component is a template.
-
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 viasetTestingLifecycleHook(TestingLifecycleHook). SeeTestingLifecycleHookfor more info on where exactly you can hook into.- Returns:
- the current hook.
-
setTestingLifecycleHook
Sets the testing lifecycle hook, seeTestingLifecycleHook.- Parameters:
testingLifecycleHook- the hook, not null.
-
cleanupDialogs
public static void cleanupDialogs()Flow Server does not close the dialog whenDialog.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 registeredComponentSupportimplementations.
-