Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit e337e1fd authored by Mihai BOZ's avatar Mihai BOZ
Browse files

Added tests for trustorePg, create method to check if value is present in grid.

parent e553b985
No related branches found
No related tags found
No related merge requests found
Pipeline #103834 passed with warnings
......@@ -71,6 +71,38 @@ public class SmallGrid extends DComponent {
}
return null;
}
public Boolean isValuePresentInColumn(String columnName, String value) {
wait.forXMillis(100);
Integer numOfPages = getGridPagination().getTotalPageNumber();
List<WebElement> rowHeaders = getGridHeaders();
int columnIndex = -1;
for (int i = 0; i < rowHeaders.size(); i++) {
if (rowHeaders.get(i).getText().equals(columnName)) {
columnIndex = i;
break;
}
}
if (columnIndex == -1) {
return false;
}
for (int pageNr = 1; pageNr < numOfPages + 1; pageNr++) {
List<WebElement> rows = getRows();
for (WebElement row : rows) {
List<WebElement> cells = getCells(row);
WebElement currentCell = cells.get(columnIndex);
if (currentCell.getText().equals(value)) {
LOG.debug("[{}] found on page [{}]", value, pageNr);
return true;
}
}
getGridPagination().goToNextPage();
}
return false;
}
public void searchAndClickElementInColumn(String columnName, String value) {
wait.forXMillis(100);
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment