Class SwitchLocator

java.lang.Object
com.vaadin.browserless.locator.Locator<Switch,SwitchLocator>
com.vaadin.flow.component.checkbox.SwitchLocator
All Implemented Interfaces:
Clickable<Switch>, HasAriaLabelFilter<Switch,SwitchLocator>, HasLabelFilter<Switch,SwitchLocator>, HasThemeFilter<Switch,SwitchLocator>, HasValueFilter<Switch,Boolean,SwitchLocator>

@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor") public class SwitchLocator extends Locator<Switch,SwitchLocator> implements Clickable<Switch>, HasLabelFilter<Switch,SwitchLocator>, HasAriaLabelFilter<Switch,SwitchLocator>, HasValueFilter<Switch,Boolean,SwitchLocator>, HasThemeFilter<Switch,SwitchLocator>
Generated locator for Switch, derived from SwitchTester. 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

    • SwitchLocator

      public SwitchLocator()
    • SwitchLocator

      public SwitchLocator(Switch component)
  • Method Details

    • getComponent

      public Switch getComponent()
      Description copied from interface: Clickable
      Gets the component being tested.
      Specified by:
      getComponent in interface Clickable<Switch>
      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<Switch>
    • isOn

      public boolean isOn()
      Checks whether the switch is currently on. Javadoc copied from SwitchTester.isOn().
      Returns:
      true if the switch is on, false otherwise
    • switchOn

      public void switchOn()
      Switches the switch on by clicking it, as a user would.

      Does nothing if the switch is already on, since a user would not click it in that case. The switch must be usable either way. Javadoc copied from SwitchTester.switchOn().

    • switchOff

      public void switchOff()
      Switches the switch off by clicking it, as a user would.

      Does nothing if the switch is already off, since a user would not click it in that case. The switch must be usable either way. Javadoc copied from SwitchTester.switchOff().

    • click

      public void click(int button, MetaKeys metaKeys)
      Specified by:
      click in interface Clickable<Switch>
      Parameters:
      button - the mouse button (0=left, 1=middle, 2=right)
      metaKeys - the meta keys pressed during click