Package org.xwiki.test.ui.po
Class LiveTableElement
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.LiveTableElement
-
- Direct Known Subclasses:
PagesLiveTableElement
public class LiveTableElement extends BaseElement
Represents the actions possible on a livetable.- Since:
- 3.2M3
- Version:
- $Id: 57239c4965564c25113845ca8914d7a74612362b $
-
-
Constructor Summary
Constructors Constructor Description LiveTableElement(String livetableId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickAction(String actionName, int rowNumber)
Clicks a form element (usually a button) with the passed name at the passed row number.ViewPage
clickCell(int rowNumber, int columnNumber)
void
filterColumn(String inputId, String filterValue)
org.openqa.selenium.WebElement
getCell(int rowNumber, int columnNumber)
org.openqa.selenium.WebElement
getCell(org.openqa.selenium.WebElement rowElement, int columnNumber)
int
getColumnIndex(String columnTitle)
String
getFilterValue(String inputId)
org.openqa.selenium.WebElement
getRow(int rowNumber)
int
getRowCount()
int
getRowNumberForElement(org.openqa.selenium.By by)
Get the row index of an element, relative to the number of currently displayed rows.boolean
hasColumn(String columnTitle)
boolean
hasExactRows(String columnTitle, List<String> columnValues)
Checks if there are as many rows as there are passed values and check that the values match.boolean
hasRow(String columnTitle, String columnValue)
Checks if there is a row that has the given value for the specified column.boolean
isReady()
void
sortAscending(String columnTitle)
Sorts the live table on the specified column, by ascending order.void
sortBy(String columnTitle)
Sorts the live table on the specified column.void
sortDescending(String columnTitle)
Sorts the live table on the specified column, by ascending order.void
waitUntilReady()
Wait till the livetable has finished displaying all its rows (so that we can then assert the livetable content without running the risk that the rows have not been updated yet).void
waitUntilRowCountGreaterThan(int minimalExpectedRowCount)
void
waitUntilRowCountGreaterThan(int minimalExpectedRowCount, int timeout)
Same aswaitUntilRowCountGreaterThan(int, int)
but with a specific timeout (ie not using the default timeout)-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Constructor Detail
-
LiveTableElement
public LiveTableElement(String livetableId)
-
-
Method Detail
-
isReady
public boolean isReady()
- Returns:
- if the livetable has finished displaying and is ready for service
-
waitUntilReady
public void waitUntilReady()
Wait till the livetable has finished displaying all its rows (so that we can then assert the livetable content without running the risk that the rows have not been updated yet).
-
hasColumn
public boolean hasColumn(String columnTitle)
-
getFilterValue
public String getFilterValue(String inputId)
- Parameters:
inputId
- the filter input identifier- Returns:
- the value of the filter input for the specified column
- See Also:
filterColumn(String, String)
-
getColumnIndex
public int getColumnIndex(String columnTitle)
- Parameters:
columnTitle
- the title of live table column- Returns:
- the 0-based index of the specified column
-
hasRow
public boolean hasRow(String columnTitle, String columnValue)
Checks if there is a row that has the given value for the specified column.- Parameters:
columnTitle
- the title of live table columncolumnValue
- the value to match rows against- Returns:
true
if there is a row that matches the given value for the specified column,false
otherwise
-
hasExactRows
public boolean hasExactRows(String columnTitle, List<String> columnValues)
Checks if there are as many rows as there are passed values and check that the values match.- Since:
- 7.2M2
-
getRowCount
public int getRowCount()
- Returns:
- the number of rows in the live table
-
getRow
public org.openqa.selenium.WebElement getRow(int rowNumber)
- Since:
- 5.3RC1
-
getRowNumberForElement
public int getRowNumberForElement(org.openqa.selenium.By by)
Get the row index of an element, relative to the number of currently displayed rows.- Parameters:
by
- the selector of the searched element- Returns:
- the row index where the element was found
- Since:
- 14.4.2, 14.5
-
getCell
public org.openqa.selenium.WebElement getCell(org.openqa.selenium.WebElement rowElement, int columnNumber)
- Since:
- 5.3RC1
-
getCell
public org.openqa.selenium.WebElement getCell(int rowNumber, int columnNumber)
- Since:
- 11.6RC1, 11.5
-
clickCell
public ViewPage clickCell(int rowNumber, int columnNumber)
- Since:
- 5.3RC1
-
waitUntilRowCountGreaterThan
public void waitUntilRowCountGreaterThan(int minimalExpectedRowCount)
- Since:
- 3.2M3
-
waitUntilRowCountGreaterThan
public void waitUntilRowCountGreaterThan(int minimalExpectedRowCount, int timeout)
Same aswaitUntilRowCountGreaterThan(int, int)
but with a specific timeout (ie not using the default timeout)- Since:
- 9.1RC1
-
sortBy
public void sortBy(String columnTitle)
Sorts the live table on the specified column.- Parameters:
columnTitle
- the column to sort on- Since:
- 9.7RC1
-
sortAscending
public void sortAscending(String columnTitle)
Sorts the live table on the specified column, by ascending order.- Parameters:
columnTitle
- the column to sort on- Since:
- 13.3RC1, 12.10.6
-
sortDescending
public void sortDescending(String columnTitle)
Sorts the live table on the specified column, by ascending order.- Parameters:
columnTitle
- the column to sort on- Since:
- 13.3RC1, 12.10.6
-
clickAction
public void clickAction(String actionName, int rowNumber)
Clicks a form element (usually a button) with the passed name at the passed row number.- Parameters:
actionName
- the HTML form element name attribute valuerowNumber
- the LT row number (starts at 1)- Since:
- 12.10
-
-