[DCPM] New testing module

Matthew Browning matthewbrowning at gmail.com
Tue Dec 30 09:57:41 PST 2008


On Tue, Dec 30, 2008 at 3:35 PM, Aaron Trevena <aaron.trevena at gmail.com> wrote:
> Hi all,
>
> I've written a new testing module for a client, based on
> Test::HTML::Content but skipping the xpath code, and making it faster
> by re-using parse trees.
>

Let's have a look then ;)

MB


> That means you can do funky tests like ..
>
> text_ok($filename,'foo bar','found text : foo bar'); # check text found in file
> no_text($filename,'Concert','no text matching : Concert'); # check
> text found in file
> image_ok($filename,'/images/error.gif','matching image found image in HTML');
> link_ok($filename,'/foo/bar.cgi?id=123','Found link in HTML');
>
> For added coolness, it also provides some new functions so that you
> can test forms easily such as :
>
> form_field_value_ok($filename,'category_id', 10297, undef,
> 'category_id matches');
> form_select_field_ok($filename,{ field_name => $field_name, selected
> => $field_value,  form_name => $form_name}, $description);
>
> Once I've got permission from the client I'll package it up for CPAN.
>
> I was thinking of naming it Test::HTML
>
> A.
>
> --
> http://www.aarontrevena.co.uk
> LAMP System Integration, Development and Hosting
> _______________________________________________
> Devoncornwall-pm mailing list
> Devoncornwall-pm at pm.org
> http://mail.pm.org/mailman/listinfo/devoncornwall-pm
>


More information about the Devoncornwall-pm mailing list