# $Id: Plugins.pod,v 1.7 2003/03/02 11:52:10 m_ilya Exp $ =head1 NAME HTTP::WebTest::Plugins - Plugin developers documentation. =head1 SYNOPSIS Not applicable. =head1 DESCRIPTION This document is the starting point for developers who wish to extend L functionality with external plugins. =head1 ABOUT PLUGINS Plugin can be used to add new test types and add new report types. A plugin is just a Perl package that defines class with a number of methods which if present are called by L at various stages of test. Each plugin package should subclass L. Report plugins can subclass L which is a subclass of L. L defines some helper methods useful in report plugins and handles some test parameters common for report plugins. =head1 REQUIRED METHODS Each plugin package must provide following method: =head2 param_types =head3 Returns A string that contains information about supported test parameters and their types. String has following format: PARAM1 TYPE1 PARAM2 TYPE2 PARAM3 TYPE3 ... PARAMN TYPEN PARAM is the name of a test parameter and TYPE is it's type specification. They should be separated by a whitespace character. Each test parameter type is defined by a method in L. Type C is defined as method C in this package. See its documentation for list of all C methods - these methods define all known test types. =head3 Example sub param_types { return q(ignore_case yesno text_forbid list text_require list regex_forbid list regex_require list); } This is from L. It defines the test parameters C, C, C, C and C. C and C are test parameter types. =head1 OPTIONAL METHODS Each plugin package may provide following methods: =head2 start_tests () Called before runing test sequence. Initializations can be done in this method. Report plugins can use this hook to create the report header. =head2 end_tests () Called when test sequence is finished. Clean-up and finalization can be done in this method. Report plugins can use this hook to finish the report. =head2 prepare_request () Called just before L submits the HTTP request. Various properties of request can be set here. =head2 check_response () Called after L gets the HTTP response. Web page tests should be placed here. =head2 report_test () Called after all L hooks are called. Normally used by report plugins to generate report about test just done. =head3 Returns These methods should return results of tests made in the following form: [ [ TEST_GROUP1_NAME, TEST_RESULT1, TEST_RESULT2, ... ], [ TEST_GROUP2_NAME, TEST_RESULT1, TEST_RESULT2, ... ], ... ]; C is a string that describes a group of web tests and their results. It is used during the generation of the test report. C is an L object. =head1 EXAMPLES Some examples of plugins are: =over 4 =item L Plugin that uses both C and C hooks. =item L Simple plugin that defines only the C hook. =item L Example of a report plugin. Uses C, C and C hooks. =back =head1 COPYRIGHT Copyright (c) 2001-2003 Ilya Martynov. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L L L L =cut