/* sorting, pagination, single selection */
//check is hinLabel in first column header visible
DataTableInspector hintLabelDataTable = dataTable("fn:hintLabelDataTable");
HintLabelInspector headerHintLabel1 = hintLabel("fn:hintLabelDataTable:header_hintLabel_1");
headerHintLabel1.checkVisibilityAndContent("Header hint label value 1", "Header hint label title 1");
hintLabel("fn:hintLabelDataTable:header_hintLabel_2")
.checkVisibilityAndContent("Header hint label value 2", "Header hint label title 2");
// todo: check header cells when iterating over each page
//click at hinlLabel placed in the header to perform sorting
hintLabelDataTable.column(1).makeSorting();
for (int pageNo = 1; pageNo <= 2; pageNo++) {
//execute pagination from first to third page verify data on every page
List<DataTableUtils.TestDataTableItem> currentPageValues = DataTableUtils.getCurrentPageFromReferenceValues(hintLabelDataTableValues, pageNo);
for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
DataTableUtils.TestDataTableItem currentReferenceRow = currentPageValues.get(rowIndex);
HintLabelInspector bodyHintLabel1 = hintLabel("fn:hintLabelDataTable:" + rowIndex + ":body_hinLabel_1");
bodyHintLabel1.clickAndWait();
bodyHintLabel1.hint().mouseOut();
bodyHintLabel1.checkVisibilityAndContent(currentReferenceRow.getFirstColumn(), currentReferenceRow.getSecondColumn());
bodyHintLabel1.hint().mouseOut();
hintLabel("fn:hintLabelDataTable:" + rowIndex + ":body_hinLabel_2")
.checkVisibilityAndContent(currentReferenceRow.getSecondColumn(), currentReferenceRow.getFirstColumn());
// check is single selection performed well
bodyHintLabel1.clickAndWait();
bodyHintLabel1.hint().mouseOut();
hintLabelDataTable.checkSelectedIndex(rowIndex);
}
// check footer hintLabels
hintLabel("fn:hintLabelDataTable:footer_hintLabel_1")
.checkVisibilityAndContent("Footer hint label value 1", "Footer hint label title 1");
hintLabel("fn:hintLabelDataTable:footer_hintLabel_2")
.checkVisibilityAndContent("Footer hint label value 2", "Footer hint label title 2");
dataTablePaginator("fn:hintLabelDataTable:hintLabelDataTablePaginator").nextPage()
.clickAndWait();
}
/* filtering and filtered data verification */
final String filterCriterion = "col4_row1";
hintLabelDataTable.column(2).filter(InputTextFilterInspector.class, "fn:hintLabelDataTable:filter1").makeFiltering(filterCriterion);
HintLabelInspector hintLabel = hintLabel("fn:hintLabelDataTable:0:body_hinLabel_2");
hintLabel.mouseOver();
sleep(250);
hintLabel.assertText(filterCriterion);
hintLabel.hint().assertText("col3_row1");
}