Class IntegerSliderTester<T extends IntegerSlider>

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

public class IntegerSliderTester<T extends IntegerSlider> extends ComponentTester<T>
Tester for IntegerSlider components.
  • Constructor Details

    • IntegerSliderTester

      public IntegerSliderTester(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 value type.
      Parameters:
      value - the double value to convert
      Returns:
      the converted value
    • setValue

      public void setValue(Integer value)
      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: 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.NumberSlider<?,TValue>>
      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.NumberSlider<?,TValue>>
      See Also: