http-webtest-commits Mailing List for HTTP-WebTest (Page 26)
Brought to you by:
m_ilya,
richardanderson
You can subscribe to this list here.
2002 |
Jan
(38) |
Feb
(83) |
Mar
(10) |
Apr
(28) |
May
(42) |
Jun
(61) |
Jul
(43) |
Aug
(42) |
Sep
(14) |
Oct
(27) |
Nov
(16) |
Dec
(81) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(81) |
Feb
(29) |
Mar
(32) |
Apr
(42) |
May
(3) |
Jun
|
Jul
(11) |
Aug
|
Sep
(33) |
Oct
(6) |
Nov
(4) |
Dec
|
2004 |
Jan
|
Feb
|
Mar
(10) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ilya M. <m_...@us...> - 2002-02-17 14:15:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv12244 Modified Files: utils.pl Log Message: Minor fixes Index: utils.pl =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/utils.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** utils.pl 12 Feb 2002 12:47:35 -0000 1.2 --- utils.pl 17 Feb 2002 14:15:29 -0000 1.3 *************** *** 103,113 **** my $url = abs_url($server_url, '/')->as_string; $$output_ref =~ s|\Q$url\E ! |$1http://http.web.test/|xg; } # change urls on some canonical in test output if(defined $server_hostname) { ! $$output_ref =~ s|( URL: \s+ ) http://\Q$server_hostname\E:\d+/ ! |$1http://http.web.test/|xg; } } --- 103,113 ---- my $url = abs_url($server_url, '/')->as_string; $$output_ref =~ s|\Q$url\E ! |http://http.web.test/|xg; } # change urls on some canonical in test output if(defined $server_hostname) { ! $$output_ref =~ s|http://\Q$server_hostname\E:\d+/ ! |http://http.web.test/|xg; } } |
From: Ilya M. <m_...@us...> - 2002-02-17 10:57:07
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv9968 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Changes 16 Feb 2002 00:50:06 -0000 1.15 --- Changes 17 Feb 2002 10:57:03 -0000 1.16 *************** *** 7,11 **** Revision history for Perl module HTTP::WebTest. ! Current Version ENHANCEMENTS: --- 7,11 ---- Revision history for Perl module HTTP::WebTest. ! 1.99_04 Sun Feb 17 2002 ENHANCEMENTS: |
From: Ilya M. <m_...@us...> - 2002-02-17 10:50:13
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv8828/lib/HTTP Modified Files: WebTest.pm Log Message: Regenerated Index: WebTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WebTest.pm 16 Feb 2002 00:44:14 -0000 1.6 --- WebTest.pm 17 Feb 2002 10:50:08 -0000 1.7 *************** *** 25,29 **** package HTTP::WebTest; ! $VERSION = '1.99_03'; # actual content of HTTP::WebTest package is in HTTP::WebTest::API --- 25,29 ---- package HTTP::WebTest; ! $VERSION = '1.99_04'; # actual content of HTTP::WebTest package is in HTTP::WebTest::API *************** *** 276,279 **** --- 276,306 ---- Perl metasymbols are interpreted: "\n\t" is a newline and a tab. + Also it is possible to specify Perl code instead of scalar, instead of + list parameter value or instead of element of list paramater. Curly + brackets are used to denote Perl code inside wtscript files. This + code will be evaluated during test run. + + C<HTTP::WebTest> compiles this Perl code as anonymous subroutines + which are called during test run when value of corresponding test + parameters are required. When these subroutines are called + C<HTTP::WebTest> object is passed to them. + + Some examples of syntax: + + # scalar value + name = { 1 + 1 } + + # list value (Perl code should return array reference) + name = { [ a => 'b', c => 'd' ] } + + # element of list value + name = ( + 'first value' + { "first " . "value" } + ) + + # accessing HTTP::WebTest object + name = { my $webtest = shift; ..... } + =head3 Examples of wtscript files *************** *** 347,350 **** --- 374,382 ---- test parameters. Additionally, optional global test parameters can be passed in a hash passed as the second argument. + + Instead of test parameter values subroutine references can be + specified. Referenced subroutines are called during test run when + values of corresponding test parameters are required. When called + these subroutines get C<HTTP::WebTest> object passed to them. Tests can be run as |
From: Ilya M. <m_...@us...> - 2002-02-17 10:49:02
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv8557 Modified Files: TODO Log Message: Document embeded Perl syntax Index: TODO =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TODO 16 Feb 2002 23:48:54 -0000 1.8 --- TODO 17 Feb 2002 10:48:51 -0000 1.9 *************** *** 3,8 **** My current TODO: - * document usage of embeded Perl in wtscript files - * test broken tests diagnostics --- 3,6 ---- |
From: Ilya M. <m_...@us...> - 2002-02-17 10:49:01
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv8557/lib/HTTP Modified Files: WebTest.pm.in Log Message: Document embeded Perl syntax Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebTest.pm.in 16 Feb 2002 00:00:46 -0000 1.4 --- WebTest.pm.in 17 Feb 2002 10:48:51 -0000 1.5 *************** *** 5,9 **** package HTTP::WebTest; ! $VERSION = '1.99_03'; # actual content of HTTP::WebTest package is in HTTP::WebTest::API --- 5,9 ---- package HTTP::WebTest; ! $VERSION = '1.99_04'; # actual content of HTTP::WebTest package is in HTTP::WebTest::API *************** *** 256,259 **** --- 256,286 ---- Perl metasymbols are interpreted: "\n\t" is a newline and a tab. + Also it is possible to specify Perl code instead of scalar, instead of + list parameter value or instead of element of list paramater. Curly + brackets are used to denote Perl code inside wtscript files. This + code will be evaluated during test run. + + C<HTTP::WebTest> compiles this Perl code as anonymous subroutines + which are called during test run when value of corresponding test + parameters are required. When these subroutines are called + C<HTTP::WebTest> object is passed to them. + + Some examples of syntax: + + # scalar value + name = { 1 + 1 } + + # list value (Perl code should return array reference) + name = { [ a => 'b', c => 'd' ] } + + # element of list value + name = ( + 'first value' + { "first " . "value" } + ) + + # accessing HTTP::WebTest object + name = { my $webtest = shift; ..... } + =head3 Examples of wtscript files *************** *** 327,330 **** --- 354,362 ---- test parameters. Additionally, optional global test parameters can be passed in a hash passed as the second argument. + + Instead of test parameter values subroutine references can be + specified. Referenced subroutines are called during test run when + values of corresponding test parameters are required. When called + these subroutines get C<HTTP::WebTest> object passed to them. Tests can be run as |
From: Ilya M. <m_...@us...> - 2002-02-16 23:49:05
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv29800/lib/HTTP/WebTest Modified Files: Plugins.pod Log Message: Remove obsolete information about old validation API from Plugin writer guide. Index: Plugins.pod =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugins.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Plugins.pod 28 Jan 2002 06:32:02 -0000 1.2 --- Plugins.pod 16 Feb 2002 23:48:54 -0000 1.3 *************** *** 38,45 **** =head3 Returns ! A hash reference on hash which contains information about supported ! test parameters and their type. ! Each test type is defined by method in L<HTTP::WebTest::Plugin|HTTP::WebTest::Plugin>. Type C<foobar> is defined as method C<check_foobar> in this package. See its --- 38,52 ---- =head3 Returns ! A string which contains information about supported test parameters and ! their types. ! String has following format: ! ! PARAM1 TYPE1 PARAM2 TYPE2 PARAM3 TYPE3 ... PARAMN TYPEN ! ! PARAM is a name of test parameter and TYPE is it's type ! specification. It should be separated by any whitespace character. ! ! Each test parameter type is defined by method in L<HTTP::WebTest::Plugin|HTTP::WebTest::Plugin>. Type C<foobar> is defined as method C<check_foobar> in this package. See its *************** *** 47,62 **** known test types. - This method is used to validate values of test parameters. If - additional checks are required they can be defined in method - C<validate_params>. See below. - =head3 Example sub param_types { ! return { qw(ignore_case yesno ! text_forbid list ! text_require list ! regex_forbid list ! regex_require list) }; } --- 54,65 ---- 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); } *************** *** 69,118 **** =head1 OPTIONAL METHODS ! Each plugin package can provide following methods: ! ! =head2 validate_params ($params) ! ! This method can be defined in plugin packages to add additional checks ! for test parameters which are not covered by test parameter types ! specification defined by C<param_types>. If you define this method in ! plugin package be sure to call C<$self->SUPER::validate_params($test)>. ! ! =head3 Parameters ! ! =over 4 ! ! =item * $params ! ! A reference on hash which contains test parameters. ! ! =back ! ! =head3 Returns ! ! This test should return hash with test parameter names as keys and ! L<HTTP::WebTest::TestResult|HTTP::WebTest::TestResult> objects as ! values. ! ! =head3 Example ! ! This example adds check for test parameter C<my_test_param>. It must ! be equal to 'BlaBla' if this test parameter is specified. ! ! sub validate_params { ! my $self = shift; ! my $params = shift; ! ! # run default checks ! my %checks = $self->SUPER::validate_params($params); ! ! if($checks{my_test_param}) { ! my $ok = $params->{my_test_param} eq 'BlaBla'; ! $checks{my_test_param} = ! $self->test_result($ok, 'Parameter my_test_param is not ' . ! 'equal to BlaBla'); ! } ! ! return %checks; ! } =head2 start_tests () --- 72,76 ---- =head1 OPTIONAL METHODS ! Each plugin package may provide following methods: =head2 start_tests () *************** *** 162,166 **** =head1 EXAMPLES ! Well, why anybody need examples when source code of internal L<HTTP::WebTest|HTTP::WebTest> plugins is available. --- 120,124 ---- =head1 EXAMPLES ! Well, why anybody need examples when source code of all L<HTTP::WebTest|HTTP::WebTest> plugins is available. |
From: Ilya M. <m_...@us...> - 2002-02-16 23:49:04
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv29800 Modified Files: TODO Log Message: Remove obsolete information about old validation API from Plugin writer guide. Index: TODO =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TODO 16 Feb 2002 00:37:43 -0000 1.7 --- TODO 16 Feb 2002 23:48:54 -0000 1.8 *************** *** 7,13 **** * test broken tests diagnostics - * update plugin writer guide with info about new test parameter - validation API - * resurrect all parameter checks from old HTTP::WebTest --- 7,10 ---- *************** *** 28,32 **** * plugin for page validation with HTML::Validator ! * simple navigation using link names and button names (with HTML::Form) * Generator of both Perl and wtscript code from test objects --- 25,29 ---- * plugin for page validation with HTML::Validator ! * simple navigation using link names and button names (with HTML::Form ?) * Generator of both Perl and wtscript code from test objects |
From: Ilya M. <m_...@us...> - 2002-02-16 00:50:11
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv25363 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Changes 15 Feb 2002 10:43:09 -0000 1.14 --- Changes 16 Feb 2002 00:50:06 -0000 1.15 *************** *** 25,28 **** --- 25,31 ---- browsers. Thanks to Thieme Geoff for bugging me about it :) + * Added non-core plugin HTTP::WebTest::Plugin::Hooks which defines two + new test parameters: 'on_request' and 'on_response'. + INCOMPATIBILITIES: |
From: Ilya M. <m_...@us...> - 2002-02-16 00:44:22
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv24060/lib/HTTP Modified Files: WebTest.pm Log Message: Remove documentation on ::Hooks test parameters from HTTP::WebTest Index: WebTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WebTest.pm 16 Feb 2002 00:00:46 -0000 1.5 --- WebTest.pm 16 Feb 2002 00:44:14 -0000 1.6 *************** *** 953,991 **** Any number less than C<max_rtime> (if C<max_rtime> is specified). - =head2 on_request - - Value of this test parameter is ignored. However it is evaluted before - L<HTTP::WebTest> does a request to web page so it is useful to do some - initalization before the request. - - =head3 Example - - See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. - - =head2 on_response - - This is list parameter which is treated as test result. It is evaluted - when L<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 L<HTTP::WebTest> got - some a response for the test request. - - =head3 Allowed values - - ( YESNO1, COMMENT1 - YESNO2, COMMENT2 - .... - YESNON, COMMENTN ) - - Here C<YESNO>, C<COMMENT> - is a test result. C<YESNO> - is either - C<yes> if test is successful or C<no> if it is not. C<COMMENT> is a - text of comment associated with this test. - - =head3 Example - - See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. - - =head2 output_ref --- 953,956 ---- |
From: Ilya M. <m_...@us...> - 2002-02-16 00:44:22
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv24060/lib/HTTP/WebTest/Plugin Modified Files: Hooks.pm Log Message: Remove documentation on ::Hooks test parameters from HTTP::WebTest Index: Hooks.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Hooks.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Hooks.pm 16 Feb 2002 00:35:19 -0000 1.3 --- Hooks.pm 16 Feb 2002 00:44:14 -0000 1.4 *************** *** 46,51 **** =head1 TEST PARAMETERS - =for pod_merge copy params - =head2 on_request --- 46,49 ---- |
From: Ilya M. <m_...@us...> - 2002-02-16 00:40:48
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv23232 Modified Files: Cookbook.pod Log Message: Minor fixes Index: Cookbook.pod =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Cookbook.pod,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Cookbook.pod 16 Feb 2002 00:37:43 -0000 1.7 --- Cookbook.pod 16 Feb 2002 00:40:41 -0000 1.8 *************** *** 158,163 **** ($ID) = $webtest->last_response->content =~ /ID=(\d+)/; ! # because this sub does no checks returns reference on ! # empty array []; } --- 158,163 ---- ($ID) = $webtest->last_response->content =~ /ID=(\d+)/; ! # because no checks are defined a reference on empty array ! # must be returned []; } |
From: Ilya M. <m_...@us...> - 2002-02-16 00:37:50
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv22604 Modified Files: TODO Log Message: Added ::Hooks usage example into cookbook Index: TODO =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/TODO,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TODO 16 Feb 2002 00:00:47 -0000 1.6 --- TODO 16 Feb 2002 00:37:43 -0000 1.7 *************** *** 14,19 **** * generate index of test parameters in a reference - * ::Hooks usage example in cookbook - * polish local mode tests - they are *very* non portable now --- 14,17 ---- |
From: Ilya M. <m_...@us...> - 2002-02-16 00:37:50
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv22604/lib/HTTP/WebTest Modified Files: Cookbook.pod Log Message: Added ::Hooks usage example into cookbook Index: Cookbook.pod =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Cookbook.pod,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Cookbook.pod 30 Jan 2002 16:47:13 -0000 1.6 --- Cookbook.pod 16 Feb 2002 00:37:43 -0000 1.7 *************** *** 12,22 **** usage. ! All examples are either runnable programs (see ! L<HTTP::WebTest::API|HTTP::WebTest::API>) or runnable wtscript files ! (see L<perldoc wt|wt>). =head1 BASICS ! =head2 Check Statis Website This wtscript tests couple of static pages on my website: --- 12,22 ---- usage. ! Unless otherwise is stated all examples are either runnable programs ! (see L<HTTP::WebTest::API|HTTP::WebTest::API>) or runnable wtscript ! files (see L<perldoc wt|wt>). =head1 BASICS ! =head2 Check Static Website This wtscript tests couple of static pages on my website: *************** *** 84,88 **** =head1 ADVANCED ! =head2 Test::Harness compatible output This Perl script reads test specification from file C<test.wt> and --- 84,88 ---- =head1 ADVANCED ! =head2 Test::Harness Compatible Output This Perl script reads test specification from file C<test.wt> and *************** *** 97,100 **** --- 97,174 ---- plugins => [ '::HarnessReport' ] }); + + =head2 User-Defined Checks + + It is possible to define new checks without writting new plugin + module. Here fragment of wtscript file which checks if a new record + have been inserted into a database as result of test request. + + # load HTTP::WebTest::Plugin::Hooks module which provides test + # parameter on_response + plugins = ( ::Hooks ) + + .... + + test_name = Add Record + # request to this URL with parameter 'name' adds new record + url = http://some.server/add-record + params = ( name => 'John' ) + + # define check + on_response = { + # it is assumed that $Test::dbh is database handler + my $has_record = $Test::dbh->selectrow_array( + 'SELECT COUNT(*) FROM USERS ' . + 'WHERE NAME = ?', + undef, 'John' + ); + + # return result of check with a comment + [ $has_record > 0 ? 'yes' : 'no', 'Have got John' ]; + } + end_test + + =head2 Dynamic Tests + + Sometimes it is needed to feed the results of a previous test into the + next test. For example, C<Add Record> creates a database record, emits + HTML containing the new record id, and C<Delete Record> deletes the + database record using the record id generated in C<Add Record>. + + It is possible to use L<HTTP::WebTest|HTTP::WebTest> to write such + tests. Here incomplete example of wtscript which implements it. + + # load HTTP::WebTest::Plugin::Hooks module which provides test + # parameter on_response + plugins = ( ::Hooks ) + + .... + + test_name = Add Record + # request to this URL with parameter 'name' adds new record + url = http://some.server/add-record + params = ( name => 'John' ) + + # get ID from a page + on_response = { + # get webtest object + my $webtest = shift; + + # find ID in the returned page + ($ID) = $webtest->last_response->content =~ /ID=(\d+)/; + + # because this sub does no checks returns reference on + # empty array + []; + } + end_test + + .... + + test_name = Delete Record + # request to this URL with parameter 'id' deletes record + url = http://some.server/delete-record + params = ( id => { $ID } ) + end_test =head1 COPYRIGHT |
From: Ilya M. <m_...@us...> - 2002-02-16 00:36:40
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv22323/lib/HTTP/WebTest Modified Files: Plugin.pm Log Message: Pass HTTP::WebTest objects to test parameter subroutines Index: Plugin.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Plugin.pm 15 Feb 2002 14:48:01 -0000 1.7 --- Plugin.pm 16 Feb 2002 00:36:35 -0000 1.8 *************** *** 173,177 **** # than one time unless(${$self->_sub_cache}{$value}) { ! ${$self->_sub_cache}{$value} = $value->(); } --- 173,177 ---- # than one time unless(${$self->_sub_cache}{$value}) { ! ${$self->_sub_cache}{$value} = $value->($self->webtest); } |
From: Ilya M. <m_...@us...> - 2002-02-16 00:36:39
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv22323/t Modified Files: 02-generic.t Log Message: Pass HTTP::WebTest objects to test parameter subroutines Index: 02-generic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** 02-generic.t 15 Feb 2002 14:48:42 -0000 1.6 --- 02-generic.t 16 Feb 2002 00:36:35 -0000 1.7 *************** *** 18,22 **** use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 21 } # init tests --- 18,22 ---- use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 22 } # init tests *************** *** 413,416 **** --- 413,428 ---- $WEBTEST->run_tests($tests1, $opts); ok($value == 3); + } + + # 22: test arguments passed to subroutine test parameter + { + my $webtest = undef; + + my $tests1 = [ { url => abs_url($URL, '/test-file1'), + text_require => sub { $webtest = shift; [] } } ]; + my $opts = { default_report => 'no' }; + + $WEBTEST->run_tests($tests1, $opts); + ok($webtest eq $WEBTEST); } |
From: Ilya M. <m_...@us...> - 2002-02-16 00:35:27
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv22092 Modified Files: Hooks.pm Log Message: Minor fixes Index: Hooks.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Hooks.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Hooks.pm 15 Feb 2002 15:33:54 -0000 1.2 --- Hooks.pm 16 Feb 2002 00:35:19 -0000 1.3 *************** *** 54,61 **** initalization before the request. - =head3 Example - - See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. - =head2 on_response --- 54,57 ---- |
From: Ilya M. <m_...@us...> - 2002-02-16 00:00:51
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv13690/lib/HTTP Modified Files: WebTest.pm.in WebTest.pm Log Message: Add section PLUGINS to HTTP::WebTest docs Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WebTest.pm.in 12 Feb 2002 05:34:26 -0000 1.3 --- WebTest.pm.in 16 Feb 2002 00:00:46 -0000 1.4 *************** *** 369,372 **** --- 369,452 ---- $webtest->run_tests($tests, $params); + =head1 PLUGIN MODULES + + =head2 Core Plugin Modules + + C<HTTP::WebTest> provides a number of core plugin modules which are + loaded by default: + + =over 4 + + =item L<HTTP::WebTest::Plugin::Apache> + + This plugin provides support for local web file test mode. + + =item L<HTTP::WebTest::Plugin::ContentSizeTest> + + This plugin provides size checks of HTTP response bodies. + + =item L<HTTP::WebTest::Plugin::Cookies> + + This plugin provides means to control sending and recieve cookies. + + =item L<HTTP::WebTest::Plugin::DefaultReport> + + Default test report plugin. + + =item L<HTTP::WebTest::Plugin::Loader> + + This plugin allows to load external plugin modules. + + =item L<HTTP::WebTest::Plugin::ResponseTimeTest> + + This plugin provides support for response time tests. + + =item L<HTTP::WebTest::Plugin::SetRequest> + + This plugin initializes test HTTP requests. + + =item L<HTTP::WebTest::Plugin::StatusTest> + + This plugin checks HTTP response statuses. + + =item L<HTTP::WebTest::Plugin::TextMatchTest> + + This plugin provides test parameters which allow to check body of HTTP + responses. + + =back + + Information about test parameters supported by core plugins is + summarized below in section L<TEST PARAMETERS|TEST PARAMETERS>. + + =head2 Other Plugin Modules Bundled With HTTP::WebTest + + Following plugin modules come with HTTP::WebTest but they are not + loaded by default. They should be loaded using global test parameter + C<plugins> when needed. + + =over 4 + + =item L<HTTP::WebTest::Plugin::HarnessReport> + + This report plugin can generate L<Test::Harness|Test::Harness> + compatible test reports. + + =item L<HTTP::WebTest::Plugin::Hooks> + + This plugin allows to define callback test parameters which are + evaluated at specific time of L<HTTP::WebTest> test run. These test + parameters can define user-defined checks. + + =back + + See documentation on these modules for more information. + + =head2 Writting Plugin Modules + + L<perldoc HTTP::WebTest::Plugins|HTTP::WebTest::Plugins> contains + information needed for L<HTTP::WebTest|HTTP::WebTest> plugin + developers. + =head1 TEST PARAMETERS Index: WebTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebTest.pm 12 Feb 2002 13:09:18 -0000 1.4 --- WebTest.pm 16 Feb 2002 00:00:46 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- # lib/HTTP/WebTest/Plugin/DefaultReport.pm # lib/HTTP/WebTest/Plugin/HarnessReport.pm + # lib/HTTP/WebTest/Plugin/Hooks.pm # lib/HTTP/WebTest/Plugin/Loader.pm # lib/HTTP/WebTest/Plugin/ResponseTimeTest.pm *************** *** 388,391 **** --- 389,472 ---- $webtest->run_tests($tests, $params); + =head1 PLUGIN MODULES + + =head2 Core Plugin Modules + + C<HTTP::WebTest> provides a number of core plugin modules which are + loaded by default: + + =over 4 + + =item L<HTTP::WebTest::Plugin::Apache> + + This plugin provides support for local web file test mode. + + =item L<HTTP::WebTest::Plugin::ContentSizeTest> + + This plugin provides size checks of HTTP response bodies. + + =item L<HTTP::WebTest::Plugin::Cookies> + + This plugin provides means to control sending and recieve cookies. + + =item L<HTTP::WebTest::Plugin::DefaultReport> + + Default test report plugin. + + =item L<HTTP::WebTest::Plugin::Loader> + + This plugin allows to load external plugin modules. + + =item L<HTTP::WebTest::Plugin::ResponseTimeTest> + + This plugin provides support for response time tests. + + =item L<HTTP::WebTest::Plugin::SetRequest> + + This plugin initializes test HTTP requests. + + =item L<HTTP::WebTest::Plugin::StatusTest> + + This plugin checks HTTP response statuses. + + =item L<HTTP::WebTest::Plugin::TextMatchTest> + + This plugin provides test parameters which allow to check body of HTTP + responses. + + =back + + Information about test parameters supported by core plugins is + summarized below in section L<TEST PARAMETERS|TEST PARAMETERS>. + + =head2 Other Plugin Modules Bundled With HTTP::WebTest + + Following plugin modules come with HTTP::WebTest but they are not + loaded by default. They should be loaded using global test parameter + C<plugins> when needed. + + =over 4 + + =item L<HTTP::WebTest::Plugin::HarnessReport> + + This report plugin can generate L<Test::Harness|Test::Harness> + compatible test reports. + + =item L<HTTP::WebTest::Plugin::Hooks> + + This plugin allows to define callback test parameters which are + evaluated at specific time of L<HTTP::WebTest> test run. These test + parameters can define user-defined checks. + + =back + + See documentation on these modules for more information. + + =head2 Writting Plugin Modules + + L<perldoc HTTP::WebTest::Plugins|HTTP::WebTest::Plugins> contains + information needed for L<HTTP::WebTest|HTTP::WebTest> plugin + developers. + =head1 TEST PARAMETERS *************** *** 871,874 **** --- 952,990 ---- Any number less than C<max_rtime> (if C<max_rtime> is specified). + + =head2 on_request + + Value of this test parameter is ignored. However it is evaluted before + L<HTTP::WebTest> does a request to web page so it is useful to do some + initalization before the request. + + =head3 Example + + See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. + + =head2 on_response + + This is list parameter which is treated as test result. It is evaluted + when L<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 L<HTTP::WebTest> got + some a response for the test request. + + =head3 Allowed values + + ( YESNO1, COMMENT1 + YESNO2, COMMENT2 + .... + YESNON, COMMENTN ) + + Here C<YESNO>, C<COMMENT> - is a test result. C<YESNO> - is either + C<yes> if test is successful or C<no> if it is not. C<COMMENT> is a + text of comment associated with this test. + + =head3 Example + + See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. + =head2 output_ref |
From: Ilya M. <m_...@us...> - 2002-02-16 00:00:51
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv13690 Modified Files: TODO Log Message: Add section PLUGINS to HTTP::WebTest docs Index: TODO =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/TODO,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TODO 15 Feb 2002 15:00:59 -0000 1.5 --- TODO 16 Feb 2002 00:00:47 -0000 1.6 *************** *** 14,21 **** * generate index of test parameters in a reference - * add pointers on ::HarnessReport in HTTP::WebTest docs - - * add pointers on ::Hooks in in HTTP::WebTest docs - * ::Hooks usage example in cookbook --- 14,17 ---- |
From: Ilya M. <m_...@us...> - 2002-02-15 23:59:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv13374/lib/HTTP/WebTest/Plugin Modified Files: TextMatchTest.pm Log Message: Minor fix Index: TextMatchTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/TextMatchTest.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextMatchTest.pm 2 Feb 2002 04:08:19 -0000 1.2 --- TextMatchTest.pm 15 Feb 2002 23:59:44 -0000 1.3 *************** *** 13,17 **** =head1 DESCRIPTION ! This plugin provides test parameters that allow to check response body. It supports regexps and literal string searches. --- 13,17 ---- =head1 DESCRIPTION ! This plugin provides test parameters which allow to check response body. It supports regexps and literal string searches. |
From: Ilya M. <m_...@us...> - 2002-02-15 23:37:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv7893 Modified Files: ContentSizeTest.pm Log Message: Minor fix Index: ContentSizeTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/ContentSizeTest.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ContentSizeTest.pm 15 Feb 2002 21:13:45 -0000 1.3 --- ContentSizeTest.pm 15 Feb 2002 23:37:38 -0000 1.4 *************** *** 13,17 **** =head1 DESCRIPTION ! This plugin provides size checks of HTTP response body size. =cut --- 13,17 ---- =head1 DESCRIPTION ! This plugin provides size checks of HTTP response body. =cut |
From: Ilya M. <m_...@us...> - 2002-02-15 21:14:00
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv32274 Modified Files: ContentSizeTest.pm Log Message: Minor fix Index: ContentSizeTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/ContentSizeTest.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ContentSizeTest.pm 2 Feb 2002 04:08:19 -0000 1.2 --- ContentSizeTest.pm 15 Feb 2002 21:13:45 -0000 1.3 *************** *** 13,17 **** =head1 DESCRIPTION ! This plugin provides http response body size checks. =cut --- 13,17 ---- =head1 DESCRIPTION ! This plugin provides size checks of HTTP response body size. =cut |
From: Ilya M. <m_...@us...> - 2002-02-15 16:52:24
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv7811/t Modified Files: 09-hooks.t Log Message: Updated Index: 09-hooks.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/09-hooks.t,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 09-hooks.t 15 Feb 2002 14:55:56 -0000 1.1 --- 09-hooks.t 15 Feb 2002 15:42:20 -0000 1.2 *************** *** 80,84 **** { url => abs_url($URL, '/inc_counter'), on_response => [ 'yes', 'Test 3', ! 'no', 'Test 4' ] } ]; check_webtest(webtest => $WEBTEST, --- 80,86 ---- { url => abs_url($URL, '/inc_counter'), on_response => [ 'yes', 'Test 3', ! 'no', 'Test 4' ] }, ! { url => abs_url($URL, '/inc_counter'), ! on_response => [] } ]; check_webtest(webtest => $WEBTEST, |
From: Ilya M. <m_...@us...> - 2002-02-15 16:51:57
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv7811/t/test.out Modified Files: on_response Log Message: Updated Index: on_response =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/test.out/on_response,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** on_response 15 Feb 2002 14:55:56 -0000 1.1 --- on_response 15 Feb 2002 15:42:20 -0000 1.2 *************** *** 1,6 **** Failed Succeeded Test Name 0 2 *** no name *** ! 0 2 *** no name *** ! 0 3 *** no name *** --- 1,7 ---- Failed Succeeded Test Name 0 2 *** no name *** ! 1 1 *** no name *** ! 1 2 *** no name *** ! 0 1 *** no name *** *************** *** 18,22 **** 200 OK SUCCEED USER DEFINED TESTS ! Test 2 SUCCEED --- 19,23 ---- 200 OK SUCCEED USER DEFINED TESTS ! Test 2 FAIL *************** *** 27,32 **** USER DEFINED TESTS Test 3 SUCCEED ! no SUCCEED ! Total web tests failed: 0 succeeded: 7 --- 28,39 ---- USER DEFINED TESTS Test 3 SUCCEED ! Test 4 FAIL ! URL: http://http.web.test/inc_counter ! ! STATUS CODE CHECK ! 200 OK SUCCEED ! ! ! Total web tests failed: 2 succeeded: 6 |
From: Ilya M. <m_...@us...> - 2002-02-15 15:34:22
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv3792/lib/HTTP/WebTest/Plugin Modified Files: Hooks.pm Log Message: Oops, commited actually non-working code Index: Hooks.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Hooks.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Hooks.pm 15 Feb 2002 14:50:29 -0000 1.1 --- Hooks.pm 15 Feb 2002 15:33:54 -0000 1.2 *************** *** 105,109 **** for my $i (0 .. @$value / 2 - 1) { ! my ($ok, $comment) = @$value[$i, $i + 1]; $self->validate_value("$param\[$i]", $ok, 'yesno'); $self->validate_value("$param\[" . ($i + 1) . "]", $ok, 'scalar'); --- 105,109 ---- for my $i (0 .. @$value / 2 - 1) { ! my ($ok, $comment) = @$value[2 * $i, 2 * $i + 1]; $self->validate_value("$param\[$i]", $ok, 'yesno'); $self->validate_value("$param\[" . ($i + 1) . "]", $ok, 'scalar'); *************** *** 128,133 **** my @results = (); for my $i (0 .. @$results / 2 - 1) { ! my ($ok, $comment) = @$results[$i, $i + 1]; ! push @results, $self->test_result($ok, $comment); } --- 128,133 ---- my @results = (); for my $i (0 .. @$results / 2 - 1) { ! my ($ok, $comment) = @$results[2 * $i, 2 * $i + 1]; ! push @results, $self->test_result($ok =~ /yes/i ? 1 : 0, $comment); } |
From: Ilya M. <m_...@us...> - 2002-02-15 15:01:08
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv28766 Modified Files: TODO Log Message: Updated Index: TODO =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/TODO,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TODO 7 Feb 2002 23:33:09 -0000 1.4 --- TODO 15 Feb 2002 15:00:59 -0000 1.5 *************** *** 16,19 **** --- 16,23 ---- * add pointers on ::HarnessReport in HTTP::WebTest docs + * add pointers on ::Hooks in in HTTP::WebTest docs + + * ::Hooks usage example in cookbook + * polish local mode tests - they are *very* non portable now |