HTTP::WebTest::Plugin::Hooks - Provides callbacks called during test run
plugins = ( ::Hooks ) test_name = Name1 .... # do some test initialization on_request = { My::init() } end_test test_name = Name2 .... # define custom test on_response = ( { My::test() ? 'yes' : 'no' } => 'My test' ) end_test test_name = Name3 .... # call finalization code with returning any test results on_response = { My::finalize(); return [] } end_test
This plugin module adds test parameters which values are evaluated at specific time of HTTP::WebTest test run. It can be used to do some initialization before doing test request, to do some finalization when test response is received or to implement user defined tests without need to write separate plugin module.
Value of this test parameter is ignored. However it is evaluted before HTTP::WebTest does a request to web page so it is useful to do some initalization before the request.
This is list parameter which is treated as test result. It is evaluted when HTTP::WebTest gets a response for the test request.
It can be useful to define custom tests without writting new plugins and/or it can be useful to run some code when HTTP::WebTest got some a response for the test request.
( YESNO1, COMMENT1 YESNO2, COMMENT2 .... YESNON, COMMENTN )
Here YESNO, COMMENT - is a test result. YESNO - is either yes if test is successful or no if it is not. COMMENT is a text of comment associated with this test.
YESNO
COMMENT
yes
no
See example in HTTP::WebTest::Cookbook.
Copyright (c) 2001,2002 Ilya Martynov. All rights reserved.
This module is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License.
HTTP::WebTest
HTTP::WebTest::API
HTTP::WebTest::Plugin
HTTP::WebTest::Plugins
To install HTTP::WebTest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::WebTest
CPAN shell
perl -MCPAN -e shell install HTTP::WebTest
For more information on module installation, please visit the detailed CPAN module installation guide.