http-webtest-commits Mailing List for HTTP-WebTest (Page 22)
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-06-13 09:17:13
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv10413 Modified Files: Cookbook.pod Log Message: Minor POD fixes Index: Cookbook.pod =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Cookbook.pod,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Cookbook.pod 15 May 2002 19:29:29 -0000 1.11 --- Cookbook.pod 13 Jun 2002 09:16:58 -0000 1.12 *************** *** 107,111 **** This wtscript tests login form on http://fsck.com/rt2/. It is simular to example in section L<Check Login Form> but avoids using hardcoded ! URL for page where form is submitted to by using test parameter C<click_button>: --- 107,111 ---- This wtscript tests login form on http://fsck.com/rt2/. It is simular to example in section L<Check Login Form> but avoids using hardcoded ! URL for page where form should be submitted to by using test parameter C<click_button>: *************** *** 177,182 **** =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>. --- 177,182 ---- =head2 Dynamic Tests ! Sometimes it is required 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>. |
From: Ilya M. <m_...@us...> - 2002-06-07 08:58:32
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv22569 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Changes 15 May 2002 19:30:56 -0000 1.26 --- Changes 7 Jun 2002 08:58:28 -0000 1.27 *************** *** 14,17 **** --- 14,22 ---- HTTP::WebTest. + * Added Bundle::HTTP::WebTest file which has list of all dependanices + including optional. + + * $webtest->run_wtscript accepts wtscript passed as string. + INCOMPATIBILITIES: |
From: Ilya M. <m_...@us...> - 2002-06-07 08:57:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv22192/lib/HTTP/WebTest Modified Files: API.pm Log Message: Now $wt->run_wtscript may accept string with tests Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** API.pm 26 May 2002 20:04:22 -0000 1.12 --- API.pm 7 Jun 2002 08:57:50 -0000 1.13 *************** *** 143,147 **** } ! =head2 run_wtscript ($file, $optional_params) Reads wtscript and runs tests it defines. --- 143,147 ---- } ! =head2 run_wtscript ($wtscript, $optional_params) Reads wtscript and runs tests it defines. *************** *** 151,157 **** =over 4 ! =item * $file ! A filename of wtscript file. =item * $optional_params --- 151,160 ---- =over 4 ! =item * $wtscript ! Either a filename of wtscript file or wtscript passed as string. Very ! simple heuristic is used distinguish first from second. If ! C<$wtscript> contains either C<\n> or C<\r> it is treated like ! wtscript string. Otherwise it is filename. =item * $optional_params *************** *** 166,180 **** sub run_wtscript { my $self = shift; ! my $file = shift; my $opts_override = shift || {}; ! my $fh = new IO::File; ! $fh->open("< $file") or ! die "HTTP::WebTest: Can't open file $file: $!"; ! my $data = join '', <$fh>; ! $fh->close; ! my ($tests, $opts) = $self->parse($data); $self->run_tests($tests, { %$opts, %$opts_override }); --- 169,186 ---- sub run_wtscript { my $self = shift; ! my $wtscript = shift; my $opts_override = shift || {}; ! unless($wtscript =~ /[\r\n]/) { ! my $fh = new IO::File; ! my $file = $wtscript; ! $fh->open("< $file") or ! die "HTTP::WebTest: Can't open file $file: $!"; ! $wtscript = join '', <$fh>; ! $fh->close; ! } ! my ($tests, $opts) = $self->parse($wtscript); $self->run_tests($tests, { %$opts, %$opts_override }); |
From: Ilya M. <m_...@us...> - 2002-06-07 08:57:53
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv22192/t Modified Files: 01-api.t Log Message: Now $wt->run_wtscript may accept string with tests Index: 01-api.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/01-api.t,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** 01-api.t 21 Feb 2002 01:02:10 -0000 1.6 --- 01-api.t 7 Jun 2002 08:57:50 -0000 1.7 *************** *** 16,20 **** use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 13 } # init test --- 16,20 ---- use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 14 } # init test *************** *** 97,101 **** } ! # 12-13: test num_fail and num_succeed { my $tests = [ { url => abs_url($URL, '/test-file1') }, --- 97,123 ---- } ! # 12: run inlined wtscript ! { ! my $output = ''; ! ! $WEBTEST->run_wtscript(<<WTSCRIPT, { output_ref => \$output }); ! text_forbid = ( FAILED TEST ) ! ! test_name = Some name here ! url = ${URL}test-file1 ! regex_require = ( TEST TEST ) ! end_test ! ! test_name = Another name ! url = ${URL}no-such-file ! end_test ! WTSCRIPT ! ! canonical_output(server_url => $URL, output_ref => \$output); ! compare_output(output_ref => \$output, ! check_file => 't/test.out/run-wtscript'); ! } ! ! # 13-14: test num_fail and num_succeed { my $tests = [ { url => abs_url($URL, '/test-file1') }, |
From: Ilya M. <m_...@us...> - 2002-06-07 08:57:12
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/Bundle/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv21801/lib/Bundle/HTTP Added Files: WebTest.pm Log Message: Added --- NEW FILE: WebTest.pm --- package Bundle::HTTP::WebTest; # $Id: WebTest.pm,v 1.1 2002/06/07 08:57:09 m_ilya Exp $ $VERSION = '0.01'; =head1 NAME Bundle::HTTP::WebTest - a bundle to install HTTP::WebTest =head1 SYNOPSIS perl -MCPAN -e 'install Bundle::HTTP::WebTest' =head1 CONTENTS Algorithm::Diff - only required to run C<make test> CGI::Cookie File::Temp HTTP::Daemon LWP MIME::Base64 Net::SMTP Text::Balanced Pod::Usage Pod::Man Time::HiRes URI =head1 DESCRIPTION This bundle includes all modules required to run L<HTTP::WebTest|HTTP::WebTest> using all bundled plugins. Also it includes all modules required to run test suite for L<HTTP::WebTest|HTTP::WebTest>. =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> =cut 1; |
From: Ilya M. <m_...@us...> - 2002-06-07 08:53:21
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/Bundle/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv19809/lib/Bundle/HTTP Log Message: Directory /cvsroot/http-webtest/HTTP-WebTest/lib/Bundle/HTTP added to the repository |
From: Ilya M. <m_...@us...> - 2002-06-07 08:52:47
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/Bundle In directory usw-pr-cvs1:/tmp/cvs-serv19460/lib/Bundle Log Message: Directory /cvsroot/http-webtest/HTTP-WebTest/lib/Bundle added to the repository |
From: Ilya M. <m_...@us...> - 2002-06-06 18:30:07
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv3592/lib/HTTP/WebTest Modified Files: Parser.pm Log Message: Rewriten using regexps instead of Parser::RecDescent Index: Parser.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Parser.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Parser.pm 15 May 2002 19:25:34 -0000 1.9 --- Parser.pm 6 Jun 2002 18:30:01 -0000 1.10 *************** *** 23,213 **** use strict; - use IO::File; - use Parse::RecDescent; use Text::Balanced qw(extract_codeblock extract_delimited); ! use HTTP::WebTest::Utils; ! use vars qw(@ERRORS); ! # array where parser stores error messages ! @ERRORS = (); ! # wtscript grammar ! my $parser = new Parse::RecDescent (q{ ! file: chunk(s) eofile { [ @{$item{chunk}} ] } ! | { ! for my $error (@{$thisparser->{errors}}) { ! my ($text, $line) = @$error; ! push @HTTP::WebTest::Parser::ERRORS, ! "Line $line:$text\n"; ! } ! $thisparser->{errors} = undef; ! } ! chunk: <rulevar: $short_text> ! chunk: comment ! | test ! | param ! | <error: Test parameter or test block is expected near @{[$text =~ /(.*)/]}> ! comment: /#.*/ { [ 'comment', $item[1] ] } ! test: starttest testchunk(s) endtest ! { ! [ 'test', ! [ ! [ 'param', 'test_name', $item{starttest} ], ! @{$item{testchunk}} ! ] ! ] ! } ! testchunk: comment ! | param ! | <error: Test parameter or end of test block is expected near @{[$text =~ /(.*)/]}> ! starttest: 'test_name' '=' scalar { $item{scalar} } ! endtest: 'end_test' ! param: name '=' value { [ 'param', $item{name}, $item{value} ] } ! name : /[a-zA-Z_]+/ { $item[1] eq 'test_name' ? undef : $item[1] } ! value: '(' <commit> list ')' { $item{list} } ! | <error?: Missing right bracket> ! | scalar { $item{scalar} } ! list: listelem(s) { [ map ref($_) eq 'ARRAY' ? ! @$_ : ! $_, @{$item{listelem}} ] } - listelem: scalar '=>' scalar { [$item[1], $item[3]] } - | scalar ! scalar: <rulevar: $delim > ! scalar: /(?=')/ <commit> qscalar { $item{qscalar} } ! | <error?: Can't find string terminator "'" anywhere before EOF> ! | /(?=")/ <commit> qscalar { $item{qscalar} } ! | <error?: Can't find string terminator """ anywhere before EOF> ! | /(?=\{)/ <commit> eval ! | <error?: Missing right curly> ! | uscalar ! qscalar: <rulevar: $extracted > ! qscalar: <rulevar: $exception > ! qscalar: { $extracted = extract_delimited($text) } ! { ! my $delim = substr $extracted, 0, 1; ! my $ret; ! if($delim eq "'" or $extracted !~ /[\$\@\%]/) { ! # variable interpolation impossible - just ! # evalute string to get rid of escape chars ! $ret = HTTP::WebTest::Utils::eval_in_playground($extracted); ! } else { ! # variable interpolation possible - evaluate as ! # subroutine which will be used as callback ! $ret = HTTP::WebTest::Utils::eval_in_playground("sub { $extracted }"); ! $exception = $@; ! } ! $ret; ! } ! | <error?: Eval error\n$exception\nnear @{[$text =~ /(.*)/]}> ! uscalar: <rulevar: $word_re = qr/ (?: [^=)\s] | [^)\s] (?!>) ) /x> ! uscalar: / (?: $word_re+ [ \t]+ )* $word_re+ /xo ! eval: <rulevar: $extracted > ! eval: <rulevar: $exception > ! eval: { ! $extracted = extract_codeblock($text); ! defined $extracted ? 1 : undef; ! } ! <commit> ! { ! my $sub = HTTP::WebTest::Utils::eval_in_playground("sub { $extracted }"); ! $exception = $@; ! $sub; ! } ! | <error?: Eval error\n$exception\nnear @{[$text =~ /(.*)/]}> ! eofile: /^\Z/ ! }); ! =head2 parse ($data) ! Parses wtscript passed as scalar variable C<$data>. ! =head3 Returns ! A list of two elements - a reference on array which contains test ! objects and a reference on hash which contains test params. ! =cut ! sub parse { ! my $class = shift; ! my $content = shift; ! # reset errors ! @ERRORS = (); ! # parse data ! my $data = $parser->file($content); ! # check if we have any errors ! if(@ERRORS) { ! die "HTTP::WebTest: wtscript parsing error\n$ERRORS[0]"; ! } ! # convert parsed data to test specification ! my @data = grep $_->[0] ne 'comment', @$data; ! my @params = grep $_->[0] eq 'param', @data; ! my @tests = grep $_->[0] eq 'test', @data; ! my %params = _conv_param->(@params); ! for my $test (@tests) { ! my @test = grep $_->[0] ne 'comment', @{$$test[1]}; ! $test = { _conv_param->(@test) }; ! } ! return (\@tests, \%params); ! } ! # converts params data derived from parser wt script into param hash ! sub _conv_param { ! my @params = @_; ! my %params = (); ! my %counter = (); ! for my $param (@params) { ! my($type, $name, $value) = @$param; ! die "HTTP:::WebTest: $type is not param" ! unless $type eq 'param'; ! $counter{$name} ++; ! if($counter{$name} > 1) { ! if($counter{$name} > 2) { ! push @{$params{$name}}, $value; ! } else { ! $params{$name} = [ $params{$name}, $value ]; ! } } else { ! $params{$name} = $value; } ! } ! return %params; } --- 23,269 ---- use strict; use Text::Balanced qw(extract_codeblock extract_delimited); ! use HTTP::WebTest::Utils qw(eval_in_playground make_sub_in_playground); ! use constant ST_FILE => 0; ! use constant ST_TEST_BLOCK => 1; ! # horizontal space regexp ! my $reHS = qr/[\t ]/; ! # sequence of any chars which doesn't contain ')', space chars and '=>' ! my $reWORD = qr/(?: (?: [^=)\s] | [^)\s] (?!>) )+ )/x; ! =head2 parse ($data) ! Parses wtscript passed as scalar variable C<$data>. ! =head3 Returns ! A list of two elements - a reference on array which contains test ! objects and a reference on hash which contains test params. ! =cut ! sub parse { ! my $class = shift; ! my $data = shift; ! my($tests, $opts) = eval { _parse($data) }; ! if($@) { ! my $exc = $@; ! my $parse_pos = pos $data; ! # find reminder of string near error (without surrounding ! # whitespace) ! $data =~ /\G $reHS* (.*?) $reHS*/gcx; ! my $near = $1; ! if($near eq '') { ! $near = 'at the end of line'; ! } else { ! $near = "near '$near'"; ! } ! # count lines ! my $line_num = 1; ! pos($data) = 0; ! while($data =~ m|\G .* \Q$/\E|gcx and pos($data) <= $parse_pos) { ! $line_num ++; ! } ! die <<MSG; ! HTTP::WebTest: wtscript parsing error ! Line $line_num $near: $exc ! MSG ! } ! return ($tests, $opts); ! } ! sub _parse { ! my $state = ST_FILE; ! my $opts = {}; ! my $tests = []; ! my $test = undef; ! PARSER: ! while(1) { ! # eat whitespace ! $_[0] =~ /\G \s+/gcx; ! if($_[0] =~ /\G \#.*/gcx) { ! # found comment - just ignore it ! next; ! } ! if($state == ST_FILE) { ! if($_[0] =~ /\G \Z/gcx) { ! # end of file ! last PARSER; ! } elsif($_[0] =~ /\G test_name (?=\W)/gcx) { ! # found new test block start ! $test = {}; ! $state = ST_TEST_BLOCK; ! # find test block name ! if($_[0] =~ /\G $reHS* = $reHS* (?: \n $reHS*)?/gcx) { ! $test->{test_name} = _parse_scalar($_[0]); ! die "Test name is missing\n" ! unless defined $test->{test_name}; ! } ! } else { ! # expect global test parameter ! my($name, $value) = _parse_param($_[0]); ! if(defined $name) { ! _set_test_param($opts, $name, $value); ! } else { ! die "Global test parameter or test block is expected\n"; ! } ! } ! } elsif($state == ST_TEST_BLOCK) { ! if($_[0] =~ /\G end_test (?=\W)/gcx) { ! push @$tests, $test; ! $state = ST_FILE; ! } else { ! # expect test parameter ! my($name, $value) = _parse_param($_[0]); ! if(defined $name) { ! _set_test_param($test, $name, $value); ! } else { ! die "Test parameter or test block is expected\n"; ! } ! } ! } else { ! die "Unknown state\n"; ! } ! } ! return($tests, $opts); ! } ! sub _set_test_param { ! my $href = shift; ! my $name = shift; ! my $value = shift; ! if(exists $href->{$name}) { ! $href->{$name} = [ $href->{$name} ] ! if ref($href->{$name}) and ref($href->{$name}) eq 'ARRAY'; ! push @{$href->{$name}}, $value; ! } else { ! $href->{$name} = $value; ! } ! } ! sub _parse_param { ! my $name; ! if($_[0] =~ /\G ([a-zA-Z_]+) # param name ! $reHS* = $reHS* (?: \n $reHS*)? # = (and optional space chars) ! /gcx) { ! $name = $1; ! } else { ! return; ! } ! my $value = _parse_value($_[0]); ! return unless defined $value; ! return ($name, $value); ! } ! sub _parse_value { ! if($_[0] =~ /\G \(/gcx) { ! # list elem ! # ! # ( scalar ! # ... ! # scalar ) ! # ! # ( scalar => scalar ! # ... ! # scalar => scalar ) ! my @list = (); ! while(1) { ! # eat whitespace ! $_[0] =~ /\G \s+/gcx; ! # exit loop on closing bracket ! last if $_[0] =~ /\G \)/gcx; ! my $value = _parse_scalar($_[0]); ! die "Missing right bracket\n" ! unless defined $value; ! push @list, $value; ! if($_[0] =~ /\G $reHS* => $reHS* /gcx) { ! # handles second part of scalar => scalar syntax ! my $value = _parse_scalar($_[0]); ! die "Missing right bracket\n" ! unless defined $value; ! push @list, $value; ! } ! } ! return \@list; ! } else { ! # may return undef ! return _parse_scalar($_[0]); ! } ! } ! sub _parse_scalar { ! if($_[0] =~ /\G (['"])/x) { ! my $delim = $1; ! my($extracted) = extract_delimited($_[0]); ! die "Can't find string terminator \"$delim\"\n" ! unless defined $extracted; ! ! if($delim eq "'" or $extracted !~ /[\$\@\%]/) { ! # variable interpolation impossible - just evalute string ! # to get rid of escape chars ! my $ret = eval_in_playground($extracted); ! ! die "Eval error\n$@\n" if $@; ! ! return $ret; } else { ! # variable interpolation possible - evaluate as subroutine ! # which will be used as callback ! my $ret = make_sub_in_playground($extracted); ! die "Eval error\n$@\n" if $@; ! ! return $ret; } ! } elsif($_[0] =~ /\G {/x) { ! my($extracted) = extract_codeblock($_[0]); ! die "Missing right curly bracket\n" ! unless defined $extracted; ! my $ret = make_sub_in_playground($extracted); ! ! die "Eval error\n$@\n" if $@; ! ! return $ret; ! } else { ! $_[0] =~ /\G ((?: $reWORD+ $reHS+ )* $reWORD+ )/gcxo; ! my $extracted = $1; ! ! # may return undef ! return $extracted; ! } } |
From: Ilya M. <m_...@us...> - 2002-06-06 18:29:17
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv3355 Modified Files: Utils.pm Log Message: Added make_sub_in_playground() Index: Utils.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Utils.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Utils.pm 15 May 2002 19:24:42 -0000 1.3 --- Utils.pm 6 Jun 2002 18:29:14 -0000 1.4 *************** *** 51,55 **** @EXPORT_OK = qw(make_access_method find_port copy_dir load_package ! eval_in_playground); =head2 make_access_method($field, $optional_default_value) --- 51,55 ---- @EXPORT_OK = qw(make_access_method find_port copy_dir load_package ! eval_in_playground make_sub_in_playground); =head2 make_access_method($field, $optional_default_value) *************** *** 208,212 **** =head3 Returns ! Return value of evaluated code. =cut --- 208,212 ---- =head3 Returns ! A return value of evaluated code. =cut *************** *** 215,225 **** my $code = shift; ! my $ret = eval <<CODE; package HTTP::WebTest::PlayGround; $code CODE ! return $ret; } --- 215,242 ---- my $code = shift; ! return eval <<CODE; package HTTP::WebTest::PlayGround; + no strict; + local \$^W; # aka no warnings in new perls + $code CODE + } ! =head2 make_sub_in_playground ($code) ! ! Creates anonymous subroutine inside playground package. ! ! =head3 Returns ! ! A reference on anonymous subroutine. ! ! =cut ! ! sub make_sub_in_playground { ! my $code = shift; ! ! return eval_in_playground("sub { local \$^W; $code }"); } |
From: Ilya M. <m_...@us...> - 2002-06-06 18:27:47
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv2897/t Modified Files: simple.wt 06-parser.t Log Message: Updated tests for parser Index: simple.wt =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/simple.wt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** simple.wt 15 May 2002 19:26:26 -0000 1.7 --- simple.wt 6 Jun 2002 18:27:44 -0000 1.8 *************** *** 34,37 **** --- 34,38 ---- "more" => tests and fun abcdef 1234 => " a b c d ' e f " + "$undefined" ) auth = ( name => value ) Index: 06-parser.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/06-parser.t,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** 06-parser.t 15 May 2002 19:26:26 -0000 1.12 --- 06-parser.t 6 Jun 2002 18:27:44 -0000 1.13 *************** *** 13,19 **** require 't/utils.pl'; ! BEGIN { plan tests => 58 } ! # 1-50: check parsed wt script (which contains all variants of # supported syntax) { --- 13,19 ---- require 't/utils.pl'; ! BEGIN { plan tests => 59 } ! # 1-51: check parsed wt script (which contains all variants of # supported syntax) { *************** *** 48,52 **** ok($tests->[0]{regex_require}[10]() eq 'AAA'); ok($tests->[0]{url} eq 'www.dot.com'); ! ok(@{$tests->[0]{regex_forbid}} == 6); ok($tests->[0]{regex_forbid}[0] eq 'More = tests'); ok($tests->[0]{regex_forbid}[1] eq 'Some @#$%^&* chars'); --- 48,52 ---- ok($tests->[0]{regex_require}[10]() eq 'AAA'); ok($tests->[0]{url} eq 'www.dot.com'); ! ok(@{$tests->[0]{regex_forbid}} == 7); ok($tests->[0]{regex_forbid}[0] eq 'More = tests'); ok($tests->[0]{regex_forbid}[1] eq 'Some @#$%^&* chars'); *************** *** 55,58 **** --- 55,59 ---- ok($tests->[0]{regex_forbid}[4] eq 'abcdef 1234'); ok($tests->[0]{regex_forbid}[5] eq ' a b c d \' e f '); + ok($tests->[0]{regex_forbid}[6]() eq ''); ok($tests->[0]{ignore_case} eq 'yes'); ok($tests->[0]{show_cookies} eq 'yes'); *************** *** 86,90 **** } ! # 51-58: check error handling for borked wtscript files parse_error_check(wtscript => 't/borked1.wt', check_file => 't/test.out/borked1.err'); --- 87,91 ---- } ! # 52-59: check error handling for borked wtscript files parse_error_check(wtscript => 't/borked1.wt', check_file => 't/test.out/borked1.err'); |
From: Ilya M. <m_...@us...> - 2002-06-06 18:27:26
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv2802 Modified Files: Makefile.PL INSTALL Log Message: Updated requirements Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Makefile.PL,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.PL 12 May 2002 14:40:37 -0000 1.6 --- Makefile.PL 6 Jun 2002 18:27:17 -0000 1.7 *************** *** 26,30 **** 'MIME::Base64' => 0, 'Net::SMTP' => 0, ! 'Parse::RecDescent' => 0, 'Pod::Usage' => 0, 'Pod::Man' => 1.14, --- 26,30 ---- 'MIME::Base64' => 0, 'Net::SMTP' => 0, ! 'Text::Balanced' => 0, 'Pod::Usage' => 0, 'Pod::Man' => 1.14, *************** *** 35,38 **** --- 35,48 ---- AUTHOR => $AUTHOR, ABSTRACT => 'Run tests on remote URLs or local web files'); + + sub MY::libscan { + my $self = shift; + my $path = shift; + + # ignore backup files + return undef if $path =~ /~/; + + return $self->MY::SUPER::libscan($path); + } sub MY::dist_core { Index: INSTALL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/INSTALL,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** INSTALL 15 Feb 2002 10:42:38 -0000 1.2 --- INSTALL 6 Jun 2002 18:27:17 -0000 1.3 *************** *** 8,12 **** * libwww 5.60 or later * libnet ! * Parse::RecDescent * Pod::Usage (is included in Perl 5.6.1 and later) * Pod::Man 1.14 (is included in Perl 5.6.1 and later) --- 8,12 ---- * libwww 5.60 or later * libnet ! * Text::Balanced * Pod::Usage (is included in Perl 5.6.1 and later) * Pod::Man 1.14 (is included in Perl 5.6.1 and later) *************** *** 23,28 **** make install ! On Win32 systems you should use 'nmake' instead of make'. 'nmake.exe' ! is Windows version of Unix 'make' utility which can be downloaded from ftp.microsoft.com for free. --- 23,28 ---- make install ! On Win32 systems you should use 'nmake' instead of make'. 'nmake' is ! Windows version of Unix 'make' utility which can be downloaded from ftp.microsoft.com for free. |
From: Ilya M. <m_...@us...> - 2002-05-26 20:05:11
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv30485 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MANIFEST 12 May 2002 14:40:37 -0000 1.12 --- MANIFEST 26 May 2002 20:05:09 -0000 1.13 *************** *** 49,52 **** --- 49,53 ---- t/HelloWorld.pm t/README + t/StartTests.pm t/borked1.wt t/borked2.wt |
From: Ilya M. <m_...@us...> - 2002-05-26 20:04:54
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv30334/lib/HTTP Modified Files: WebTest.pm Log Message: Fix links Index: WebTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** WebTest.pm 15 May 2002 19:30:38 -0000 1.16 --- WebTest.pm 26 May 2002 20:04:52 -0000 1.17 *************** *** 437,473 **** =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 --- 437,473 ---- =over 4 ! =item L<HTTP::WebTest::Plugin::Apache|HTTP::WebTest::Plugin::Apache> This plugin provides support for local web file test mode. ! =item L<HTTP::WebTest::Plugin::ContentSizeTest|HTTP::WebTest::Plugin::ContentSizeTest> This plugin provides size checks of HTTP response bodies. ! =item L<HTTP::WebTest::Plugin::Cookies|HTTP::WebTest::Plugin::Cookies> This plugin provides means to control sending and recieve cookies. ! =item L<HTTP::WebTest::Plugin::DefaultReport|HTTP::WebTest::Plugin::DefaultReport> Default test report plugin. ! =item L<HTTP::WebTest::Plugin::Loader|HTTP::WebTest::Plugin::Loader> This plugin allows to load external plugin modules. ! =item L<HTTP::WebTest::Plugin::ResponseTimeTest|HTTP::WebTest::Plugin::ResponseTimeTest> This plugin provides support for response time tests. ! =item L<HTTP::WebTest::Plugin::SetRequest|HTTP::WebTest::Plugin::SetRequest> This plugin initializes test HTTP requests. ! =item L<HTTP::WebTest::Plugin::StatusTest|HTTP::WebTest::Plugin::StatusTest> This plugin checks HTTP response statuses. ! =item L<HTTP::WebTest::Plugin::TextMatchTest|HTTP::WebTest::Plugin::TextMatchTest> This plugin provides test parameters which allow to check body of HTTP *************** *** 487,504 **** =over 4 ! =item L<HTTP::WebTest::Plugin::Click> This plugin allows to use names of links and button on HTML pages to build test requests. ! =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. --- 487,504 ---- =over 4 ! =item L<HTTP::WebTest::Plugin::Click|HTTP::WebTest::Plugin::Click> This plugin allows to use names of links and button on HTML pages to build test requests. ! =item L<HTTP::WebTest::Plugin::HarnessReport|HTTP::WebTest::Plugin::HarnessReport> This report plugin can generate L<Test::Harness|Test::Harness> compatible test reports. ! =item L<HTTP::WebTest::Plugin::Hooks|HTTP::WebTest::Plugin::Hooks> This plugin allows to define callback test parameters which are ! evaluated at specific time of C<HTTP::WebTest> test run. These test parameters can define user-defined checks. *************** *** 1043,1048 **** 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. =head2 on_response --- 1043,1048 ---- Value of this test parameter is ignored. However it is evaluted ! before test request to web page is done so it is useful to do some ! initalization before the request. =head2 on_response *************** *** 1050,1059 **** I<NON-CORE PARAMETER> from L<HTTP::WebTest::Plugin::Hooks> ! 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 --- 1050,1059 ---- I<NON-CORE PARAMETER> from L<HTTP::WebTest::Plugin::Hooks> ! This is a list parameter which is treated as test result. It is ! evaluted when response for the test request is received. It can be useful to define custom tests without writting new plugins ! and/or it can be useful to run some code when response for the test ! request is received. =head3 Allowed values |
From: Ilya M. <m_...@us...> - 2002-05-26 20:04:25
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv30222/lib/HTTP/WebTest Modified Files: API.pm Log Message: Fix links Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** API.pm 17 May 2002 20:48:57 -0000 1.11 --- API.pm 26 May 2002 20:04:22 -0000 1.12 *************** *** 103,111 **** $self->_global_test_params($params); ! # start tests hook ! for my $plugin (@{$self->plugins}) { ! if($plugin->can('start_tests')) { ! $plugin->start_tests; } } --- 103,126 ---- $self->_global_test_params($params); ! # start tests hook; note that plugins can load other plugins and ! # modify $self->plugins in start tests hook ! my %initialized = (); ! while(1) { ! my $done = 1; ! ! my @plugins = @{$self->plugins}; ! for my $plugin (@plugins) { ! unless($initialized{$plugin}) { ! if($plugin->can('start_tests')) { ! $plugin->start_tests; ! } ! $initialized{$plugin} = 1; ! # we must on more round to check for uninitialized ! # plugins ! $done = 0; ! } } + + last if $done; } |
From: Ilya M. <m_...@us...> - 2002-05-26 20:03:27
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv29975/t Modified Files: 08-plugins.t Added Files: StartTests.pm Log Message: Test if start_tests hook get triggered in plugins dynimcally loaded in tests init stage --- NEW FILE: StartTests.pm --- # $Id: StartTests.pm,v 1.1 2002/05/26 20:03:16 m_ilya Exp $ package StartTests; use strict; use base qw(HTTP::WebTest::Plugin); sub start_tests { my $self = shift; $StartTests::counter ++; } 1; Index: 08-plugins.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/08-plugins.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** 08-plugins.t 24 Jan 2002 12:26:17 -0000 1.1.1.1 --- 08-plugins.t 26 May 2002 20:03:16 -0000 1.2 *************** *** 18,22 **** use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 3 } # init tests --- 18,22 ---- use vars qw($HOSTNAME $PORT $URL); ! BEGIN { plan tests => 4 } # init tests *************** *** 65,68 **** --- 65,85 ---- tests => $tests, check_file => 't/test.out/plugin-hello-counter'); + } + + # 4: test with StartTests plugin (plugin which defines start_tests + # hook) + { + # reset counter which get increased in StartTests::start_tests() + $StartTests::counter = 0; + + my $opts = { plugins => [ 'StartTests', + 'HTTP::WebTest::Plugin::Counter' ], + default_report => 'no' }; + + my $tests = [ ]; + + $WEBTEST->run_tests($tests, $opts); + + ok($StartTests::counter == 1); } |
From: Ilya M. <m_...@us...> - 2002-05-17 20:54:12
|
Update of /cvsroot/http-webtest/HTTP-WebTest/bin In directory usw-pr-cvs1:/tmp/cvs-serv12731/bin Modified Files: wt Log Message: Change output of 'wt --version' Index: wt =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/bin/wt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wt 12 May 2002 14:40:37 -0000 1.1 --- wt 17 May 2002 20:54:09 -0000 1.2 *************** *** 103,110 **** my $version = HTTP::WebTest->VERSION; print <<TEXT; ! wt version $VERSION. This program uses version $version of HTTP::WebTest. Copyright (c) 2000-2001 Richard Anderson. All rights reserved. Copyright (c) 2001,2002 Ilya Martynov. All rights reserved. TEXT exit 0; --- 103,113 ---- my $version = HTTP::WebTest->VERSION; print <<TEXT; ! wt version $VERSION. This program uses HTTP::WebTest version $version. Copyright (c) 2000-2001 Richard Anderson. All rights reserved. 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. TEXT exit 0; |
From: Ilya M. <m_...@us...> - 2002-05-17 20:49:06
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv10788/lib/HTTP Modified Files: WebTest.pm.in Log Message: Minor doc tweaks Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** WebTest.pm.in 15 May 2002 19:30:01 -0000 1.12 --- WebTest.pm.in 17 May 2002 20:48:57 -0000 1.13 *************** *** 416,452 **** =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 --- 416,452 ---- =over 4 ! =item L<HTTP::WebTest::Plugin::Apache|HTTP::WebTest::Plugin::Apache> This plugin provides support for local web file test mode. ! =item L<HTTP::WebTest::Plugin::ContentSizeTest|HTTP::WebTest::Plugin::ContentSizeTest> This plugin provides size checks of HTTP response bodies. ! =item L<HTTP::WebTest::Plugin::Cookies|HTTP::WebTest::Plugin::Cookies> This plugin provides means to control sending and recieve cookies. ! =item L<HTTP::WebTest::Plugin::DefaultReport|HTTP::WebTest::Plugin::DefaultReport> Default test report plugin. ! =item L<HTTP::WebTest::Plugin::Loader|HTTP::WebTest::Plugin::Loader> This plugin allows to load external plugin modules. ! =item L<HTTP::WebTest::Plugin::ResponseTimeTest|HTTP::WebTest::Plugin::ResponseTimeTest> This plugin provides support for response time tests. ! =item L<HTTP::WebTest::Plugin::SetRequest|HTTP::WebTest::Plugin::SetRequest> This plugin initializes test HTTP requests. ! =item L<HTTP::WebTest::Plugin::StatusTest|HTTP::WebTest::Plugin::StatusTest> This plugin checks HTTP response statuses. ! =item L<HTTP::WebTest::Plugin::TextMatchTest|HTTP::WebTest::Plugin::TextMatchTest> This plugin provides test parameters which allow to check body of HTTP *************** *** 466,483 **** =over 4 ! =item L<HTTP::WebTest::Plugin::Click> This plugin allows to use names of links and button on HTML pages to build test requests. ! =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. --- 466,483 ---- =over 4 ! =item L<HTTP::WebTest::Plugin::Click|HTTP::WebTest::Plugin::Click> This plugin allows to use names of links and button on HTML pages to build test requests. ! =item L<HTTP::WebTest::Plugin::HarnessReport|HTTP::WebTest::Plugin::HarnessReport> This report plugin can generate L<Test::Harness|Test::Harness> compatible test reports. ! =item L<HTTP::WebTest::Plugin::Hooks|HTTP::WebTest::Plugin::Hooks> This plugin allows to define callback test parameters which are ! evaluated at specific time of C<HTTP::WebTest> test run. These test parameters can define user-defined checks. |
From: Ilya M. <m_...@us...> - 2002-05-17 20:49:06
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv10788/lib/HTTP/WebTest/Plugin Modified Files: Hooks.pm Log Message: Minor doc tweaks Index: Hooks.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Hooks.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Hooks.pm 15 May 2002 19:27:53 -0000 1.6 --- Hooks.pm 17 May 2002 20:48:57 -0000 1.7 *************** *** 32,39 **** 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 --- 32,39 ---- This plugin module adds test parameters which values are evaluated at ! specific time of L<HTTP::WebTest|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 *************** *** 51,65 **** 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. =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 --- 51,65 ---- Value of this test parameter is ignored. However it is evaluted ! before test request to web page is done so it is useful to do some ! initalization before the request. =head2 on_response ! This is a list parameter which is treated as test result. It is ! evaluted when response for the test request is received. It can be useful to define custom tests without writting new plugins ! and/or it can be useful to run some code when response for the test ! request is received. =head3 Allowed values |
From: Ilya M. <m_...@us...> - 2002-05-17 20:49:05
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv10788/lib/HTTP/WebTest Modified Files: API.pm Log Message: Minor doc tweaks Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** API.pm 12 May 2002 13:35:35 -0000 1.10 --- API.pm 17 May 2002 20:48:57 -0000 1.11 *************** *** 335,339 **** =head3 Returns ! A new L<LWP::UserAgent> object initialized with default settings. =cut --- 335,339 ---- =head3 Returns ! A new L<LWP::UserAgent|LWP::UserAgent> object initialized with default settings. =cut |
From: Ilya M. <m_...@us...> - 2002-05-15 19:30:59
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv9147 Modified Files: Changes Log Message: Updated Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Changes 12 May 2002 14:17:39 -0000 1.25 --- Changes 15 May 2002 19:30:56 -0000 1.26 *************** *** 7,10 **** --- 7,22 ---- Revision history for Perl module HTTP::WebTest. + Current version + + ENHANCEMENTS: + + * Non-core test parameters are included in POD documentation of + HTTP::WebTest. + + INCOMPATIBILITIES: + + * Changed syntax of wtscript files. Parser of wtscript files expands + Perl variables in double quoted strings. + 1.99_06 Sun May 12 2002 *************** *** 12,17 **** * New core test parameter 'http_headers'. Allows to add additional ! HTTP headers to HTTP request or override default HTTP headers in HTTP ! request. Thanks to Duncan Cameron for patch. * New plugin HTTP::WebTest::Plugin::Click. This plugin allows to use --- 24,29 ---- * New core test parameter 'http_headers'. Allows to add additional ! HTTP headers to HTTP request or to override default HTTP headers in ! HTTP request. Thanks to Duncan Cameron for patch. * New plugin HTTP::WebTest::Plugin::Click. This plugin allows to use *************** *** 20,26 **** BUG FIXES: ! * Set Content-type to 'application/x-www-form-urlencoded' for ! POST. Fixed for second time. Apparently code to do this was lost ! during HTTP-WebTest rewrite. Thanks to Duncan Cameron for patch. 1.99_05 Mon Apr 8 2002 --- 32,38 ---- BUG FIXES: ! * Set Content-type to 'application/x-www-form-urlencoded' for POST. ! Fixed for second time. Apparently code to do this was lost during ! HTTP-WebTest rewrite. Thanks to Duncan Cameron for patch. 1.99_05 Mon Apr 8 2002 *************** *** 65,69 **** support of embeded Perl in wtscript files. ! * Changed format of wtscript files. Speaking more precisely rules for test parameters value quoting have been changed to be more Perl alike. It means that value of param should be written either as --- 77,81 ---- support of embeded Perl in wtscript files. ! * Changed syntax of wtscript files. Speaking more precisely rules for test parameters value quoting have been changed to be more Perl alike. It means that value of param should be written either as |
From: Ilya M. <m_...@us...> - 2002-05-15 19:30:41
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv9021/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.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** WebTest.pm 12 May 2002 14:55:36 -0000 1.15 --- WebTest.pm 15 May 2002 19:30:38 -0000 1.16 *************** *** 273,281 **** ) ! 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. Also it is possible to specify Perl code instead of scalar, instead of --- 273,285 ---- ) ! 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. Double quoted strings can also contain Perl ! variables to be expanded: "$var" is string which contains value of ! Perl variable C<$var>. Perl variables can be defined by plugin ! modules or in code sections described below. Also it is possible to specify Perl code instead of scalar, instead of *************** *** 501,505 **** =back ! See documentation on these modules for more information. =head2 Writting Plugin Modules --- 505,510 ---- =back ! Information about test parameters supported by add-on plugin modules ! is summarized below in section L<TEST PARAMETERS|TEST PARAMETERS>. =head2 Writting Plugin Modules *************** *** 520,523 **** --- 525,532 ---- and it cannot be overriden in test blocks. + Parameters marked as I<NON-CORE PARAMETER> are defined in add-on + plugin modules which must be loaded explicitly using test parameter + C<plugins>. + =head2 accept_cookies *************** *** 611,614 **** --- 620,650 ---- for web page access authorization. + =head2 click_button + + I<NON-CORE PARAMETER> from L<HTTP::WebTest::Plugin::Click> + + Given name of submit button (i.e. C<<input type="submit"E<gt>> tag + inside of C<<formE<gt>> tag) on previosly requested HTML page builds + test request to the submitted page. + + Note that you still need to pass all form parameters yourself using + C<params> test parameter. + + =head3 Example + + See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. + + =head2 click_link + + I<NON-CORE PARAMETER> from L<HTTP::WebTest::Plugin::Click> + + Given name of link (i.e. C<<aE<gt>> tag) on previosly requested HTML + page builds test request to the linked page. + + =head3 Example + + See example in L<HTTP::WebTest::Cookbook|HTTP::WebTest::Cookbook>. + + =head2 cookie *************** *** 1002,1005 **** --- 1038,1076 ---- Any number less than C<max_rtime> (if C<max_rtime> is specified). + =head2 on_request + + I<NON-CORE PARAMETER> from L<HTTP::WebTest::Plugin::Hooks> + + 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. + + =head2 on_response + + I<NON-CORE PARAMETER> from L<HTTP::WebTest::Plugin::Hooks> + + 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 *************** *** 1047,1055 **** C<::> prepends it with C<HTTP::WebTest::Plugin>. So ! plugins = ( ::ValidateHTML ) is equal to ! plugins = ( HTTP::WebTest::Plugin::ValidateHTML ) --- 1118,1126 ---- C<::> prepends it with C<HTTP::WebTest::Plugin>. So ! plugins = ( ::Click ) is equal to ! plugins = ( HTTP::WebTest::Plugin::Click ) |
From: Ilya M. <m_...@us...> - 2002-05-15 19:30:04
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv8750/lib/HTTP Modified Files: WebTest.pm.in Log Message: Minor doc tweaks Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** WebTest.pm.in 12 May 2002 14:11:34 -0000 1.11 --- WebTest.pm.in 15 May 2002 19:30:01 -0000 1.12 *************** *** 252,260 **** ) ! 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. Also it is possible to specify Perl code instead of scalar, instead of --- 252,264 ---- ) ! 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. Double quoted strings can also contain Perl ! variables to be expanded: "$var" is string which contains value of ! Perl variable C<$var>. Perl variables can be defined by plugin ! modules or in code sections described below. Also it is possible to specify Perl code instead of scalar, instead of *************** *** 480,484 **** =back ! See documentation on these modules for more information. =head2 Writting Plugin Modules --- 484,489 ---- =back ! Information about test parameters supported by add-on plugin modules ! is summarized below in section L<TEST PARAMETERS|TEST PARAMETERS>. =head2 Writting Plugin Modules *************** *** 498,501 **** --- 503,510 ---- Parameters marked as I<GLOBAL PARAMETER> can be used only as global and it cannot be overriden in test blocks. + + Parameters marked as I<NON-CORE PARAMETER> are defined in add-on + plugin modules which must be loaded explicitly using test parameter + C<plugins>. =for pod_merge replace params |
From: Ilya M. <m_...@us...> - 2002-05-15 19:29:31
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv8608/lib/HTTP/WebTest Modified Files: Cookbook.pod Log Message: Minor doc tweaks Index: Cookbook.pod =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Cookbook.pod,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Cookbook.pod 12 May 2002 13:35:35 -0000 1.10 --- Cookbook.pod 15 May 2002 19:29:29 -0000 1.11 *************** *** 215,219 **** # request to this URL with parameter 'id' deletes record url = http://some.server/delete-record ! params = ( id => { $ID } ) end_test --- 215,219 ---- # request to this URL with parameter 'id' deletes record url = http://some.server/delete-record ! params = ( id => "$ID" ) end_test |
From: Ilya M. <m_...@us...> - 2002-05-15 19:27:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv7977/lib/HTTP/WebTest/Plugin Modified Files: Loader.pm Hooks.pm Click.pm Log Message: Added hints for POD doc generator pod_merge.PL Index: Loader.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Loader.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Loader.pm 12 May 2002 13:35:35 -0000 1.3 --- Loader.pm 15 May 2002 19:27:53 -0000 1.4 *************** *** 36,44 **** C<::> prepends it with C<HTTP::WebTest::Plugin>. So ! plugins = ( ::ValidateHTML ) is equal to ! plugins = ( HTTP::WebTest::Plugin::ValidateHTML ) =cut --- 36,44 ---- C<::> prepends it with C<HTTP::WebTest::Plugin>. So ! plugins = ( ::Click ) is equal to ! plugins = ( HTTP::WebTest::Plugin::Click ) =cut Index: Hooks.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Hooks.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Hooks.pm 12 May 2002 13:35:35 -0000 1.5 --- Hooks.pm 15 May 2002 19:27:53 -0000 1.6 *************** *** 46,49 **** --- 46,51 ---- =head1 TEST PARAMETERS + =for pod_merge copy opt_params + =head2 on_request Index: Click.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Click.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Click.pm 12 May 2002 14:42:07 -0000 1.8 --- Click.pm 15 May 2002 19:27:53 -0000 1.9 *************** *** 34,37 **** --- 34,39 ---- =head1 TEST PARAMETERS + =for pod_merge copy opt_params + =head2 click_button |
From: Ilya M. <m_...@us...> - 2002-05-15 19:27:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest/scripts In directory usw-pr-cvs1:/tmp/cvs-serv7800/scripts Modified Files: pod_merge.PL Log Message: Include non-core params into HTTP::WebTest POD doc Index: pod_merge.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/scripts/pod_merge.PL,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** pod_merge.PL 24 Jan 2002 12:26:38 -0000 1.1.1.1 --- pod_merge.PL 15 May 2002 19:27:16 -0000 1.2 *************** *** 55,59 **** $sections{params} = ''; for my $plugin (@plugins) { ! $sections{params} .= file_scan($plugin, 'params'); } --- 55,62 ---- $sections{params} = ''; for my $plugin (@plugins) { ! my $core_params = file_scan($plugin, 'params'); ! my $opt_params = mark_non_core(file_scan($plugin, 'opt_params')); ! $sections{params} .= $core_params; ! $sections{params} .= $opt_params; } *************** *** 86,92 **** my $regex = section_copy_re($type); ! my @sections = $data =~ /$regex/g; ! return join '', @sections; } --- 89,97 ---- my $regex = section_copy_re($type); ! my $section = join '', $data =~ /$regex/g; ! my($package) = $data =~ /package \s+ ( \w+ (?: :: \w+)* )/gx; ! ! return wantarray ? ($section, $package) : $section; } *************** *** 104,109 **** } ! # returns regexp used to replace everthing between =for pod_merge ! # replace and =cut sub section_replace_re { my $type = shift; --- 109,114 ---- } ! # returns regexp which can be used to replace everthing between =for ! # pod_merge replace and =cut sub section_replace_re { my $type = shift; *************** *** 115,117 **** --- 120,132 ---- return $regex; + } + + # adds NON-CORE PARAMETER line to parameter definition + sub mark_non_core { + my $sec = shift; + my $package = shift; + $sec =~ s/(?<= \n) + (=head2 \s+ \w+ \s*? \n) + /$1\nI<NON-CORE PARAMETER> from L<$package>\n/gsx; + return $sec; } |