Package com.vaadin.flow.component.html
Class AnchorTester
-
- All Implemented Interfaces:
-
com.vaadin.browserless.Clickable
public class AnchorTester extends HtmlContainerTester<Anchor>
- Since:
1.0
-
-
Constructor Summary
Constructors Constructor Description AnchorTester(Anchor component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description StringgetHref()Gets the URL that the anchor links to. StringgetPath()Gets the path for the router-link. QueryParametersgetQueryParameters()Gets the query parameters for the router-link. HasElementnavigate()Navigate to the anchor target if it's a registered route in the application. voidclick()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. -
Methods inherited from class com.vaadin.browserless.ComponentTester
ensureComponentIsUsable, find, getComponent, isUsable, setModal -
Methods inherited from class com.vaadin.flow.component.html.HtmlContainerTester
getText -
Methods inherited from class com.vaadin.flow.component.html.HtmlComponentTester
getTitle -
Methods inherited from class com.vaadin.browserless.Clickable
click, click, middleClick, middleClick, rightClick, rightClick -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getHref
String getHref()
Gets the URL that the anchor links to.
- Returns:
the href value, or
""if no href has been set
-
getPath
String getPath()
Gets the path for the router-link. Returns an empty String if there is no corresponding navigation target.
- Returns:
a String containing the navigation target path or empty if not present
-
getQueryParameters
QueryParameters getQueryParameters()
Gets the query parameters for the router-link.
- Returns:
a QueryParameters containing the navigation target's query parameters
-
navigate
HasElement navigate()
Navigate to the anchor target if it's a registered route in the application.
- Returns:
navigated view
-
click
void click()
Click the anchor for navigation if target is a registered route in the application. This is equivalent to calling navigate. For cases where you need to access the navigated view, use navigate instead as it returns the target view.
-
download
void download(OutputStream outputStream)
Download the stream resource linked by the anchor.
- Parameters:
outputStream- output stream to write the stream resource to
-
-
-
-