Package com.vaadin.flow.component.slider
Class DecimalSliderTester<T extends DecimalSlider>
java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.slider.DecimalSliderTester<T>
- Type Parameters:
T- component type
- All Implemented Interfaces:
Clickable<T>
Tester for DecimalSlider components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSimulates the user pressing the Left/Down arrow key to decrease the value by one step.voiddecrementBy(int steps) Simulates the user dragging the slider handle to decrease the value by the given number of steps.protected DoublefromDouble(double value) Converts a double value to the slider's value type.voidSimulates the user pressing the Right/Up arrow key to increase the value by one step.voidincrementBy(int steps) Simulates the user dragging the slider handle to increase the value by the given number of steps.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.voidSimulates the user dragging the slider handle to the given value.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
-
DecimalSliderTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
fromDouble
Converts a double value to the slider's value type.- Parameters:
value- the double value to convert- Returns:
- the converted value
-
setValue
Simulates the user dragging the slider handle to the given value.Throws if the component is not usable or the value is outside the min/max range.
- Parameters:
value- value to set- Throws:
IllegalArgumentException- if the value is outside the min/max range
-
increment
public void increment()Simulates the user pressing the Right/Up arrow key to increase the value by one step. The value is clamped to the maximum. -
decrement
public void decrement()Simulates the user pressing the Left/Down arrow key to decrease the value by one step. The value is clamped to the minimum. -
incrementBy
public void incrementBy(int steps) Simulates the user dragging the slider handle to increase the value by the given number of steps. The value is clamped to the maximum.- Parameters:
steps- number of steps to increment
-
decrementBy
public void decrementBy(int steps) Simulates the user dragging the slider handle to decrease the value by the given number of steps. The value is clamped to the minimum.- Parameters:
steps- number of steps to decrement
-
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 com.vaadin.flow.component.slider.NumberSlider<?,TValue>> - 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 com.vaadin.flow.component.slider.NumberSlider<?,TValue>> - See Also:
-