Class InputLocator

java.lang.Object
com.vaadin.browserless.locator.Locator<com.vaadin.flow.component.html.Input,InputLocator>
com.vaadin.flow.component.html.InputLocator
All Implemented Interfaces:
Clickable<com.vaadin.flow.component.html.Input>, HasAriaLabelFilter<com.vaadin.flow.component.html.Input,InputLocator>, HasPlaceholderFilter<com.vaadin.flow.component.html.Input,InputLocator>, HasValueFilter<com.vaadin.flow.component.html.Input,String,InputLocator>

@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor") public class InputLocator extends Locator<com.vaadin.flow.component.html.Input,InputLocator> implements Clickable<com.vaadin.flow.component.html.Input>, HasAriaLabelFilter<com.vaadin.flow.component.html.Input,InputLocator>, HasPlaceholderFilter<com.vaadin.flow.component.html.Input,InputLocator>, HasValueFilter<com.vaadin.flow.component.html.Input,String,InputLocator>
Generated locator for Input, derived from InputTester. Filter steps are inherited from Locator; action methods delegate to a fresh tester around the resolved component, so behavioral changes belong on the tester, not here.
  • Constructor Details

    • InputLocator

      public InputLocator()
      Creates a locator that searches for a Input.
    • InputLocator

      public InputLocator(com.vaadin.flow.component.html.Input component)
      Creates a locator already bound to the given component, so that the action methods run against it instead of against a lookup.
      Parameters:
      component - the component the locator resolves to
  • Method Details

    • getComponent

      public com.vaadin.flow.component.html.Input getComponent()
      Description copied from interface: Clickable
      Gets the component being tested.
      Specified by:
      getComponent in interface Clickable<com.vaadin.flow.component.html.Input>
      Returns:
      the component under test
    • ensureComponentIsUsable

      public void ensureComponentIsUsable()
      Description copied from interface: Clickable
      Ensures the component is in a usable state before interaction.
      Specified by:
      ensureComponentIsUsable in interface Clickable<com.vaadin.flow.component.html.Input>
    • setValue

      public void setValue(String 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. Javadoc copied from InputTester.setValue(java.lang.String).

      Parameters:
      value - value to set
    • getValue

      public String getValue()
      Get the current value of the component. Javadoc copied from InputTester.getValue().
      Returns:
      current component value
      Throws:
      IllegalStateException - if component not visible
    • clear

      public void clear()
      Empties the field, as when the user deletes its contents (or clicks the clear button, where one is shown).

      Emptying is something the user can always do, so it needs no clear button: a field may legitimately end up invalid — a required field, for instance — once emptied. Javadoc copied from InputTester.clear().

      Throws:
      IllegalStateException - if the component is not usable