Package com.vaadin.flow.component.slider
Class DecimalRangeSliderTester<T extends DecimalRangeSlider>
java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.slider.DecimalRangeSliderTester<T>
- Type Parameters:
T- component type
- All Implemented Interfaces:
Clickable<T>
Tester for DecimalRangeSlider components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DecimalRangeSliderValuecreateRange(Double start, Double end) Creates a range value from start and end values.voidSimulates pressing the arrow key on the end thumb to decrease end by one step.voiddecrementEndBy(int steps) Simulates the user dragging the end thumb to decrease end by the given number of steps.voidSimulates pressing the arrow key on the start thumb to decrease start by one step.voiddecrementStartBy(int steps) Simulates the user dragging the start thumb to decrease start by the given number of steps.protected DoublefromDouble(double value) Converts a double value to the slider's numeric type.voidSimulates pressing the arrow key on the end thumb to increase end by one step.voidincrementEndBy(int steps) Simulates the user dragging the end thumb to increase end by the given number of steps.voidSimulates pressing the arrow key on the start thumb to increase start by one step.voidincrementStartBy(int steps) Simulates the user dragging the start thumb to increase start 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 only the end (max) thumb.voidSimulates the user dragging only the start (min) thumb.voidsetValue(DecimalRangeSliderValue value) Simulates the user dragging both thumbs to set the range 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
-
DecimalRangeSliderTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
fromDouble
Converts a double value to the slider's numeric type.- Parameters:
value- the double value to convert- Returns:
- the converted value
-
createRange
Creates a range value from start and end values.- Parameters:
start- the start valueend- the end value- Returns:
- the range value
-
setValue
Simulates the user dragging both thumbs to set the range value.Throws if the component is not usable, if start or end are outside the min/max range, or if start exceeds end.
- Parameters:
value- range value to set- Throws:
IllegalArgumentException- if the value is invalid
-
setStart
Simulates the user dragging only the start (min) thumb.- Parameters:
start- new start value- Throws:
IllegalArgumentException- if start is outside min/max or exceeds current end
-
setEnd
Simulates the user dragging only the end (max) thumb.- Parameters:
end- new end value- Throws:
IllegalArgumentException- if end is outside min/max or is below current start
-
incrementStart
public void incrementStart()Simulates pressing the arrow key on the start thumb to increase start by one step. Clamped to end value. -
decrementStart
public void decrementStart()Simulates pressing the arrow key on the start thumb to decrease start by one step. Clamped to min. -
incrementStartBy
public void incrementStartBy(int steps) Simulates the user dragging the start thumb to increase start by the given number of steps. Clamped to end value.- Parameters:
steps- number of steps to increment
-
decrementStartBy
public void decrementStartBy(int steps) Simulates the user dragging the start thumb to decrease start by the given number of steps. Clamped to min.- Parameters:
steps- number of steps to decrement
-
incrementEnd
public void incrementEnd()Simulates pressing the arrow key on the end thumb to increase end by one step. Clamped to max. -
decrementEnd
public void decrementEnd()Simulates pressing the arrow key on the end thumb to decrease end by one step. Clamped to start value. -
incrementEndBy
public void incrementEndBy(int steps) Simulates the user dragging the end thumb to increase end by the given number of steps. Clamped to max.- Parameters:
steps- number of steps to increment
-
decrementEndBy
public void decrementEndBy(int steps) Simulates the user dragging the end thumb to decrease end by the given number of steps. Clamped to start value.- 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.NumberRangeSlider<?,TValue, TNumber>> - 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.NumberRangeSlider<?,TValue, TNumber>> - See Also:
-