[Canberra-pm] Testing HTML::Mason web application workflows

Alex Satrapa grail at goldweb.com.au
Thu Dec 9 17:11:48 PST 2010


Dear Mongers,

I'm currently playing around with HTML::Mason::Test which lets me test individual templates in what are effectively unit tests.

My Google-fu is obviously weak, I cannot find anything about integration/workflow testing.

On one hand, I could use Test::WWW::Mechanize. The catch with this approach is that I'll need to set up a web server - not something I really want to do in my test suite since I don't want to have "install Apache" as a prerequisite for being able to develop the application (the developer might have a fondness for some other web server).

Under Ruby on Rails and Django, the test suites provide the ability to mimic HTTP calls, instead invoking the template engine directly. In the test suite I can instruct the test engine to fill in certain fields with certain values, "submit" that form to the mock HTTP service (which is just a shim covering the Rails or Django libraries), with no need to set up an actual web server launching CGI scripts or WSGI or what not.

My current test suites run in the order of 15 seconds for 403 tests. I want to avoid network or disk operations where at all possible.

Is such an environment available for testing HTML::Mason applications? I'd like this to be pure Perl as far as possible.

Alex



More information about the Canberra-pm mailing list