Class RouterLinkLocator

java.lang.Object
com.vaadin.browserless.locator.Locator<com.vaadin.flow.router.RouterLink,RouterLinkLocator>
com.vaadin.flow.component.routerlink.RouterLinkLocator
All Implemented Interfaces:
Clickable<com.vaadin.flow.router.RouterLink>, HasTextFilter<com.vaadin.flow.router.RouterLink,RouterLinkLocator>

@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor") public class RouterLinkLocator extends Locator<com.vaadin.flow.router.RouterLink,RouterLinkLocator> implements Clickable<com.vaadin.flow.router.RouterLink>, HasTextFilter<com.vaadin.flow.router.RouterLink,RouterLinkLocator>
Generated locator for RouterLink, derived from RouterLinkTester. 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

    • RouterLinkLocator

      public RouterLinkLocator()
      Creates a locator that searches for a RouterLink.
    • RouterLinkLocator

      public RouterLinkLocator(com.vaadin.flow.router.RouterLink 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.router.RouterLink getComponent()
      Description copied from interface: Clickable
      Gets the component being tested.
      Specified by:
      getComponent in interface Clickable<com.vaadin.flow.router.RouterLink>
      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.router.RouterLink>
    • getHref

      public String getHref()
      Gets the URL that the router-link links to. Javadoc copied from RouterLinkTester.getHref().
      Returns:
      the href value, or empty string if no href has been set
    • getPath

      public String getPath()
      Gets the path for the router-link. Returns an empty String if there is no corresponding navigation target. Javadoc copied from RouterLinkTester.getPath().
      Returns:
      a String containing the navigation target path or empty if not present
    • getQueryParameters

      public com.vaadin.flow.router.QueryParameters getQueryParameters()
      Gets the query parameters for the router-link. Javadoc copied from RouterLinkTester.getQueryParameters().
      Returns:
      a QueryParameters containing the navigation target's query parameters
    • getRoute

      public Optional<Class<? extends com.vaadin.flow.component.Component>> getRoute()
      Gets the registered route class for the router-link. Returns an empty optional if there is no corresponding navigation target. Javadoc copied from RouterLinkTester.getRoute().
      Returns:
      an Optional containing the navigation target class or empty if not found
    • click

      public void click()
      Click the router-link for navigation. This is equivalent to calling RouterLinkTester.navigate(). For cases where you need to access the navigated view, use RouterLinkTester.navigate() instead as it returns the target view. Javadoc copied from RouterLinkTester.click().
      Specified by:
      click in interface Clickable<com.vaadin.flow.router.RouterLink>