Package com.vaadin.flow.component.html
Class AnchorLocator
java.lang.Object
com.vaadin.browserless.locator.Locator<Anchor,AnchorLocator>
com.vaadin.flow.component.html.AnchorLocator
- All Implemented Interfaces:
Clickable<Anchor>,HasAriaLabelFilter<Anchor,,AnchorLocator> HasTextFilter<Anchor,AnchorLocator>
@Generated("com.vaadin.browserless.locator.processor.LocatorProcessor")
public class AnchorLocator
extends Locator<Anchor,AnchorLocator>
implements Clickable<Anchor>, HasTextFilter<Anchor,AnchorLocator>, HasAriaLabelFilter<Anchor,AnchorLocator>
Generated locator for
Anchor, derived from
AnchorTester. 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclick()Click the anchor for navigation if target is a registered route in the application.voiddownload(OutputStream outputStream) Download the stream resource linked by the anchor.voidEnsures the component is in a usable state before interaction.Gets the component being tested.getHref()Gets the URL that the anchor links to.getPath()Gets the path for the router-link.Gets the query parameters for the router-link.getText()Get the text for target html component.getTitle()Get the title string set for the html component if available.navigate()Navigate to the anchor target if it's a registered route in the application.Methods inherited from class com.vaadin.browserless.locator.Locator
atIndex, component, components, exists, inside, inside, invalidate, self, with, withAttribute, withAttribute, withClassName, withCondition, withId, 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.HasAriaLabelFilter
withAriaLabel, withAriaLabelContainingMethods inherited from interface com.vaadin.browserless.locator.HasTextFilter
withText, withTextContaining
-
Constructor Details
-
AnchorLocator
public AnchorLocator() -
AnchorLocator
-
-
Method Details
-
getComponent
Description copied from interface:ClickableGets the component being tested.- Specified by:
getComponentin interfaceClickable<Anchor>- 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<Anchor>
-
getHref
Gets the URL that the anchor links to. Javadoc copied fromAnchorTester.getHref().- Returns:
- the href value, or
""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 fromAnchorTester.getPath().- Returns:
- a
Stringcontaining the navigation target path or empty if not present
-
getQueryParameters
Gets the query parameters for the router-link. Javadoc copied fromAnchorTester.getQueryParameters().- Returns:
- a
containing the navigation target's query parameters
invalid reference
QueryParameters
-
click
public void click()Click the anchor for navigation if target is a registered route in the application. This is equivalent to callingnavigate(). For cases where you need to access the navigated view, usenavigate()instead as it returns the target view. Javadoc copied fromAnchorTester.click().- Specified by:
clickin interfaceClickable<Anchor>- Throws:
IllegalStateException- if anchor href is not a String or not a route
-
download
Download the stream resource linked by the anchor. Javadoc copied fromAnchorTester.download(java.io.OutputStream).- Parameters:
outputStream- output stream to write the stream resource to- Throws:
IllegalStateException- if the anchor does not link to a stream resource
-
getText
Get the text for target html component. Javadoc copied fromHtmlContainerTester.getText().- Returns:
- text of component
- Throws:
IllegalStateException- if component not visible
-
getTitle
Get the title string set for the html component if available. Javadoc copied fromHtmlComponentTester.getTitle().- Returns:
- title string
- Throws:
IllegalStateException- if not title has been set
-