Class RangeInputTester
java.lang.Object
com.vaadin.testbench.unit.ComponentTester<RangeInput>
com.vaadin.flow.component.html.testbench.RangeInputTester
- All Implemented Interfaces:
Clickable<RangeInput>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecrease()Decreases the value by the amount defined by component step.voiddecrease(int times) Decreases the value by a specified multiple of the component step setting.getValue()Get the current value of the component.voidincrease()Increase the value by the amount defined by component step.voidincrease(int times) Increases the value by a specified multiple of the component step setting.voidSet 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, setValueAsUserMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.testbench.unit.Clickable
click, click, click, middleClick, middleClick, rightClick, rightClick
-
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.
The value must be in the component min - max range, and should be valid according to the step scale factor, otherwise anIllegalArgumentExceptionis thrown.- Parameters:
value- value to set- Throws:
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.
If the step is not defined, anIllegalStateExceptionis thrown. AnIllegalArgumentExceptionis 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.
If the step is not defined, anIllegalStateExceptionis thrown. AnIllegalArgumentExceptionis 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 thetimesparameter 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.
If the step is not defined, anIllegalStateExceptionis thrown. AnIllegalArgumentExceptionis 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.
If the step is not defined, anIllegalStateExceptionis thrown. AnIllegalArgumentExceptionis 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 thetimesparameter is a negative integer.IllegalStateException- if component is not interactable or the step is not defined.
-