It's a shame all of my code can't reside in the tidy confines of my Perl libraries - from time-to-time, I have to write JavaScript for a better browser experience. If you haven't heard, Yahoo's YUI has a testing framework (YUITest) that is pretty neat and I'm now using it (vs. Selenium).
Granted, I wasn't heavily invested w/ Selenium, so switching wasn't really that much of a hurdle. But YUITest is pretty cool stuff. I will tell you that it's no Test::More. It doesn't have cmp_ok, so you have to program around it a bit. And you have to program in JavaScript, itself.
What I found as a neat approach is to write the self-contained YUITest code in a separate file in a template directory (i.e. selectTest.yuit).
Then in my app code, I pass along a conditional template parameter that will include that
http://www.example.com/myApp.cgi
And that'll run the app as usual. Then if I append ?t=1, then my app will suck in the
Peace,
Jason
HtmlUnit (Score:1)
I recently wrapped the java HtmlUnit library in Perl (see CPAN) -- it is kinda like WWW::Mechanize except with a fairly functional javascript engine. I don't know if it'll run the YUITest framework, but it might be worth a try. I hope to also wrap the Mechanize API and eventually have Test::WWW::Mechanize::HtmlUnit or similar.