http-webtest-commits Mailing List for HTTP-WebTest (Page 27)
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-15 14:57:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv27806 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MANIFEST 15 Feb 2002 11:50:47 -0000 1.5 --- MANIFEST 15 Feb 2002 14:57:45 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- 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 *************** *** 42,45 **** --- 43,47 ---- t/07-compat.t t/08-plugins.t + t/09-hooks.t t/HTTP/WebTest/Plugin/Counter.pm t/HelloWorld.pm *************** *** 79,82 **** --- 81,85 ---- t/test.out/cookie3 t/test.out/default-report-yes + t/test.out/on_response t/test.out/pauth t/test.out/plugin-counter |
From: Ilya M. <m_...@us...> - 2002-02-15 14:56:05
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv27335/t/test.out Added Files: on_response Log Message: Added tests for ::Hooks plugin --- NEW FILE: on_response --- Failed Succeeded Test Name 0 2 *** no name *** 0 2 *** no name *** 0 3 *** no name *** URL: http://http.web.test/inc_counter STATUS CODE CHECK 200 OK SUCCEED USER DEFINED TESTS Test 1 SUCCEED URL: http://http.web.test/inc_counter STATUS CODE CHECK 200 OK SUCCEED USER DEFINED TESTS Test 2 SUCCEED URL: http://http.web.test/inc_counter STATUS CODE CHECK 200 OK SUCCEED USER DEFINED TESTS Test 3 SUCCEED no SUCCEED Total web tests failed: 0 succeeded: 7 |
From: Ilya M. <m_...@us...> - 2002-02-15 14:56:03
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv27335/t Added Files: 09-hooks.t Log Message: Added tests for ::Hooks plugin --- NEW FILE: 09-hooks.t --- #!/usr/bin/perl -w # $Id: 09-hooks.t,v 1.1 2002/02/15 14:55:56 m_ilya Exp $ # This script tests HTTP::WebTest::Plugin::Hooks plugin use strict; use CGI::Cookie; use HTTP::Response; use HTTP::Status; use IO::File; use Test; use HTTP::WebTest; require 't/config.pl'; require 't/utils.pl'; use vars qw($HOSTNAME $PORT $URL $TEST); BEGIN { plan tests => 7 } # init tests my $COUNTER_FILE = 't/counter'; my $PID = start_webserver(port => $PORT, server_sub => \&server_sub); my $WEBTEST = HTTP::WebTest->new; my $OPTS = { plugins => [ '::Hooks' ], default_report => 'no' }; # 1-3: test on_request parameter { init_counter(); my $counter_value = undef; my $tests1 = [ { url => abs_url($URL, '/inc_counter'), on_request => sub { $counter_value = counter() } } ]; $WEBTEST->run_tests($tests1, $OPTS); ok($counter_value == 0); ok(counter() == 1); init_counter(); my $tests2 = [ { url => abs_url($URL, '/inc_counter'), on_request => sub { inc_counter() } } ]; $WEBTEST->run_tests($tests2, $OPTS); ok(counter() == 2); } # 4-6: test on_response parameter which doesn't returns any test results { init_counter(); my $counter_value = undef; my $tests1 = [ { url => abs_url($URL, '/inc_counter'), on_response => sub { $counter_value = counter(); [] } } ]; $WEBTEST->run_tests($tests1, $OPTS); ok($counter_value == 1); ok(counter() == 1); init_counter(); my $tests2 = [ { url => abs_url($URL, '/inc_counter'), on_response => sub { inc_counter(); [] } } ]; $WEBTEST->run_tests($tests2, $OPTS); ok(counter() == 2); } # 7: test response parameter which returns some test results { my $tests = [ { url => abs_url($URL, '/inc_counter'), on_response => [ 'yes', 'Test 1' ] }, { url => abs_url($URL, '/inc_counter'), on_response => [ 'no', 'Test 2' ] }, { url => abs_url($URL, '/inc_counter'), on_response => [ 'yes', 'Test 3', 'no', 'Test 4' ] } ]; check_webtest(webtest => $WEBTEST, server_url => $URL, tests => $tests, opts => { plugins => [ '::Hooks' ] }, check_file => 't/test.out/on_response'); } # try to stop server even we have been crashed END { stop_webserver($PID) if defined $PID } # remove counter file unlink $COUNTER_FILE; # sets counter to zero sub init_counter { write_file($COUNTER_FILE, 0); } # increase counter sub inc_counter { my $counter = counter(); $counter ++; write_file($COUNTER_FILE, $counter); } # get counter sub counter { return read_file($COUNTER_FILE, 1) || 0; } # here we handle connects to our mini web server sub server_sub { my %param = @_; my $request = $param{request}; my $connect = $param{connect}; my $path = $request->url->path; if($path eq '/inc_counter' ) { # count requests inc_counter(); $connect->send_file_response('t/test1.txt'); } else { $connect->send_error(RC_NOT_FOUND); } } |
From: Ilya M. <m_...@us...> - 2002-02-15 14:50:36
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv25651/lib/HTTP/WebTest/Plugin Added Files: Hooks.pm Log Message: Added plugin which provides on_request and on_response test parameters --- NEW FILE: Hooks.pm --- # $Id: Hooks.pm,v 1.1 2002/02/15 14:50:29 m_ilya Exp $ package HTTP::WebTest::Plugin::Hooks; =head1 NAME HTTP::WebTest::Plugin::Hooks - Provides callbacks called during test run =head1 SYNOPSIS 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 =head1 DESCRIPTION This plugin module adds test parameters which values are evaluated at specific time of L<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. =cut use strict; use URI; use base qw(HTTP::WebTest::Plugin); =head1 TEST PARAMETERS =for pod_merge copy params =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>. =cut sub param_types { return q(on_request anything on_response test_results); } # implements check for parameter type 'test_results' sub check_test_results { my $self = shift; my $param = shift; my $value = shift; my @spec = @_; # first of all check if it is a list $self->check_list($param, $value); # check if it has even number of elements unless(@$value % 2 == 0) { die "HTTP::WebTest: parameter '$param' is not a list with even number of elements"; } 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'); } } sub prepare_request { my $self = shift; # this both checks and evaluates test parameter $self->validate_params(qw(on_request)); } sub check_response { my $self = shift; $self->validate_params(qw(on_response)); my $results = $self->test_param('on_response'); if(defined $results) { my @results = (); for my $i (0 .. @$results / 2 - 1) { my ($ok, $comment) = @$results[$i, $i + 1]; push @results, $self->test_result($ok, $comment); } return ['User defined tests', @results] if @results; } return []; } =head1 COPYRIGHT 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. =head1 SEE ALSO L<HTTP::WebTest|HTTP::WebTest> L<HTTP::WebTest::API|HTTP::WebTest::API> L<HTTP::WebTest::Plugin|HTTP::WebTest::Plugin> L<HTTP::WebTest::Plugins|HTTP::WebTest::Plugins> =cut 1; |
From: Ilya M. <m_...@us...> - 2002-02-15 14:48:49
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv24976/t Modified Files: 02-generic.t Log Message: Added tests for test param values caching Index: 02-generic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 02-generic.t 15 Feb 2002 10:39:49 -0000 1.5 --- 02-generic.t 15 Feb 2002 14:48:42 -0000 1.6 *************** *** 18,22 **** use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 18 } # init tests --- 18,22 ---- use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 21 } # init tests *************** *** 388,391 **** --- 388,416 ---- tests => $tests, check_file => 't/test.out/redirect'); + } + + # 19-21: test subroutine caching + { + my $value = 0; + + my $sub = sub { + $value ++; + + return abs_url($URL, '/test-file1'); + }; + + my $tests1 = [ { url => $sub } ]; + my $opts = { default_report => 'no' }; + + $WEBTEST->run_tests($tests1, $opts); + ok($value == 1); + $WEBTEST->run_tests($tests1, $opts); + ok($value == 2); + + my $tests2 = [ { url => $sub }, + { url => $sub } ]; + + $WEBTEST->run_tests($tests1, $opts); + ok($value == 3); } |
From: Ilya M. <m_...@us...> - 2002-02-15 14:48:09
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv24803/lib/HTTP/WebTest Modified Files: Plugin.pm Log Message: Cache values of test parameters Index: Plugin.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Plugin.pm 15 Feb 2002 13:13:39 -0000 1.6 --- Plugin.pm 15 Feb 2002 14:48:01 -0000 1.7 *************** *** 159,162 **** --- 159,165 ---- } + # reference on hash which caches return value of subroutine calls + *_sub_cache = make_access_method('_SUB_CACHE', sub { {} }); + # searches passed data structure for code references and replaces them # with value returned by referenced subs *************** *** 166,170 **** if(ref($value) eq 'CODE') { ! $value = $value->(); } --- 169,180 ---- if(ref($value) eq 'CODE') { ! # check if value is in cache; value returned from subroutine ! # is cached so we don't evaluate test parameter value more ! # than one time ! unless(${$self->_sub_cache}{$value}) { ! ${$self->_sub_cache}{$value} = $value->(); ! } ! ! $value = ${$self->_sub_cache}{$value}; } |
From: Ilya M. <m_...@us...> - 2002-02-15 13:13:41
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv28437 Modified Files: Plugin.pm Log Message: Minor fix Index: Plugin.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Plugin.pm 15 Feb 2002 12:36:27 -0000 1.5 --- Plugin.pm 15 Feb 2002 13:13:39 -0000 1.6 *************** *** 377,381 **** my $elem = $list[$i]; ! $self->validate_value("${param}[$i]", $elem, $type); $prev_type = $type; --- 377,381 ---- my $elem = $list[$i]; ! $self->validate_value("$param\[$i]", $elem, $type); $prev_type = $type; |
From: Ilya M. <m_...@us...> - 2002-02-15 13:13:03
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv28115 Modified Files: HarnessReport.pm Log Message: Minor fix Index: HarnessReport.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/HarnessReport.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HarnessReport.pm 2 Feb 2002 04:08:19 -0000 1.2 --- HarnessReport.pm 15 Feb 2002 13:12:55 -0000 1.3 *************** *** 9,13 **** =head1 SYNOPSIS ! plugins = ::HarnessReport default_report = no --- 9,13 ---- =head1 SYNOPSIS ! plugins = ( ::HarnessReport ) default_report = no |
From: Ilya M. <m_...@us...> - 2002-02-15 12:36:40
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv14389 Modified Files: Plugin.pm Log Message: Minor fix Index: Plugin.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Plugin.pm 7 Feb 2002 23:39:55 -0000 1.4 --- Plugin.pm 15 Feb 2002 12:36:27 -0000 1.5 *************** *** 377,381 **** my $elem = $list[$i]; ! $self->validate_value("$param\[$i\]", $elem, $type); $prev_type = $type; --- 377,381 ---- my $elem = $list[$i]; ! $self->validate_value("${param}[$i]", $elem, $type); $prev_type = $type; |
From: Ilya M. <m_...@us...> - 2002-02-15 11:51:05
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv31765 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MANIFEST 7 Feb 2002 23:33:09 -0000 1.4 --- MANIFEST 15 Feb 2002 11:50:47 -0000 1.5 *************** *** 84,87 **** --- 84,88 ---- t/test.out/plugin-hello-counter t/test.out/proxy + t/test.out/redirect t/test.out/report-cookie1 t/test.out/report-cookie2 *************** *** 95,98 **** --- 96,100 ---- t/test.out/run-wtscript t/test.out/short-url + t/test.out/show-headers t/test.out/size t/test.out/status *************** *** 104,107 **** --- 106,110 ---- t/test.out/text_match2 t/test.out/time + t/test.out/user_agent t/test.shtml t/test1.txt |
From: Ilya M. <m_...@us...> - 2002-02-15 10:43:12
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv11270 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Changes 12 Feb 2002 12:50:51 -0000 1.13 --- Changes 15 Feb 2002 10:43:09 -0000 1.14 *************** *** 21,24 **** --- 21,28 ---- Anderson. + * HTTP-WebTest does follow redirects after POST now. Note that it + breaks RFC but actually it is semi-standart behaviour of all + browsers. Thanks to Thieme Geoff for bugging me about it :) + INCOMPATIBILITIES: |
From: Ilya M. <m_...@us...> - 2002-02-15 10:42:42
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv11147 Modified Files: Makefile.PL INSTALL Log Message: It seems that we need at least version 5.60 of LWP Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Makefile.PL,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.PL 24 Jan 2002 12:26:02 -0000 1.1.1.1 --- Makefile.PL 15 Feb 2002 10:42:38 -0000 1.2 *************** *** 24,32 **** 'CGI::Cookie' => 0, 'File::Temp' => 0, - 'HTTP::Cookies' => 0, 'HTTP::Daemon' => 0, ! 'HTTP::Request' => 0, ! 'HTTP::Status' => 0, ! 'LWP::UserAgent' => 0, 'MIME::Base64' => 0, 'Net::SMTP' => 0, --- 24,29 ---- 'CGI::Cookie' => 0, 'File::Temp' => 0, 'HTTP::Daemon' => 0, ! 'LWP' => 5.60, 'MIME::Base64' => 0, 'Net::SMTP' => 0, Index: INSTALL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/INSTALL,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** INSTALL 24 Jan 2002 12:26:04 -0000 1.1.1.1 --- INSTALL 15 Feb 2002 10:42:38 -0000 1.2 *************** *** 6,10 **** * Algorithm::Diff * File::Temp (is included in Perl 5.6.1 and later) ! * libwww * libnet * Parse::RecDescent --- 6,10 ---- * Algorithm::Diff * File::Temp (is included in Perl 5.6.1 and later) ! * libwww 5.60 or later * libnet * Parse::RecDescent |
From: Ilya M. <m_...@us...> - 2002-02-15 10:39:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv10580/t Modified Files: 02-generic.t Log Message: Added tests for redirects Index: 02-generic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** 02-generic.t 12 Feb 2002 13:09:18 -0000 1.4 --- 02-generic.t 15 Feb 2002 10:39:49 -0000 1.5 *************** *** 18,22 **** use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 17 } # init tests --- 18,22 ---- use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 18 } # init tests *************** *** 374,377 **** --- 374,393 ---- } + # 18: test handling of redirects + { + my $tests = [ { url => abs_url($URL, '/redirect'), + method => 'get', + text_require => [ 'abcde' ], }, + { url => abs_url($URL, '/redirect'), + method => 'post', + text_require => [ 'abcde' ], }, + ]; + + check_webtest(webtest => $WEBTEST, + server_url => $URL, + tests => $tests, + check_file => 't/test.out/redirect'); + } + # try to stop server even we have been crashed END { stop_webserver($PID) if defined $PID } *************** *** 463,466 **** --- 479,489 ---- $response->header(Content_Type => 'text/plain'); $response->content($content); + + # send it to browser + $connect->send_response($response); + } elsif($path eq '/redirect') { + # create response object + my $response = new HTTP::Response(RC_FOUND); + $response->header(Location => '/test-file1'); # send it to browser |
From: Ilya M. <m_...@us...> - 2002-02-15 10:39:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv10580/t/test.out Added Files: redirect Log Message: Added tests for redirects --- NEW FILE: redirect --- Failed Succeeded Test Name 0 2 *** no name *** 0 2 *** no name *** URL: http://http.web.test/redirect STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT abcde SUCCEED URL: http://http.web.test/redirect STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT abcde SUCCEED Total web tests failed: 0 succeeded: 4 |
From: Ilya M. <m_...@us...> - 2002-02-15 10:38:51
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv10311/lib/HTTP/WebTest Modified Files: API.pm Log Message: Allow redirects after POST Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** API.pm 2 Feb 2002 04:08:19 -0000 1.4 --- API.pm 15 Feb 2002 10:38:33 -0000 1.5 *************** *** 346,349 **** --- 346,352 ---- $user_agent->cookie_jar(new HTTP::WebTest::Cookies); + # allow redirects after POST + push @{ $user_agent->requests_redirectable }, 'POST'; + return $user_agent; } |
From: Ilya M. <m_...@us...> - 2002-02-12 13:18:18
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv27911 Modified Files: 06-parser.t Log Message: Disable one test on old Perls cause it triggers Perl bug Index: 06-parser.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/06-parser.t,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** 06-parser.t 12 Feb 2002 11:48:21 -0000 1.9 --- 06-parser.t 12 Feb 2002 13:07:58 -0000 1.10 *************** *** 93,98 **** parse_error_check(wtscript => 't/borked4.wt', check_file => 't/test.out/borked4.err'); ! parse_error_check(wtscript => 't/borked5.wt', ! check_file => 't/test.out/borked5.err'); parse_error_check(wtscript => 't/borked6.wt', check_file => 't/test.out/borked6.err'); --- 93,102 ---- parse_error_check(wtscript => 't/borked4.wt', check_file => 't/test.out/borked4.err'); ! if($] >= 5.006) { ! parse_error_check(wtscript => 't/borked5.wt', ! check_file => 't/test.out/borked5.err'); ! } else { ! skip('skip: test is skipped because it triggers Perl bug', 1); ! } parse_error_check(wtscript => 't/borked6.wt', check_file => 't/test.out/borked6.err'); |
From: Ilya M. <m_...@us...> - 2002-02-12 13:17:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv30145 Modified Files: 06-parser.t Log Message: Oops, I've disabled wrong test Index: 06-parser.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/06-parser.t,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** 06-parser.t 12 Feb 2002 13:07:58 -0000 1.10 --- 06-parser.t 12 Feb 2002 13:17:13 -0000 1.11 *************** *** 93,105 **** parse_error_check(wtscript => 't/borked4.wt', check_file => 't/test.out/borked4.err'); ! if($] >= 5.006) { ! parse_error_check(wtscript => 't/borked5.wt', ! check_file => 't/test.out/borked5.err'); ! } else { ! skip('skip: test is skipped because it triggers Perl bug', 1); ! } parse_error_check(wtscript => 't/borked6.wt', check_file => 't/test.out/borked6.err'); ! { my $out_filter = sub { $_[0] =~ s/\(eval \d+\)/(eval NN)/; --- 93,101 ---- parse_error_check(wtscript => 't/borked4.wt', check_file => 't/test.out/borked4.err'); ! parse_error_check(wtscript => 't/borked5.wt', ! check_file => 't/test.out/borked5.err'); parse_error_check(wtscript => 't/borked6.wt', check_file => 't/test.out/borked6.err'); ! if($] >= 5.006) { my $out_filter = sub { $_[0] =~ s/\(eval \d+\)/(eval NN)/; *************** *** 108,111 **** --- 104,109 ---- check_file => 't/test.out/borked7.err', out_filter => $out_filter); + } else { + skip('skip: test is skipped because it triggers Perl bug', 1); } parse_error_check(wtscript => 't/borked8.wt', |
From: Ilya M. <m_...@us...> - 2002-02-12 13:09:26
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv28198/lib/HTTP Modified Files: WebTest.pm Log Message: Minor fixes Index: WebTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WebTest.pm 12 Feb 2002 12:48:19 -0000 1.3 --- WebTest.pm 12 Feb 2002 13:09:18 -0000 1.4 *************** *** 1062,1066 **** =head2 user_agent ! Get/set the product token that is used to identify the user agent on the network. --- 1062,1066 ---- =head2 user_agent ! Set the product token that is used to identify the user agent on the network. |
From: Ilya M. <m_...@us...> - 2002-02-12 13:09:26
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv28198/t/test.out Modified Files: user_agent Log Message: Minor fixes Index: user_agent =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/test.out/user_agent,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** user_agent 12 Feb 2002 12:17:44 -0000 1.1 --- user_agent 12 Feb 2002 13:09:18 -0000 1.2 *************** *** 9,13 **** 200 OK SUCCEED REQUIRED TEXT ! User agent: HTTP-WebTest/1.99_03 SUCCEED --- 9,13 ---- 200 OK SUCCEED REQUIRED TEXT ! User agent: HTTP-WebTest/NN SUCCEED |
From: Ilya M. <m_...@us...> - 2002-02-12 13:09:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv28198/t Modified Files: 02-generic.t Log Message: Minor fixes Index: 02-generic.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/02-generic.t,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** 02-generic.t 12 Feb 2002 12:17:44 -0000 1.3 --- 02-generic.t 12 Feb 2002 13:09:18 -0000 1.4 *************** *** 370,374 **** server_url => $URL, tests => $tests, ! out_filtet => $out_filter, check_file => 't/test.out/user_agent'); } --- 370,374 ---- server_url => $URL, tests => $tests, ! out_filter => $out_filter, check_file => 't/test.out/user_agent'); } |
From: Ilya M. <m_...@us...> - 2002-02-12 13:09:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv28198/lib/HTTP/WebTest/Plugin Modified Files: SetRequest.pm Log Message: Minor fixes Index: SetRequest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/SetRequest.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SetRequest.pm 12 Feb 2002 12:17:00 -0000 1.5 --- SetRequest.pm 12 Feb 2002 13:09:18 -0000 1.6 *************** *** 88,92 **** =head2 user_agent ! Get/set the product token that is used to identify the user agent on the network. --- 88,92 ---- =head2 user_agent ! Set the product token that is used to identify the user agent on the network. |
From: Ilya M. <m_...@us...> - 2002-02-12 12:50:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv23830 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Changes 8 Feb 2002 14:06:48 -0000 1.12 --- Changes 12 Feb 2002 12:50:51 -0000 1.13 *************** *** 15,18 **** --- 15,24 ---- * Support for embeded Perl in wtscript files. + * Added test parameters 'user_agent' and 'show_headers'. Thanks to + Markus Kucborski for patch. + + * Updated docs on format of wtscript files. Thanks to Richard + Anderson. + INCOMPATIBILITIES: |
From: Ilya M. <m_...@us...> - 2002-02-12 12:48:23
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv23288/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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WebTest.pm 24 Jan 2002 14:52:40 -0000 1.2 --- WebTest.pm 12 Feb 2002 12:48:19 -0000 1.3 *************** *** 205,209 **** =head3 File format ! The following is ignored in wtscript file: =over 4 --- 205,220 ---- =head3 File format ! The wtscript file is a text file containing global parameters and ! test blocks containing test block parameters. A test block begins with ! a test_name parameter and ends with an end_test directive. The order of ! the parameters and test blocks is arbitrary. ! ! Test block parameters MUST occur between a test_name parameter and an ! end_test directive. (Test block parameters affect only an individual ! test.) Global parameters must NOT occur between a test_name parameter ! and an end_test directive. (This requirement does not apply to ! certain parameters that are both global and test block parameters.) ! ! The following lines are ignored: =over 4 *************** *** 224,246 **** =back - The order of the parameters in the parameter file is arbitrary, - with the following exceptions: - - =over 4 - - =item * - - Test block parameters MUST occur between a test_name parameter and an - end_test directive. (Test block parameters affect only an individual - test.) - - =item * - - Global parameters must NOT occur between a test_name parameter - and an end_test directive. (This requirement does not apply to - parameters that are both global and test block parameters.) - - =back - Parameters are either scalar (single-valued) or lists (single or multi-valued). --- 235,238 ---- *************** *** 248,252 **** You can specify scalar parameters using forms such as: ! name = value name = value --- 240,244 ---- You can specify scalar parameters using forms such as: ! name=value name = value *************** *** 257,272 **** name = ( first value second value ) ! name = ( first value => second value ! third value => fourth value ! ) name = ( first value => second value ) name = ( 'first value' 'second value' ) ! name = ( first value second value third value => 'fourth value' ! ) name = ( first value --- 249,264 ---- name = ( first value second value ) ! name=( first value => second value ! third value => fourth value ! ) name = ( first value => second value ) name = ( 'first value' 'second value' ) ! name= ( first value second value third value => 'fourth value' ! ) name = ( first value *************** *** 277,314 **** ) ! (The equals sign must be followed by a space, tab or newline; all ! other spaces are optional.) ! ! PARAMETER VALUES BEGINNING AND ENDING WITH A SINGLE QUOTE WILL HAVE ! THE SINGLE QUOTES REMOVED. For example, 'foobar' is parsed as a value ! of foobar and ''foobar'' is parsed as a value of 'foobar'. To specify ! a null (placeholder) value, use ''. ! ! You MUST enclose the parameter value in single quotes if you want ! to specify: ! ! =over 4 ! ! =item * ! ! a value beginning with a left parenthesis ! ! =item * ! ! a value ending with a right parenthesis ! ! =item * ! ! a value beginning with leading white space (blanks or tabs) ! ! =item * ! ! a value ending with trailing white space (blanks or tabs) ! ! =item * ! ! a value beginning and ending with single quotes ! ! =back =head3 Examples of wtscript files --- 269,277 ---- ) ! You can specify a null (placeholder) value using '' or "". Within single ! or double quotes, the usual Perl string quoting rules apply. Thus, single ! quotes mean that all enclosed characters are interpreted literally: '\n' ! is backslash-n rather than a newline character. Double quotes mean that ! Perl metasymbols are interpreted: "\n\t" is a newline and a tab. =head3 Examples of wtscript files *************** *** 946,950 **** for proxy server access authorization. - =head2 plugins --- 909,912 ---- *************** *** 1026,1029 **** --- 988,1003 ---- C<no> + =head2 show_headers + + Include request and response headers in the test report. + + =head3 Allowed values + + C<yes>, C<no> + + =head3 Default value + + C<no> + =head2 show_html *************** *** 1085,1088 **** --- 1059,1074 ---- URL to test. If schema part of URL is omitted (i.e. URL doesn't start with C<http://>, C<ftp://>, etc) then C<http://> is implied. + + =head2 user_agent + + Get/set the product token that is used to identify the user agent on + the network. + + =head3 Default value + + C<HTTP-WebTest/NN> + + where C<NN> is version number of HTTP-WebTest. + |
From: Ilya M. <m_...@us...> - 2002-02-12 12:47:42
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv23126/t/test.out Added Files: show-headers Log Message: Added tests for parameter show_headers --- NEW FILE: show-headers --- Failed Succeeded Test Name 0 2 *** no name *** 1 0 *** no name *** URL: http://http.web.test/test-file1 STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT 987654 SUCCEED REQUEST HEADERS: GET http://http.web.test/test-file1 User-Agent: HTTP-WebTest/NN RESPONSE HEADERS: HTTP/1.1 200 OK Date: SOMEDAY Server: libwww-perl-daemon/NN Content-Length: 52 Content-Type: text/plain Last-Modified: SOMEDAY Client-Date: SOMEDAY Client-Response-Num: 1 URL: http://http.web.test/non-existent STATUS CODE CHECK 404 Not Found FAIL REQUEST HEADERS: GET http://http.web.test/non-existent User-Agent: HTTP-WebTest/NN RESPONSE HEADERS: HTTP/1.1 404 Not Found Date: SOMEDAY Server: libwww-perl-daemon/NN Content-Length: 53 Content-Type: text/html Client-Date: SOMEDAY Client-Response-Num: 1 Title: 404 Not Found Total web tests failed: 1 succeeded: 2 |
From: Ilya M. <m_...@us...> - 2002-02-12 12:47:42
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv23126/t Modified Files: utils.pl 05-report.t Log Message: Added tests for parameter show_headers Index: utils.pl =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/utils.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** utils.pl 24 Jan 2002 12:26:11 -0000 1.1.1.1 --- utils.pl 12 Feb 2002 12:47:35 -0000 1.2 *************** *** 102,106 **** if(defined $server_url) { my $url = abs_url($server_url, '/')->as_string; ! $$output_ref =~ s|( URL: \s+ ) \Q$url\E |$1http://http.web.test/|xg; } --- 102,106 ---- if(defined $server_url) { my $url = abs_url($server_url, '/')->as_string; ! $$output_ref =~ s|\Q$url\E |$1http://http.web.test/|xg; } Index: 05-report.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/05-report.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** 05-report.t 24 Jan 2002 12:26:11 -0000 1.1.1.1 --- 05-report.t 12 Feb 2002 12:47:35 -0000 1.2 *************** *** 19,23 **** use vars qw($HOSTNAME $PORT $URL $TEST); ! BEGIN { plan tests => 10 } # init tests --- 19,23 ---- use vars qw($HOSTNAME $PORT $URL $TEST); ! BEGIN { plan tests => 11 } # init tests *************** *** 156,159 **** --- 156,183 ---- tests => $tests, check_file => 't/test.out/test-harness') + } + + # 11: test show_headers parameter + { + # remove cookies from cookie jar - it affects output of report plugin + $WEBTEST->reset_user_agent; + + my $tests = [ $TEST, + { url => abs_url($URL, '/non-existent') } ]; + + my $opts = { show_headers => 'yes' }; + + my $out_filter = sub { + $_[0] =~ s/: .*?GMT/: SOMEDAY/g; + $_[0] =~ s|Server: libwww-perl-daemon/[\w\.]*|Server: libwww-perl-daemon/NN|g; + $_[0] =~ s|User-Agent: HTTP-WebTest/[\w\.]*|User-Agent: HTTP-WebTest/NN|g; + }; + + check_webtest(webtest => $WEBTEST, + server_url => $URL, + opts => $opts, + out_filter => $out_filter, + tests => $tests, + check_file => 't/test.out/show-headers') } |