Package de.bmiag.tapir.htmlbasic.impl
Class DefaultSeleniumTable<RowType extends TableRow>
- java.lang.Object
-
- de.bmiag.tapir.selenium.element.AbstractSingleSeleniumElement
-
- de.bmiag.tapir.htmlbasic.impl.DefaultSeleniumTable<RowType>
-
- All Implemented Interfaces:
Table<RowType>
,SingleWebElementBased
,Displayable
,TapirElement
,TypeArgumentAware
@Component("tapirTable") @Scope("prototype") public class DefaultSeleniumTable<RowType extends TableRow> extends AbstractSingleSeleniumElement implements Table<RowType>
Default Selenium implementation of aTable
.- Since:
- 2.1.0
- Author:
- Oliver Libutzki <[email protected]>
-
-
Constructor Summary
Constructors Constructor Description DefaultSeleniumTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RowType
findSingleVisibleRow(java.util.function.Predicate<? super RowType> rowSearchCriteria)
Returns a single visibleTableRow
by searching for the row which fulfills the selections criteria.java.util.List<RowType>
findVisibleRows(java.util.function.Predicate<? super RowType> rowSearchCriteria)
Returns visibleTableRow
s by searching for rows which fulfills the selections criteria.protected java.util.List<RowType>
getRowsInternal(java.util.function.Predicate<? super RowType> rowSearchCriteria, boolean returnFirstMatch)
java.util.List<RowType>
getVisibleRows()
Returns all visibleTableRow
s.boolean
isDisplayed()
Returns true, if the element is displayed.void
setTypeArguments(java.util.List<java.lang.reflect.Type> types)
Sets the type arguments.-
Methods inherited from class de.bmiag.tapir.selenium.element.AbstractSingleSeleniumElement
getWebElement, setWebElement
-
-
-
-
Method Detail
-
isDisplayed
public boolean isDisplayed()
Description copied from interface:Displayable
Returns true, if the element is displayed. "Displayed" means it has to be part of the dom and it is not hidden using css.- Specified by:
isDisplayed
in interfaceDisplayable
- Returns:
- true, if the element is displayed.
-
setTypeArguments
public void setTypeArguments(java.util.List<java.lang.reflect.Type> types)
Description copied from interface:TypeArgumentAware
Sets the type arguments. The number of types in the list has to be the same as the number of the type's type arguments.- Specified by:
setTypeArguments
in interfaceTypeArgumentAware
- Parameters:
types
- the type arguments
-
getVisibleRows
public java.util.List<RowType> getVisibleRows()
Description copied from interface:Table
Returns all visibleTableRow
s. The rows are ordered by their occurrence on the website.- Specified by:
getVisibleRows
in interfaceTable<RowType extends TableRow>
- Returns:
- all visible rows of the table
-
findSingleVisibleRow
public RowType findSingleVisibleRow(java.util.function.Predicate<? super RowType> rowSearchCriteria)
Description copied from interface:Table
Returns a single visibleTableRow
by searching for the row which fulfills the selections criteria. Xtend-Usage:findSingleVisibleRow[column1.text == "Value1" && column2.text == "Value2"]
findSingleVisibleRow(row -> row.getColumn1().getText().equals("Value1") && row.getColumn2().getText().equals("Value2"))
NoSuchElementException
is thrown.- Specified by:
findSingleVisibleRow
in interfaceTable<RowType extends TableRow>
- Parameters:
rowSearchCriteria
- Criteria which has to be fulfilled- Returns:
- the first row which matches the rowSearchCriteria
-
findVisibleRows
public java.util.List<RowType> findVisibleRows(java.util.function.Predicate<? super RowType> rowSearchCriteria)
Description copied from interface:Table
Returns visibleTableRow
s by searching for rows which fulfills the selections criteria. Xtend-Usage:findVisibleRows[column1.text == "Value1" && column2.text == "Value2"]
findVisibleRows(row -> row.getColumn1().getText().equals("Value1") && row.getColumn2().getText().equals("Value2"))
- Specified by:
findVisibleRows
in interfaceTable<RowType extends TableRow>
- Parameters:
rowSearchCriteria
- Criteria which has to be fulfilled- Returns:
- all rows which match the rowSearchCriteria
-
-