NAME
WWW::Webrobot::SelftestRunner - Start httpd and run a test plan
SYNOPSIS
use WWW::Webrobot::SelftestRunner qw/RunTestplan HttpdEcho Config/;
exit RunTestplan(HttpdEcho, Config(qw/Test/, $test_plan);
exit RunTestplan(HttpdEcho, Config(qw/Test Html/, $test_plan);
see also t/get.t
DESCRIPTION
This package serves some functions to start a http daemon and run a test plan. It is only used for the test in the t/...
directory.
FUNCTIONS
- RunTestplan($serverfunc, $config, $testplan)
-
Run a
WWW::Webrobot::StupidHTTPD
http daemon implementing$serverfunc
. Then run aWWW::Webrobot
http client using the configuration$config
and the testplan$testplan
. - HttpdEcho
-
A simple server function for the
WWW::Webrobot::StupidHTTPD
http daemon. It read the requested urlhttp://server:port/action/anyting_else
as an action where the action is denoted by theaction
part within the url. The result of the action is returned as content in the response. Actions areurl echo the url as response content content echo the content in the request as response content method echo the method in the request as response content headers echo a stringified form of the request headers as response content
- Config(Modulenames...)
-
Simple config string for
WWW::Webrobot::Print::*
output. Defaults to "Test" if no parameter is given.Example:
my $cfg = Config(qw/Html Test/); my $cfg = Config;