Class AnchorTester
java.lang.Object
com.vaadin.testbench.unit.ComponentTester<T>
com.vaadin.flow.component.html.testbench.HtmlComponentTester<T>
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.void
download
(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
getText
Methods inherited from class com.vaadin.flow.component.html.testbench.HtmlComponentTester
getTitle
Methods 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
-
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 emptyString
if there is no corresponding navigation target.- Returns:
- a
String
containing the navigation target path or empty if not present
-
getQueryParameters
Gets the query parameters for the router-link.- Returns:
- a
QueryParameters
containing 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
-