Package com.vaadin.flow.component
Class TextTester<T extends Text>
java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.TextTester<T>
- Type Parameters:
T- component type
- All Implemented Interfaces:
Clickable<T>
Tester for Text components.
Text renders as a text node rather than an HTML element, so it has no
visibility or enabled state of its own (Component.isVisible() throws, and
a text node cannot be disabled). Usability is therefore derived from the
component being attached and from the effective visibility of its parent
subtree.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetText()Gets the text of the component.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.Methods inherited from class com.vaadin.browserless.ComponentTester
ensureComponentIsUsable, ensureComponentIsUsable, ensureVisible, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isUsable, notUsableReasons, roundTrip, setModal, 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
-
TextTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
getText
Gets the text of the component.- Returns:
- the text, never
null - Throws:
IllegalStateException- if the component is not usable
-
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 Text>- 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 Text>- See Also:
-