Much much later than promised, but finally the 2.1 is out.
The focus of this release is on AJAX support. While Ivonna still doesn't deal with client side stuff, you can now fake an AJAX request and test the server's response.
Let's see the code:
var session = new TestSession();
var result =
session.ExecuteAjaxMethod(
"Page.aspx",
"MethodName",
new {name="John"});
Assert.AreEqual("Hi John!", result);
Note that I'm using an anonymous class object to pass the arguments.
The code above would work with JSON-formatted Web services as well (note that you wouldn't use SOAP formatted services with AJAX anyway). If you need to return a custom object, you can use a generic overload of the same method.
There's also another, simpler alternative for doing AJAX: UpdatePanel. While most serious developers frown upon it, it remains a nice option for doing it quick (and dirty) if the performance and traffic is not an issue. While there's not much you can test with it, Ivonna provides a way to execute a request coming from inside an UpdatePanel:
var session = new TestSession();
session.GetPage("HasUpdatePanel.aspx");
var response =
session.ProcessRequest
(session.CreateUpdatePanelRequest
("Button1"));
That's all for AJAX functionality in the current release. I'd probably have to fix a few bugs or provide more options and better API in the future releases. Please give me some feedback in the Forums.
As for the optimization stuff, I already wrote about it in the previous post, so there's not much to add.
So, what's the roadmap for 2.2? I guess it's going to be extensibility. The code is complicated enough to introduce an IoC container (it's going to be StructureMap), and I'd like to open some possibilities for custom request and response types, as well as modify the initialization aspects for advanced scenarios. You are welcome, as always, to suggest an extension you want, and I'll make Ivonna flexible enough to satisfy your needs.