com.vaadin.flow.component.html.testbench.
Class RangeInputTester
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
decrease()
Decreases the value by the amount defined by component step.
void
decrease
(int times) Decreases the value by a specified multiple of the component step setting.
getValue()
Get the current value of the component.
void
increase()
Increase the value by the amount defined by component step.
void
increase
(int times) Increases the value by a specified multiple of the component step setting.
void
Set the value to the component if it is usable.
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, isUsable, notUsableReasons, notUsableReasons, roundTrip, setModal
-
Constructor Details
-
RangeInputTester
Wrap given component for testing.
Parameters:
component
- target component
-
-
Method Details
-
getValue
Get the current value of the component.
Returns:
current component value
Throws:
IllegalStateException
- if component not visible -
setValue
Set the value to the component if it is usable.
For a non interactable component an IllegalStateException will be thrown as the end user would not be able to set a value.
IllegalArgumentException
is thrown.Parameters:
value
- value to setThrows:
IllegalStateException
- if component is not interactableIllegalArgumentException
- if the value is not valid based on min, max and step settings. -
increase
public void increase()Increase the value by the amount defined by component step.
IllegalStateException
is thrown. AnIllegalArgumentException
is thrown if increase operation exceeds the max boundaries.Throws:
IllegalStateException
- if component is not interactable or the step is not defined. -
increase
public void increase(int times) Increases the value by a specified multiple of the component step setting.
IllegalStateException
is thrown. AnIllegalArgumentException
is thrown if increase operation exceeds the max boundaries.Parameters:
times
- The number of times the component step value should be multiplied before adding to the component value. Must be a non-negative integer.Throws:
IllegalArgumentException
- If thetimes
parameter is a negative integer.IllegalStateException
- if component is not interactable or the step is not defined. -
decrease
public void decrease()Decreases the value by the amount defined by component step.
IllegalStateException
is thrown. AnIllegalArgumentException
is thrown if increase operation exceeds the min boundaries.Throws:
IllegalStateException
- if component is not interactable or the step is not defined. -
decrease
public void decrease(int times) Decreases the value by a specified multiple of the component step setting.
IllegalStateException
is thrown. AnIllegalArgumentException
is thrown if increase operation exceeds the min boundaries.Parameters:
times
- The number of times the component step value should be multiplied before subtracting from the component value. Must be a non-negative integer.Throws:
IllegalArgumentException
- If thetimes
parameter is a negative integer.IllegalStateException
- if component is not interactable or the step is not defined.
-