Class IntegerRangeSliderTester<T extends com.vaadin.flow.component.slider.IntegerRangeSlider>

java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.slider.IntegerRangeSliderTester<T>
Type Parameters:
T - component type
All Implemented Interfaces:
Clickable<T>

public class IntegerRangeSliderTester<T extends com.vaadin.flow.component.slider.IntegerRangeSlider> extends ComponentTester<T>
Tester for IntegerRangeSlider components.

Simulates the user dragging the start and end thumbs in the browser: setting the whole range or either endpoint, or incrementing/decrementing an endpoint by steps, with validation that the component is usable, the values stay within the min/max bounds and the start never exceeds the end.

Since:
1.1
  • Constructor Details

    • IntegerRangeSliderTester

      public IntegerRangeSliderTester(T component)
      Wrap given component for testing.
      Parameters:
      component - target component
  • Method Details

    • fromDouble

      protected Integer fromDouble(double value)
      Converts a double value to the slider's numeric type.
      Parameters:
      value - the double value to convert
      Returns:
      the converted value
    • createRange

      protected com.vaadin.flow.component.slider.IntegerRangeSliderValue createRange(Integer start, Integer end)
      Creates a range value from start and end values.
      Parameters:
      start - the start value
      end - the end value
      Returns:
      the range value
    • setValue

      public void setValue(com.vaadin.flow.component.slider.IntegerRangeSliderValue value)
      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

      public void setStart(Integer start)
      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

      public void setEnd(Integer end)
      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