Hello all,
I am trying to write a test case to simulate that when the user clicks on a
button, they are navigated to a new page.
// Test Case
public void testProgramPageNavigation() {
WicketTester tester = new WicketTester();
FormTester formTester = tester.newFormTester("programForm");
formTester.submit("programButton");
// this line fails (expected NewProgramPage but was ProgramPage)
tester.assertRenderedPage(NewProgramPage.class);
}
// Program Page
public class ProgramPage extends WebPage {
public ProgramPage() {
Form programForm = new Form("programForm");
programForm.add(new Button("programButton") {
public void onSubmit() {
setReponsePage(NewProgramPage.class);
}
}
add(programForm);
}
}
Any help would be much appreciated
--
View this message in context:
http://www.nabble.com/Wicket-%3A-Navigation-Test-Case-Failure-tp17022776p17022776.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]