Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

create test scripts that run from the web as well from the web

0 views
Skip to first unread message

Mark Stosberg

unread,
Dec 13, 2005, 10:27:53 AM12/13/05
to per...@perl.org
Now that I'm using Selenium, I wanted to integrate some of the perl
testing tools I already like.

http://selenium.thoughtworks.com/

I found one way to do this was to create a test script that runs as a
CGI script. Adding just one line to the top of the script allows it to
run from the web or from the command line:

if ($ENV{SCRIPT_NAME}) { $|++ && print "Content-Type: text/plain\n\n"; }

In my setup, this meant I also needed to give the script a ".cgi" extension.

Setting a simple environment variable in my profile allowed 'prove' to
recognize a second test extension without extra effort:

export PROVE_SWITCHES="--ext=.t --ext=.cgi"

Now I can have Selenium run a Perl test and inspect the 'ok', 'not ok' output.

Mark

0 new messages