browser.findElements(By.className("rf-edt-flt-i"));
List<WebElement> cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
Assert.assertEquals("Number of rows present", 10, cells.size());
final WebElement filterInput = browser.findElement(By.id("myForm:edt:column2:flt"));
filterInput.clear();
filterInput.sendKeys("3");
Warp.initiate(new Activity() {
@Override
public void perform() {
filterInput.sendKeys(Keys.TAB);
}
}).inspect(new Inspection() {
private static final long serialVersionUID = 1L;
@Inject IterationBuiltInBean iterationBuiltInBean;
@AfterPhase(Phase.INVOKE_APPLICATION)
public void verify_bean_filter_cleared() {
Assert.assertEquals("Backing bean filterValue should be set", 3, (long) iterationBuiltInBean.getFilterValue());
}
});
cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
Assert.assertEquals("Number of rows present", 4, cells.size());
Warp.initiate(new Activity() {
@Override
public void perform() {
button.click();
}
}).inspect(new Inspection() {
private static final long serialVersionUID = 1L;
@Inject IterationBuiltInBean iterationBuiltInBean;
@AfterPhase(Phase.INVOKE_APPLICATION)
public void verify_bean_filter_cleared() {
Assert.assertEquals("Backing bean filterValue should be set", 6, (long) iterationBuiltInBean.getFilterValue());
}
});
cells = browser.findElements(By.cssSelector(".rf-edt-c-column2 .rf-edt-c-cnt"));
Assert.assertEquals("Number of rows present", 7, cells.size());
final WebElement filterInput2 = browser.findElement(By.id("myForm:edt:column2:flt"));
Assert.assertEquals("Filter input value should be backing bean value", "6", filterInput2.getAttribute("value"));
}