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 Summary
ConstructorsConstructorDescriptionCreates a locator that searches for aRouterLink.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. -
Method Summary
Modifier and TypeMethodDescriptionvoidclick()Click the router-link for navigation.voidEnsures the component is in a usable state before interaction.com.vaadin.flow.router.RouterLinkGets the component being tested.getHref()Gets the URL that the router-link links to.getPath()Gets the path for the router-link.com.vaadin.flow.router.QueryParametersGets the query parameters for the router-link.getRoute()Gets the registered route class for the router-link.com.vaadin.flow.component.HasElementnavigate()Navigate to the router-link target.Methods inherited from class com.vaadin.browserless.locator.Locator
atIndex, component, components, exists, inside, inside, invalidate, self, with, withAttribute, withAttribute, withClassName, withCondition, withCondition, withId, withinSlot, withoutAttribute, withoutAttribute, withoutClassName, withTestIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.browserless.Clickable
click, click, middleClick, middleClick, rightClick, rightClickMethods inherited from interface com.vaadin.browserless.locator.HasTextFilter
withText, withTextContaining
-
Constructor Details
-
RouterLinkLocator
public RouterLinkLocator()Creates a locator that searches for aRouterLink. -
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:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<com.vaadin.flow.router.RouterLink>- Returns:
- the component under test
-
ensureComponentIsUsable
public void ensureComponentIsUsable()Description copied from interface:ClickableEnsures the component is in a usable state before interaction.- Specified by:
ensureComponentIsUsablein interfaceClickable<com.vaadin.flow.router.RouterLink>
-
getHref
Gets the URL that the router-link links to. Javadoc copied fromRouterLinkTester.getHref().- Returns:
- the href value, or empty string if no href has been set
-
getPath
Gets the path for the router-link. Returns an emptyStringif there is no corresponding navigation target. Javadoc copied fromRouterLinkTester.getPath().- Returns:
- a
Stringcontaining 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 fromRouterLinkTester.getQueryParameters().- Returns:
- a
QueryParameterscontaining the navigation target's query parameters
-
getRoute
Gets the registered route class for the router-link. Returns an empty optional if there is no corresponding navigation target. Javadoc copied fromRouterLinkTester.getRoute().- Returns:
- an
Optionalcontaining the navigation target class or empty if not found
-
click
public void click()Click the router-link for navigation. This is equivalent to callingRouterLinkTester.navigate(). For cases where you need to access the navigated view, useRouterLinkTester.navigate()instead as it returns the target view. Javadoc copied fromRouterLinkTester.click().
-