Kamil created WICKET-6442:

             Summary: WicketTester#clickLink is not handling buttons
                 Key: WICKET-6442
                 URL: https://issues.apache.org/jira/browse/WICKET-6442
             Project: Wicket
          Issue Type: Bug
          Components: wicket
            Reporter: Kamil

WicketTester#clickLink javadoc says:
When clicking an AjaxSubmitLink the form, which the AjaxSubmitLink is attached 
to is first submitted, and then the onSubmit method on AjaxSubmitLink is 
invoked. If you have changed some values in the form during your test, these 
will also be submitted. This should not be used as a replacement for the {@link 
FormTester} to test your forms. It should be used to test that the code in your 
onSubmit method in AjaxSubmitLink actually works.

And this is exactly what I want to do - just test the code in my "onSubmit" 
One difference is that I'm using IndicatingAjaxButton instead of 
AjaxSubmitLink, which causes the exception being thrown:
java.lang.AssertionError: Link test:saveButton is not an instance of 
AbstractLink or IAjaxLink
        at org.junit.Assert.fail(Assert.java:88)

I already checked that exactly the same mechanism, that clickLink is using 
works fine for the buttons:
Component button = wicketTester.getComponentFromLastRenderedPage("saveButton");
so changing this method to work with button should be easy

This message was sent by Atlassian JIRA

Reply via email to