Package com.vaadin.flow.component.login
Class LoginOverlayTester<T extends LoginOverlay>
java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.login.AbstractLoginTester<T>
com.vaadin.flow.component.login.LoginOverlayTester<T>
- Type Parameters:
T- component type
- All Implemented Interfaces:
Clickable<T>
Tester for LoginOverlay components.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R extends Component>
ComponentQuery<R> findInCustomFormArea(Class<R> componentType) Searches the overlay's custom form area for components of the given type.<R extends Component>
ComponentQuery<R> findInFooter(Class<R> componentType) Searches the overlay's footer for components of the given type.booleanisOpen()Check if login overlay is open.booleanisUsable()Validate that component can be interacted with and should be visible in the UI.protected voidnotUsableReasons(Consumer<String> collector) Provides messages explaining why the component is actually not usable.voidOpen LoginOverlay to enable logging in through it.Methods inherited from class com.vaadin.flow.component.login.AbstractLoginTester
forgotPassword, loginMethods inherited from class com.vaadin.browserless.ComponentTester
canSetValueAsUser, clearAsUser, clickClearButtonAsUser, ensureComponentIsUsable, ensureComponentIsUsable, ensureComponentIsUsableOrDetach, ensureVisible, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isComponentReadOnly, isUsable, notUsableReasons, roundTrip, setModal, setPropertyAsUser, setValueAsUser, setValueAsUserMethods 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, rightClick
-
Constructor Details
-
LoginOverlayTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
isUsable
public boolean isUsable()Description copied from class:ComponentTesterValidate that component can be interacted with and should be visible in the UI. Subclasses overriding this method should also overrideComponentTester.notUsableReasons(Consumer)to provide additional details to the potential exception thrown byComponentTester.ensureComponentIsUsable().- Overrides:
isUsablein classComponentTester<T extends LoginOverlay>- Returns:
trueif component can be interacted with by the user- See Also:
-
notUsableReasons
Description copied from class:ComponentTesterProvides messages explaining why the component is actually not usable. Subclasses overridingComponentTester.isUsable()should also override this method to provide additional details to the potential exception throw byComponentTester.ensureComponentIsUsable().- Overrides:
notUsableReasonsin classComponentTester<T extends LoginOverlay>- See Also:
-
openOverlay
public void openOverlay()Open LoginOverlay to enable logging in through it. -
isOpen
public boolean isOpen()Check if login overlay is open.- Returns:
trueif overlay is open and visible
-
findInCustomFormArea
Searches the overlay's custom form area for components of the given type.The custom form area is the area inside the login form, filled with
login.getCustomFormArea().add(...). Components nested inside it are found too, so a field inside a layout added to the area is reached as well as a field added to the area directly.- Type Parameters:
R- the type of the components to search for- Parameters:
componentType- the type of the components to search for- Returns:
- a query for components of the given type in the overlay's custom form area
- Throws:
IllegalStateException- if the overlay is not usable, e.g. not open
-