From: Keith Jackson <kjackson@ey...> - 2005-02-23 21:12:55
I am exploring ways to implement testing on a large dynamic web site.
We use MySQL, perl and H::T for all dynamic content. I've explored some
tools that check the HTML pages or the http data stream and compare them
to a base set of data. I've also used Test::More for some basic testing
to make sure data is saved and retrieved properly.
Now I'm thinking that what I really want to look at is the data being
passed to the template under various conditions. The templates
themselves need to be tested too but they are rarely the source of
If I put a statement in my perl code just before the $t->output which
dumps the contents of $t->param,
map("$_ = ".Dumper($template->param($_))
save that output as a baseline. Then for testing repeat the process but
now compare the values to the baseline data.
Does anyone have any experience with testing in this way. Obviously
this is only part of the testing.
Thanks in advance.
Keith Jackson <kjackson@...>
At 03:12 PM 2/23/2005, Keith Jackson wrote:
>If I put a statement in my perl code just before the $t->output which
>dumps the contents of $t->param,
>map("$_ = ".Dumper($template->param($_))
>save that output as a baseline. Then for testing repeat the process but
>now compare the values to the baseline data.
I wrote HTML::Template::Dumper to do basically the same thing. It is
designed to use a verity of dumping formats (Data::Dumper, YAML,
whatever). You need to make some minimal modifications to the program
(replace "use HTML::Template" with "use HTML::Template::Dumper" and set an
output format) to run the tests--these should be significantly less than
modifications to reinvent what HTML::Template::Dumper already does.
IT Web Asst.
677 S Segoe Rd.
Madison, WI 53711-1086