Class NumberFieldTester<T extends AbstractNumberField<T,V>,V extends Number>
java.lang.Object
com.vaadin.testbench.unit.ComponentTester<T>
com.vaadin.flow.component.textfield.NumberFieldTester<T,V>
- Type Parameters:
T
- component typeV
- value type
public class NumberFieldTester<T extends AbstractNumberField<T,V>,V extends Number>
extends ComponentTester<T>
Tester for NumberField components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isUsable()
Validate that component can be interacted with and should be visible in the UI.protected void
notUsableReasons
(Consumer<String> collector) Provides messages explaining why the component is actually not usable.void
Set the given value for the component.Methods inherited from class com.vaadin.testbench.unit.ComponentTester
ensureComponentIsUsable, ensureComponentIsUsable, ensureVisible, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isUsable, notUsableReasons, roundTrip, setModal
-
Constructor Details
-
NumberFieldTester
Wrap given component for testing.- Parameters:
component
- target component
-
-
Method Details
-
setValue
Set the given value for the component.Throws if component is not usable or the value is invalid.
- Parameters:
value
- value to set- Throws:
IllegalArgumentException
- if given value is not valid
-
isUsable
public boolean isUsable()Description copied from class:ComponentTester
Validate 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:
isUsable
in classComponentTester<T extends AbstractNumberField<T,
V>> - Returns:
true
if component can be interacted with by the user- See Also:
-
notUsableReasons
Description copied from class:ComponentTester
Provides 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:
notUsableReasons
in classComponentTester<T extends AbstractNumberField<T,
V>> - See Also:
-