Hi,
Put a breakpoint in the button's onSubmit() method and see whether it
is actually called.
It could be that you need to call formTester.submit("myForm:myButton");
On Mon, Aug 13, 2012 at 5:18 PM, JCoder <[email protected]> wrote:
> Hi all,
>
> Im working at a basic Unit Test that looks like this:
>
> 1. tester.assertRenderedPage(FirstPage.class);
> 2. FormTester formTester = tester.newFormTester("myForm");
> 3. formTester.submit("myButton");
> 4. tester.assertRenderedPage(SecondPage.class);
>
> All lines work as expected. Only line 4 fails. I just want to verify a click
> on a button and after that a certain Page (SecondPage) should be rendered.
>
> The test fails with: "junit.framework.AssertionFailedError:
> expected:<SecondPage> but was:<FirstPage>"
> What did I wrong?
>
> Cheers & Thanks in advance,
> Y
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]