final String firstColumnHeaderContent = "first column header";
final String secondColumnHeaderContent = "second column header";
final String firstColumnFooterContent = "first column footer";
final String secondColumnFooterContent = "second column footer";
DataTablePaginatorInspector clientPaginator = dataTablePaginator("formID:paginableDataTable:paginableDataTablePaginator");
ElementInspector firstColumnHeader = element("formID:paginableDataTable:paginableDataTable_firstColumnHeader");
ElementInspector secondColumnHeader = element("formID:paginableDataTable:paginableDataTable_secondColumnHeader");
ElementInspector firstColumnFooter = element("formID:paginableDataTable:paginableDataTable_firstColumnFooter");
ElementInspector secondColumnFooter = element("formID:paginableDataTable:paginableDataTable_secondColumnFooter");
for (int i = 1; i < 3; i++) {
firstColumnHeader.assertText(firstColumnHeaderContent);
secondColumnHeader.assertText(secondColumnHeaderContent);
firstColumnFooter.assertText(firstColumnFooterContent);
secondColumnFooter.assertText(secondColumnFooterContent);
checkDataTableContents(selenium, referenceDataTableValues, i);
clientPaginator.nextPage().clickAndWait(loadingMode);
}
for (int i = 3; i > 1; i--) {
firstColumnHeader.assertText(firstColumnHeaderContent);
secondColumnHeader.assertText(secondColumnHeaderContent);
firstColumnFooter.assertText(firstColumnFooterContent);
secondColumnFooter.assertText(secondColumnFooterContent);
checkDataTableContents(selenium, referenceDataTableValues, i);
element("formID:paginableDataTable").click();
//go to the previous page using keyboard
selenium.getEval("var el = O$('formID:paginableDataTable'); var evObj = document.createEvent('KeyEvents'); evObj.initKeyEvent('keypress', true, true, window, false, false, false, false, 33, 0); el.dispatchEvent(evObj);");
loadingMode.waitForLoad();
}
clientPaginator.lastPage().clickAndWait(loadingMode);
checkDataTableContents(selenium, referenceDataTableValues, 3);
clientPaginator.firstPage().clickAndWait(loadingMode);
checkDataTableContents(selenium, referenceDataTableValues, 1);
if (loadingMode instanceof ServerLoadingMode) {
// reset tab index for possible further tests
loadingModes.tabs().get(0).clickAndWait();
}