Class AgGridHighLevelOperations
- java.lang.Object
-
- com.github.loyada.jdollarx.singlebrowser.AgGridHighLevelOperations
-
public final class AgGridHighLevelOperations extends Object
High level utilities for definitions of simplified grids and operations
-
-
Field Summary
Fields Modifier and Type Field Description static int
retry_duration_in_millisec
-
Constructor Summary
Constructors Constructor Description AgGridHighLevelOperations(Path gridContainer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgGrid
buildMinimalGridFromHeader(List<String> headers)
Path
cellInGrid(int rowNumber, String columnName)
Ensure a specific cell is visible and return a Path to itvoid
changeSimpleInputValueByRowNumber(String columnName, int rowNumber, String newValue)
select an option from a dropdown in a cellvoid
changeSimpleInputValueByValue(String columnName, String oldValue, String newValue)
select an option from a dropdown in a cellPath
clickOnColumnWithValue(String columnName, String value)
Find a the first cell in the given column with the given value, ensure it is visible, and click on it.Path
clickOnTextInsideColumnWithValue(String columnName, String value)
Find a the first cell in the given column with the given value, ensure it is visible, and click on the text inside it.void
ensureCellValueIsPresent(int rowNumber, String columnTitle, String expectedValue)
Ensure(or assert) that the cell in specific row and column has the expected valuePath
getCellInRowWithColumnAndValue(String wantedColumn, String column, String value)
First find a row that has the given value in the column, then find the column "wantedColumn" in the same row, ensure it is visible, and return the Path to it.Path
getCellInRowWithColumnAndValueById(String wantedColumnId, String column, String value)
First find a row that has the given value in the column, then find the column with the ID wantedColumnId in the same row, ensure it is visible, and return the Path to it.AgGrid
getMinimalGrid(String columnName)
create a minimal grid definition that has the column we are interersted inPath
getRowOfDisplayedCell(Path cell)
return a path to the Row of a cell, assuming the cell is displayed.Path
getRowWithColumnAndValue(String column, String value)
Path
goToEditModeInCell(String columnName, int rowNumber)
Find a cell, and doubleclick itPath
goToEditModeInCell(String columnName, String value)
Find a cell, and doubleclick itPath
hoverOverCell(int rowNumber, String columnTitle)
Hover over speicic cell, after ensuring it is visiblevoid
selectInCell(String columnName, int rowNumber, String option)
select an option from a dropdown in a cellAgGrid
unorderedGrid(List<Map<String,String>> rows)
define AgGrid with unordered columnsAgGrid
unorderedStrictGrid(List<Map<String,String>> rows)
define a "strict" AgGrid with unordered columns.
-
-
-
Constructor Detail
-
AgGridHighLevelOperations
public AgGridHighLevelOperations(Path gridContainer)
-
-
Method Detail
-
ensureCellValueIsPresent
public void ensureCellValueIsPresent(int rowNumber, String columnTitle, String expectedValue)
Ensure(or assert) that the cell in specific row and column has the expected value- Parameters:
rowNumber
- - number of row of the cellcolumnTitle
- - the column of the cellexpectedValue
- - the value we assert in that cell
-
hoverOverCell
public Path hoverOverCell(int rowNumber, String columnTitle)
Hover over speicic cell, after ensuring it is visible- Parameters:
rowNumber
- - row numbercolumnTitle
- - column- Returns:
- the cell
-
unorderedGrid
public AgGrid unorderedGrid(List<Map<String,String>> rows)
define AgGrid with unordered columns- Parameters:
rows
- a list of the rows, in order- Returns:
- an AgGrid object
-
unorderedStrictGrid
public AgGrid unorderedStrictGrid(List<Map<String,String>> rows)
define a "strict" AgGrid with unordered columns. A strict grid means no other rows exist.- Parameters:
rows
- a list of all the rows in the grid, in order- Returns:
- an AgGrid object
-
clickOnColumnWithValue
public Path clickOnColumnWithValue(String columnName, String value)
Find a the first cell in the given column with the given value, ensure it is visible, and click on it.- Parameters:
columnName
- the column namevalue
- the value of the cell we are looking for- Returns:
- the cell element
-
clickOnTextInsideColumnWithValue
public Path clickOnTextInsideColumnWithValue(String columnName, String value)
Find a the first cell in the given column with the given value, ensure it is visible, and click on the text inside it.- Parameters:
columnName
- the column namevalue
- the value of the cell we are looking for- Returns:
- the cell element
-
cellInGrid
public Path cellInGrid(int rowNumber, String columnName)
Ensure a specific cell is visible and return a Path to it- Parameters:
rowNumber
- row numbercolumnName
- column name- Returns:
- the request cell
-
getMinimalGrid
public AgGrid getMinimalGrid(String columnName)
create a minimal grid definition that has the column we are interersted in- Parameters:
columnName
- the column name- Returns:
- a grid object
-
goToEditModeInCell
public Path goToEditModeInCell(String columnName, int rowNumber)
Find a cell, and doubleclick it- Parameters:
columnName
- column namerowNumber
- row number- Returns:
- the cell
-
goToEditModeInCell
public Path goToEditModeInCell(String columnName, String value)
Find a cell, and doubleclick it- Parameters:
columnName
- column namevalue
- value of cell- Returns:
- the cell
-
selectInCell
public void selectInCell(String columnName, int rowNumber, String option)
select an option from a dropdown in a cell- Parameters:
columnName
- column namerowNumber
- row numberoption
- option to choose
-
getRowOfDisplayedCell
public Path getRowOfDisplayedCell(Path cell)
return a path to the Row of a cell, assuming the cell is displayed. This should be used whenever you want to perform an operation on the row or search inside the row.- Parameters:
cell
- the cell we have- Returns:
- the Path of the row
-
changeSimpleInputValueByRowNumber
public void changeSimpleInputValueByRowNumber(String columnName, int rowNumber, String newValue) throws Operations.OperationFailedException
select an option from a dropdown in a cell- Parameters:
columnName
- column namerowNumber
- row numbernewValue
- new Value- Throws:
Operations.OperationFailedException
-
changeSimpleInputValueByValue
public void changeSimpleInputValueByValue(String columnName, String oldValue, String newValue)
select an option from a dropdown in a cell- Parameters:
columnName
- column nameoldValue
- row numbernewValue
- new Value
-
getCellInRowWithColumnAndValue
public Path getCellInRowWithColumnAndValue(String wantedColumn, String column, String value)
First find a row that has the given value in the column, then find the column "wantedColumn" in the same row, ensure it is visible, and return the Path to it.- Parameters:
wantedColumn
- the column of the cell we wantcolumn
- the column of the cell that is used to find the rowvalue
- the value of the column that is used to find the row- Returns:
- The path of the wanted cell
-
getCellInRowWithColumnAndValueById
public Path getCellInRowWithColumnAndValueById(String wantedColumnId, String column, String value)
First find a row that has the given value in the column, then find the column with the ID wantedColumnId in the same row, ensure it is visible, and return the Path to it.- Parameters:
wantedColumnId
- the column of the cell we wantcolumn
- the column of the cell that is used to find the rowvalue
- the value of the column that is used to find the row- Returns:
- The path of the wanted cell
-
-