Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2010-05-19 Thread Alec Swan
I found a way to submit a form with Ajax link in a file attached to Wicket bug #2783: tester.executeAjaxEvent("path:to:ajax:link", onclick") I hope there is a more graceful way to do this. On Wed, May 19, 2010 at 10:38 AM, Alec Swan wrote: > I'd like to resurrect this old tread because I ran in

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2010-05-19 Thread Alec Swan
I'd like to resurrect this old tread because I ran into this issue again. Last time I changed my code to use a regular link to submit the form, but this time the form is on a modal window and has to be submitted with AjaxSubmitLink. My current findings are identical to the ones describes in my pre

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2009-12-29 Thread Kent Tong
Pieter Degraeuwe wrote: > > ah, ok. I didn't notice that. > > Any idea how to that javascript condition should look like in a general > way? > (Is there some wichet hook available for this?) > I'm looking for a generic approach; I don't want to clutter my tests with > code like "wait until comp

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2009-12-29 Thread Pieter Degraeuwe
ah, ok. I didn't notice that. Any idea how to that javascript condition should look like in a general way? (Is there some wichet hook available for this?) I'm looking for a generic approach; I don't want to clutter my tests with code like "wait until component contains value x, etc.) On Tue, Dec

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2009-12-29 Thread Kent Tong
Pieter Degraeuwe wrote: > > This seems to be quite useful. > > However, do you have a solution to avoit the 'sleep(...)' methods for ajax > calls? > When you have a lot of these tests, your testcyclus will be too long... > (Maybe there is a way to detect when the ajax calls are ended?) > The

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2009-12-29 Thread Pieter Degraeuwe
This seems to be quite useful. However, do you have a solution to avoit the 'sleep(...)' methods for ajax calls? When you have a lot of these tests, your testcyclus will be too long... (Maybe there is a way to detect when the ajax calls are ended?) Pieter On Tue, Dec 29, 2009 at 8:43 AM, Kent To

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2009-12-28 Thread Kent Tong
alecswan1 wrote: > > So, how do I test AjaxSubmitLink#onSubmit(AjaxRequestTarget target, Form > form) method? > You may try using http://wicketpagetest.sourceforge.net/ to test it instead. It supports real AJAX. - -- Kent Tong Better way to unit test Wicket pages (http://wicketpagetest.so

Re: Testing AjaxSubmitLink#onSubmit() with WicketTester @L

2009-12-28 Thread Alec Swan
I unsuccessfully tried several different ways to invoke the AjaxSubmitLink from my test method. 1. formTester.submit("submitButton") does not call AjaxSubmitLink#onSubmit(AjaxRequestTarget target, Form form) 2. formTester.submitLink("submitButton", false) fails with *org.apache.wicket.