teamMemberButton.click();
return new ManageLanguageTeamMemberPage(getDriver());
}
private TableRow findRowByLocale(final String localeId) {
TableRow matchedRow =
waitForAMoment().until(new Function<WebDriver, TableRow>() {
@Override
public TableRow apply(WebDriver driver) {
List<TableRow> tableRows =
WebElementUtil.getTableRows(getDriver(),
languageTable);
Optional<TableRow> matchedRow =
Iterables.tryFind(tableRows,
new Predicate<TableRow>() {
@Override
public boolean
apply(TableRow input) {
List<String> cellContents =
input.getCellContents();
String localeCell =
cellContents.get(
LOCALE_COLUMN)
.trim();
return localeCell
.equalsIgnoreCase(localeId);
}
});
// we keep looking for the locale until timeout
return matchedRow.isPresent() ? matchedRow.get() : null;
}
});
return matchedRow;
}