You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by gump lee <ze...@gmail.com> on 2015/07/20 16:27:16 UTC

Wicket 6 - test ajax component.

Dear All,

Is it possible to write a unit test with WicketTester which I need to send
Enter key to an AJAX component?


Best regards,
Gump

Re: Wicket 6 - test ajax component.

Posted by gump lee <ze...@gmail.com>.
Thanks for your reply. I would try to use other testing method to test my
component.
On Jul 21, 2015 4:47 PM, "andrea del bene" <an...@gmail.com> wrote:

> Hi,
>
> I don't think it's possible to send a specific key as this requires
> JavaScript code to be executed. But you can test AJAX events:
>
> //simulate an AJAX "click" event
> tester.executeAjaxEvent("label", "click");
>
>
> See 'Testing AJAX events' in the userguide for more details.
>
> Andrea.
>
> On 20/07/2015 16:27, gump lee wrote:
>
>> Dear All,
>>
>> Is it possible to write a unit test with WicketTester which I need to send
>> Enter key to an AJAX component?
>>
>>
>> Best regards,
>> Gump
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket 6 - test ajax component.

Posted by andrea del bene <an...@gmail.com>.
Hi,

I don't think it's possible to send a specific key as this requires 
JavaScript code to be executed. But you can test AJAX events:

//simulate an AJAX "click" event
tester.executeAjaxEvent("label", "click");


See 'Testing AJAX events' in the userguide for more details.

Andrea.

On 20/07/2015 16:27, gump lee wrote:
> Dear All,
>
> Is it possible to write a unit test with WicketTester which I need to send
> Enter key to an AJAX component?
>
>
> Best regards,
> Gump
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org