Hi

Lately I have been working on improving the WicketTester to support
testing of AJAX-enabled web applications. This has led to methods such
as assertComponentOnAjaxResponse(), executeAjaxEvent() and extension of
clickLink() to support AjaxLink and AjaxSubmitLink.

The problem now as I see it, is that what you get from
WicketTester.getServletResponse().getDocument() is not the actual HTML
markup document on the server, but could also be an AJAX response. So if
you have used that one as a way to test that the markup is actually
being rendered as expected. It can't really be used for that.

Also there is the WicketTester.debugComponentTrees(), which actually
shows the correct component hierarchy even if some components has been
replaced in an AjaxEventBehavior.onEvent() method. (Makes sence since
you need to add a component to the component tree, if you want to add it
to a AJAX response).

So right now we have a situation where you (using WicketTester) can get
hold of the correct component tree even after and AJAX event, but you
can't get the complete markup which matches the component tree. 


Therefore I would like to modify WicketTester so it is possible to get
hold of the *merged* markup, which means the original markup when you
started a page or a panel, and then the AjaxRequestTarget.addComponent()
changes has been *merged* into it so the markup actually matches whats
rendered on the page.

But I need some ideas on how to do that. Right now it's the
MockHttpServletResponse which handles whats in the response. But I guess
that we would need a different way of preserving the state between
multiple responses, so we will be able to merge them all together. Of
course the internal "MarkupCacheStateWhatever" should be flushed
everytime we start a new page, but every following AJAX responses should
be cached and merged. Just a thought.


Regards
Frank Bille
Avaleo


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to