Skip to content

Instantly share code, notes, and snippets.

@lfryc
Forked from anonymous/gist:4266119
Created December 12, 2012 08:38
Show Gist options
  • Save lfryc/4266142 to your computer and use it in GitHub Desktop.
Save lfryc/4266142 to your computer and use it in GitHub Desktop.
@Test
public void table_sort() throws InterruptedException {
// given
browser.get(contextPath.toExternalForm() + "sort.jsf");
WebElement cell = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt")).get(0);
Assert.assertEquals("9", cell.getText());
guardXhr(sortLink).click();
waitAjax().until(new Predicate<WebDriver> () {
public boolean apply(WebDriver driver) {
try {
WebElement element = browser.findElement(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
return "0".equals(element.getText());
} finally {
return false;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment