On Thu, 10 Jul 2008, Daniele Dellafiore wrote:
> click on link opens a ModalWindow (OK)
> check that the Modal is open indeed (OK, with
> tester.assertComponentOnAjaxResponse("deleteModal");)
> click on a confirm button on the page in the modal, and test that the
> element has been deleted (NO!!!)
modalWindow.visitChildren(AjaxButton.class, new IVisitor() {
public void component(Component component) {
if (component.getId().equals("confirm)) {
wicketTester.executeAjaxEvent(component, "onclick");
}
return CONTINUE_TRAVERSAL;
}
});
assertTrue(elementHasBeenDeleted());
> I cannot find a way to simulate the click becouse I cannot find the
> path for the page inside the modal window.
WickeTester has a method for printing component tree to
System.out, but using visitors for long component paths
helps to make your tests more robust.
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oyhttp://www.ri.fi/ >
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]