public class UIFinder extends Object
components
by ID. An instance of this class is provided for you, just read the com.whitestein.lsps.web.vaadin.tests.LspsVaadinTestCase#screen property.Modifier and Type | Field and Description |
---|---|
protected SearchContext |
context
The search context to search in, either the entire page (WebDriver) or a component.
|
Constructor and Description |
---|
UIFinder(SearchContext context,
boolean root) |
Modifier and Type | Method and Description |
---|---|
<T extends AbstractElement> |
$(Class<T> clazz)
Prepare a
ElementQuery instance to use for locating components on
the client. |
void |
clickButton(String id)
Clicks a button with given id.
|
boolean |
contains(String id)
Checks if there is any visible component with given ID, which is child or descendant of this component.
|
UIComponent |
find(String id)
Finds element by given lsps id (your custom ID, not the modelingID).
|
protected List<WebElement> |
findAll(String id)
Finds all components matching given ID
|
WebDriver |
getDriver() |
String |
toString() |
protected void |
waitForVaadin()
Should be invoked after every potential server contact.
|
protected final SearchContext context
protected List<WebElement> findAll(String id)
id
- the component ID (your custom ID, not the modelingID).public final boolean contains(String id)
id
- the component ID (your custom ID, not the modelingID).public final UIComponent find(String id)
UIComponent.isVisible()
for more details.id
- the id, not null. your custom ID, not the modelingIDNoSuchElementException
- if there are no visible elements with given IDIllegalArgumentException
- if multiple elements match given ID.public void clickButton(String id)
find(id).as().button().click()
id
- the id, not null. your custom ID, not the modelingIDprotected void waitForVaadin()
RuntimeException
is thrown.public <T extends AbstractElement> <any> $(Class<T> clazz)
ElementQuery
instance to use for locating components on
the client. The returned object can be manipulated to uniquely identify
the sought-after object. If this function gets called through an element,
it uses the element as its search context. Otherwise the search context
is the driver.T
- clazz
- ElementQuery
instancepublic WebDriver getDriver()
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.