Class IntegerRangeSliderTester<T extends 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 IntegerRangeSlider> extends ComponentTester<T>
Tester for IntegerRangeSlider components.
  • 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 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(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
    • isUsable

      public boolean isUsable()
      Description copied from class: ComponentTester
      Validate that component can be interacted with and should be visible in the UI. Subclasses overriding this method should also override ComponentTester.notUsableReasons(Consumer) to provide additional details to the potential exception thrown by ComponentTester.ensureComponentIsUsable().
      Overrides:
      isUsable in class ComponentTester<T extends com.vaadin.flow.component.slider.NumberRangeSlider<?,TValue,TNumber>>
      Returns:
      true if component can be interacted with by the user
      See Also:
    • notUsableReasons

      protected void notUsableReasons(Consumer<String> collector)
      Description copied from class: ComponentTester
      Provides messages explaining why the component is actually not usable. Subclasses overriding ComponentTester.isUsable() should also override this method to provide additional details to the potential exception throw by ComponentTester.ensureComponentIsUsable().
      Overrides:
      notUsableReasons in class ComponentTester<T extends com.vaadin.flow.component.slider.NumberRangeSlider<?,TValue,TNumber>>
      See Also: