@Test
public void testTableSortingIndicatorIsVisibleAfterServersideSort() {
openTestURL();
ButtonElement button = $(ButtonElement.class).caption("Sort").first();
TableElement table = $(TableElement.class).first();
Assert.assertFalse("Descending indicator was prematurely visible",
getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR));
Assert.assertFalse("Ascending indicator was prematurely visible",
getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR));
button.click();
Assert.assertTrue("Indicator did not become visible",
getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR));
Assert.assertFalse("Ascending sort indicator was wrongly visible",
getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR));
table.getHeaderCell(0).click();
Assert.assertFalse("Table sort indicator didn't change",
getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR));
Assert.assertTrue("Ascending sort indicator didn't become visible",
getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR));
button.click();
Assert.assertTrue(
"Descending sort indicator didn't appear on the second serverside sort.",
getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR));
Assert.assertFalse("Ascending sort indicator didn't disappear",
getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR));