Class RangeInputTester

java.lang.Object
com.vaadin.testbench.unit.ComponentTester<RangeInput>
com.vaadin.flow.component.html.testbench.RangeInputTester

public class RangeInputTester extends ComponentTester<RangeInput>
  • Constructor Details

    • RangeInputTester

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

    • getValue

      public Double getValue()
      Get the current value of the component.
      Returns:
      current component value
      Throws:
      IllegalStateException - if component not visible
    • setValue

      public void setValue(Double value)
      Set the value to the component if it is usable.

      For a non interactable component an IllegalStateException will be thrown as the end user would not be able to set a value.

      The value must be in the component min - max range, and should be valid according to the step scale factor, otherwise an IllegalArgumentException is thrown.
      Parameters:
      value - value to set
      Throws:
      IllegalStateException - if component is not interactable
      IllegalArgumentException - if the value is not valid based on min, max and step settings.
    • increase

      public void increase()
      Increase the value by the amount defined by component step.

      If the step is not defined, an IllegalStateException is thrown. An IllegalArgumentException is thrown if increase operation exceeds the max boundaries.
      Throws:
      IllegalStateException - if component is not interactable or the step is not defined.
    • increase

      public void increase(int times)
      Increases the value by a specified multiple of the component step setting.

      If the step is not defined, an IllegalStateException is thrown. An IllegalArgumentException is thrown if increase operation exceeds the max boundaries.
      Parameters:
      times - The number of times the component step value should be multiplied before adding to the component value. Must be a non-negative integer.
      Throws:
      IllegalArgumentException - If the times parameter is a negative integer.
      IllegalStateException - if component is not interactable or the step is not defined.
    • decrease

      public void decrease()
      Decreases the value by the amount defined by component step.

      If the step is not defined, an IllegalStateException is thrown. An IllegalArgumentException is thrown if increase operation exceeds the min boundaries.
      Throws:
      IllegalStateException - if component is not interactable or the step is not defined.
    • decrease

      public void decrease(int times)
      Decreases the value by a specified multiple of the component step setting.

      If the step is not defined, an IllegalStateException is thrown. An IllegalArgumentException is thrown if increase operation exceeds the min boundaries.
      Parameters:
      times - The number of times the component step value should be multiplied before subtracting from the component value. Must be a non-negative integer.
      Throws:
      IllegalArgumentException - If the times parameter is a negative integer.
      IllegalStateException - if component is not interactable or the step is not defined.