Class AnchorTester
java.lang.Object
com.vaadin.testbench.unit.ComponentTester<Anchor>
com.vaadin.flow.component.html.testbench.HtmlComponentTester<Anchor>
com.vaadin.flow.component.html.testbench.HtmlContainerTester<Anchor>
com.vaadin.flow.component.html.testbench.AnchorTester
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclick()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.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.Methods inherited from class com.vaadin.flow.component.html.testbench.HtmlContainerTester
getTextMethods inherited from class com.vaadin.flow.component.html.testbench.HtmlComponentTester
getTitleMethods inherited from class com.vaadin.testbench.unit.ComponentTester
ensureComponentIsUsable, ensureComponentIsUsable, ensureVisible, ensureVisible, find, findAllByQuery, findByQuery, fireDomEvent, fireDomEvent, fireDomEvent, getComponent, getField, getField, getMethod, getMethod, isUsable, isUsable, notUsableReasons, notUsableReasons, roundTrip, setModal, setValueAsUser
-
Constructor Details
-
AnchorTester
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Details
-
getHref
Gets the URL that the anchor links to.- 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.- Returns:
- a
Stringcontaining the navigation target path or empty if not present
-
getQueryParameters
Gets the query parameters for the router-link.- Returns:
- a
QueryParameterscontaining the navigation target's query parameters
-
click
Click the anchor for navigation if target is a registered route in the application.- Returns:
- navigated view
- Throws:
IllegalStateException- if anchor href is not a String or not a route
-
download
Download the stream resource linked by the anchor.- Parameters:
outputStream- output stream to write the stream resource to- Throws:
IllegalStateException- if the anchor does not link to a stream resource
-