AgGrid¶
-
public class
AgGrid
¶ Custom class to validate the presence of an AgGrid, and interact with it, since it can be tricky. It supports virtualized and non-virtualized tables. It should be used like other custom matchers in the package.
Fields¶
Methods¶
clickOnSort¶
ensureVisibilityOfCellInColumn¶
-
public Path
ensureVisibilityOfCellInColumn
(String columnTitle, ElementProperty cellContent)¶ Find a specific cell under a column, without knowing the row, ensure it is displayed, and return its Path
Parameters: - columnTitle – the title of the column to look under
- cellContent – a property that describes the content of the expect cell
Returns: the Path of the found cell. allows to interact with it
ensureVisibilityOfRowWithIndex¶
-
public Path
ensureVisibilityOfRowWithIndex
(int n)¶ Scroll until the row with the given index is visible, and return a Path element that matches it. Useful for performing operations or accessing fields in the wanted row.
Parameters: - n – the number of row in the table, as visible to the user
Returns: a Path element that allows to access the row
ensureVisibilityOfRowWithIndexAndColumn¶
-
public Path
ensureVisibilityOfRowWithIndexAndColumn
(int index, String columnTitle)¶ Scroll until the row with the given index, as well as the given column, is visible. It return a Path element that matches the wanted cell in row. Useful for performing operations or accessing fields in the wanted cell (for example: edit it)
Parameters: - index – the number of row in the table, as visible to the user
- columnTitle – the header title of the wanted cell in the row
Returns: the Path element to access the wanted cell in the wanted row
findRowIndex¶
-
public int
findRowIndex
(Map<String, ElementProperty> row)¶ Find internal index of row within table. This method typically will make sure the row is also visible if it exists, in case the user needs to interact with it, but in some cases ensureVisiblityOfRow will be required.
Parameters: - row –
- the definition of the row content
Returns: the internal index of the row, if it was found
- row –
getBuilder¶
-
public static AgGridBuilder
getBuilder
()¶
getRowIndex¶
-
public int
getRowIndex
(Path row)¶ assuming the row is already present in the DOM, get its internal index in the table.
Parameters: - row – the row we are interested in. Should be the value returned from findRowInBrowser() or ensureVisibilityOfRowWithIndex()
Returns: the internal index of the row in the table
getRowIndexOfCell¶
-
public int
getRowIndexOfCell
(Path cell)¶ assuming the row is already present in the DOM, get its internal index in the table.
Parameters: - cell –
- the cell in the row we are interested in. Should be the return value of ensureVisibilityOfRowWithIndexAndColumn()
Returns: the internal index of the row in the table
- cell –
getVisibleHeaderPath¶
-
public Path
getVisibleHeaderPath
(String headerText)¶ Make sure the given column header is visible, and returns a Path element to access it. This is useful to perform direct operations on that element or access other DOM elements contained in the header.
Parameters: - headerText –
- the header text, or the column ID. A string wrapped with curly braces is interpreted as the column ID.
Returns: the Path element to access the column header
- headerText –
hasIndex¶
-
static ElementProperty
hasIndex
(int ind)¶
openColumnsSelectionMenuAndGetMenu¶
overrideTimeoutDuringOperation¶
-
public void
overrideTimeoutDuringOperation
(int millisecs)¶ Override the default timeout threshold for finding elements while scrolling the table. The default is 5 milliseconds
Parameters: - millisecs –
- the timeout in milliseconds
- millisecs –
overrideTimeoutWhenDone¶
-
public void
overrideTimeoutWhenDone
(int millisecs)¶ Override the default timeout threshold it reverts to when table operations are done. The default is 5000 milliseconds
Parameters: - millisecs –
- the timeout in milliseconds
- millisecs –
setScrollStep¶
-
public void
setScrollStep
(int size)¶ Override the default step size of scrolling when moving through a grid
Parameters: - size – step size in pixels
showAllColumnsUsingFirstColumn¶
-
public void
showAllColumnsUsingFirstColumn
()¶ Show all columns, by opening the popup menu of the first column. Assumes that the first column has the popup menu.
showSpecificColumnsUsingMenuOfColumn¶
sortBy¶
-
public void
sortBy
(String headerText, SortDirection direction)¶ Click on ‘sort’ so that the given column is sorted in the direction provided.
Parameters: - headerText –
- the header text, or the column ID. A string wrapped with curly braces is interpreted as the column ID.
- direction –
- wanted direction. either descending or ascending.
Throws: - OperationFailedException – operation failed - typically the configuration of the grid does not allow to sort as wanted.
- headerText –