Class TextFieldTester<T extends TextFieldBase<T,V>,V>

java.lang.Object
com.vaadin.browserless.ComponentTester<T>
com.vaadin.flow.component.textfield.TextFieldTester<T,V>
Type Parameters:
T - component type
V - value type
All Implemented Interfaces:
Clickable<T>

public class TextFieldTester<T extends TextFieldBase<T,V>,V> extends ComponentTester<T>
Tester for TextField components.
Since:
1.0
  • Constructor Details

    • TextFieldTester

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

    • setValue

      public void setValue(V 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.
      Parameters:
      value - value to set
    • clear

      public void clear()
      Resets the value to the empty one, as when clicking on component clear button on the browser. An IllegalStateException is thrown if the clear button is not visible.
      Throws:
      IllegalStateException - if the text field is not usable or the clear button is not visible.