http-webtest-commits Mailing List for HTTP-WebTest (Page 25)
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-04-08 16:38:20
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv23042/lib/HTTP Modified Files: WebTest.pm.in WebTest.pm Log Message: Bump version Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WebTest.pm.in 8 Apr 2002 06:30:27 -0000 1.7 --- WebTest.pm.in 8 Apr 2002 07:35:39 -0000 1.8 *************** *** 5,9 **** package HTTP::WebTest; ! $VERSION = '1.99_04'; # workaround for warning caused by underscore char in $VERSION $VERSION = eval $VERSION; --- 5,9 ---- package HTTP::WebTest; ! $VERSION = '1.99_05'; # workaround for warning caused by underscore char in $VERSION $VERSION = eval $VERSION; Index: WebTest.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** WebTest.pm 8 Apr 2002 06:30:27 -0000 1.9 --- WebTest.pm 8 Apr 2002 07:35:40 -0000 1.10 *************** *** 26,30 **** package HTTP::WebTest; ! $VERSION = '1.99_04'; # workaround for warning caused by underscore char in $VERSION $VERSION = eval $VERSION; --- 26,30 ---- package HTTP::WebTest; ! $VERSION = '1.99_05'; # workaround for warning caused by underscore char in $VERSION $VERSION = eval $VERSION; |
From: Ilya M. <m_...@us...> - 2002-04-08 15:38:15
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv22794 Modified Files: MANIFEST Log Message: Remove until Click plugin from distro until it is finished Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MANIFEST 21 Feb 2002 01:48:52 -0000 1.7 --- MANIFEST 8 Apr 2002 07:34:15 -0000 1.8 *************** *** 17,21 **** lib/HTTP/WebTest/Plugin.pm lib/HTTP/WebTest/Plugin/Apache.pm - lib/HTTP/WebTest/Plugin/Click.pm lib/HTTP/WebTest/Plugin/ContentSizeTest.pm lib/HTTP/WebTest/Plugin/Cookies.pm --- 17,20 ---- *************** *** 45,49 **** t/08-plugins.t t/09-hooks.t - t/10-click.t t/HTTP/WebTest/Plugin/Counter.pm t/HelloWorld.pm --- 44,47 ---- *************** *** 79,83 **** t/test.out/borked7.err t/test.out/borked8.err - t/test.out/click_link1 t/test.out/cookie1 t/test.out/cookie2 --- 77,80 ---- *************** *** 107,111 **** t/test.out/subparam1 t/test.out/subparam2 ! t/test.out/test-harness t/test.out/test_name t/test.out/text_match1 --- 104,109 ---- t/test.out/subparam1 t/test.out/subparam2 ! t/test.out/test-harness-not-ok ! t/test.out/test-harness-ok t/test.out/test_name t/test.out/text_match1 |
From: Ilya M. <m_...@us...> - 2002-04-08 15:00:08
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv11282/t/test.out Added Files: test-harness-ok test-harness-not-ok Removed Files: test-harness Log Message: Added more tests and fixed old tests for HarnessReport plugin --- NEW FILE: test-harness-ok --- 1..2 # URL: http://http.web.test/test-file1 # STATUS CODE CHECK # 200 OK: SUCCEED # REQUIRED TEXT # 987654: SUCCEED ok # URL: http://http.web.test/test-file1 # STATUS CODE CHECK # 200 OK: SUCCEED # REQUIRED TEXT # 987654: SUCCEED ok --- NEW FILE: test-harness-not-ok --- 1..3 # URL: http://http.web.test/test-file1 # STATUS CODE CHECK # 200 OK: SUCCEED # REQUIRED TEXT # 987654: SUCCEED ok # URL: http://http.web.test/non-existent # STATUS CODE CHECK # 404 Not Found: FAIL not ok # URL: http://http.web.test/non-existent # Test Name: BlaBla # STATUS CODE CHECK # 404 Not Found: FAIL not ok --- test-harness DELETED --- |
From: Ilya M. <m_...@us...> - 2002-04-08 15:00:08
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv11282/t Modified Files: 05-report.t Log Message: Added more tests and fixed old tests for HarnessReport plugin Index: 05-report.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/05-report.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 05-report.t 12 Feb 2002 12:47:35 -0000 1.2 --- 05-report.t 8 Apr 2002 06:52:00 -0000 1.3 *************** *** 19,23 **** use vars qw($HOSTNAME $PORT $URL $TEST); ! BEGIN { plan tests => 11 } # init tests --- 19,23 ---- use vars qw($HOSTNAME $PORT $URL $TEST); ! BEGIN { plan tests => 12 } # init tests *************** *** 140,144 **** } ! # 10: test HTTP::WebTest::Plugin::HarnessReport plugin { my $tests = [ $TEST, --- 140,145 ---- } ! # 10: test HTTP::WebTest::Plugin::HarnessReport plugin (with some ! # tests failing) { my $tests = [ $TEST, *************** *** 155,162 **** opts => $opts, 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 --- 156,178 ---- opts => $opts, tests => $tests, ! check_file => 't/test.out/test-harness-not-ok') } ! # 11: test HTTP::WebTest::Plugin::HarnessReport plugin (with all tests ! # passing) ! { ! my $tests = [ $TEST, $TEST ]; ! ! my $opts = { plugins => [ '::HarnessReport' ], ! default_report => 'no' }; ! ! check_webtest(webtest => $WEBTEST, ! server_url => $URL, ! opts => $opts, ! tests => $tests, ! check_file => 't/test.out/test-harness-ok') ! } ! ! # 12: test show_headers parameter { # remove cookies from cookie jar - it affects output of report plugin |
From: Ilya M. <m_...@us...> - 2002-04-07 16:08:04
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv9755/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.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WebTest.pm 17 Feb 2002 10:50:08 -0000 1.7 --- WebTest.pm 7 Apr 2002 16:02:27 -0000 1.8 *************** *** 26,29 **** --- 26,31 ---- $VERSION = '1.99_04'; + # workaround for warning caused by underscore char in $VERSION + $VERSION = eval $VERSION; # actual content of HTTP::WebTest package is in HTTP::WebTest::API |
From: Ilya M. <m_...@us...> - 2002-04-07 16:05:59
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv10429/t/test.out Modified Files: user_agent Log Message: Minor fix Index: user_agent =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/test.out/user_agent,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** user_agent 12 Feb 2002 13:09:18 -0000 1.2 --- user_agent 7 Apr 2002 16:05:56 -0000 1.3 *************** *** 9,13 **** 200 OK SUCCEED REQUIRED TEXT ! User agent: HTTP-WebTest/NN SUCCEED --- 9,13 ---- 200 OK SUCCEED REQUIRED TEXT ! User agent: HTTP-WebTest/NN SUCCEED |
From: Ilya M. <m_...@us...> - 2002-03-25 19:52:32
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv8978 Modified Files: Changes Log Message: *** empty log message *** Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Changes 24 Mar 2002 12:40:10 -0000 1.17 --- Changes 25 Mar 2002 19:52:29 -0000 1.18 *************** *** 11,16 **** BUG FIXES: ! * Fixed bug in HTTP::WebTest::Plugin::check_list. Thanx to Duncan ! Cameron for patch. 1.99_04 Sun Feb 17 2002 --- 11,16 ---- BUG FIXES: ! * Fixed bug in HTTP::WebTest::Plugin::check_list. It affected test ! parameter 'mail_addresses'. Thanks to Duncan Cameron for patch. 1.99_04 Sun Feb 17 2002 |
From: Ilya M. <m_...@us...> - 2002-03-24 12:40:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv17025 Modified Files: Changes Log Message: *** empty log message *** Index: Changes =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Changes,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Changes 17 Feb 2002 10:57:03 -0000 1.16 --- Changes 24 Mar 2002 12:40:10 -0000 1.17 *************** *** 7,10 **** --- 7,17 ---- Revision history for Perl module HTTP::WebTest. + Current Version + + BUG FIXES: + + * Fixed bug in HTTP::WebTest::Plugin::check_list. Thanx to Duncan + Cameron for patch. + 1.99_04 Sun Feb 17 2002 |
From: Ilya M. <m_...@us...> - 2002-03-24 12:11:28
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv8285 Modified Files: Plugin.pm Log Message: Fixed typo (thanx to Duncan Cameron) for patch Index: Plugin.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Plugin.pm 16 Feb 2002 00:36:35 -0000 1.8 --- Plugin.pm 24 Mar 2002 12:11:18 -0000 1.9 *************** *** 324,328 **** type. ! This is NOOP operation. =cut --- 324,328 ---- type. ! This is NOOP operation. It always succeed. =cut *************** *** 392,396 **** } ! shift @spec if defined $spec[1] and $spec[1] eq '...'; die "HTTP::WebTest: too few elements in list parameter '$param'" --- 392,396 ---- } ! shift @spec if defined $spec[0] and $spec[0] eq '...'; die "HTTP::WebTest: too few elements in list parameter '$param'" |
From: Ilya M. <m_...@us...> - 2002-03-24 11:02:32
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv27779/lib/HTTP/WebTest/Plugin Modified Files: Click.pm Log Message: Added method find_base Index: Click.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/Click.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Click.pm 21 Feb 2002 01:43:35 -0000 1.1 --- Click.pm 24 Mar 2002 11:02:26 -0000 1.2 *************** *** 62,92 **** if(defined $link) { ! my $content = $response->content; ! my $base = $response->base; ! my $link = $self->find_link(base => $base, ! content_ref => \$content, pattern => $link); $request->uri($link) if defined $link; } } sub find_link { my $self = shift; my %param = @_; ! my $base = $param{base}; ! my $content_ref = $param{content_ref}; ! my $pattern = $param{pattern}; ! # look for matching link and base tag ! my $parser = HTML::TokeParser->new($content_ref); my $link = undef; ! while(my $token = $parser->get_tag(qw(a base))) { my $uri = $token->[1]{href}; next unless defined $uri; ! if($token->[0] eq 'base') { ! $base = $uri; ! } elsif($token->[0] eq 'a') { my $text = $parser->get_trimmed_text('/a'); if($text =~ /$pattern/i) { --- 62,113 ---- if(defined $link) { ! my $link = $self->find_link(response => $response, pattern => $link); $request->uri($link) if defined $link; + } elsif(defined $button) { + my $base = $self->find_base($request); + # find form and button name + my($form, $name) = $self->find_form(); } } + sub find_base { + my $self = shift; + my $response = shift; + + my $base = $response->base; + my $content = $response->content; + + # look for base tag inside head tag + my $parser = HTML::TokeParser->new(\$content); + my $token = $parser->get_tag('head'); + if(defined $token) { + $token = $parser->get_tag('base', '/head'); + if($token->[0] eq 'base') { + $base = $token->[1]{href}; + } + } + + return $base; + } + sub find_link { my $self = shift; my %param = @_; ! my $response = $param{response}; ! my $pattern = $param{pattern}; ! my $base = $self->find_base($response); ! my $content = $response->content; ! ! # look for matching link tag ! my $parser = HTML::TokeParser->new(\$content); my $link = undef; ! while(my $token = $parser->get_tag('a')) { my $uri = $token->[1]{href}; next unless defined $uri; ! if($token->[0] eq 'a') { my $text = $parser->get_trimmed_text('/a'); if($text =~ /$pattern/i) { |
From: Ilya M. <m_...@us...> - 2002-03-24 11:02:08
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv27325/t Modified Files: 10-click.t Log Message: Updated Index: 10-click.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/10-click.t,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 10-click.t 21 Feb 2002 01:43:35 -0000 1.1 --- 10-click.t 24 Mar 2002 11:00:27 -0000 1.2 *************** *** 48,51 **** --- 48,66 ---- } + # 2: test that click_link doesn't work with text files + { + my $tests = [ { url => abs_url($URL, '/test3.txt'), + text_require => [ '<a href="test2.html">Test 2</a>' ] }, + { click_link => 'Test 2', + text_forbid => [ '<title>Test File 2</title>' ] }, + ]; + + catch_webtest(webtest => $WEBTEST, + server_url => $URL, + tests => $tests, + opts => $OPTS, + check_file => 't/test.out/click_link2'); + } + # try to stop server even we have been crashed END { stop_webserver($PID) if defined $PID } *************** *** 70,73 **** --- 85,117 ---- } else { $connect->send_error(RC_NOT_FOUND); + } + } + + # run test inside eval and test for raised exception + sub catch_webtest { + my %param = @_; + + my $webtest = $param{webtest}; + my $tests = $param{tests}; + my $opts = $param{opts}; + my $check_file = $param{check_file}; + + my $output = ''; + + eval { + $webtest->run_tests($tests, { %$opts, output_ref => \$output }); + }; + if($@) { + my $text = $@; + my $out_filter = sub { + $_[0] =~ s/line \d+/line NN/; + }; + canonical_output(output_ref => \$text, + out_filter => $out_filter); + compare_output(check_file => $check_file, + output_ref => \$text); + } else { + # no exception - test have failed + ok(0); } } |
From: Ilya M. <m_...@us...> - 2002-03-24 11:01:39
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv27569/lib/HTTP/WebTest Modified Files: API.pm Log Message: Throw exception if request url is not set Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** API.pm 4 Mar 2002 14:59:19 -0000 1.8 --- API.pm 24 Mar 2002 11:01:36 -0000 1.9 *************** *** 517,523 **** $self->_global_test_params($params); ! # create request (note that actual url is more likely to be # set in plugins) ! my $request = HTTP::Request->new('GET' => 'http://localhost/'); $self->last_request($request); --- 517,523 ---- $self->_global_test_params($params); ! # create request (note that actual uri is more likely to be # set in plugins) ! my $request = HTTP::Request->new('GET' => 'http://MISSING_HOSTNAME/'); $self->last_request($request); *************** *** 527,530 **** --- 527,535 ---- $plugin->prepare_request; } + } + + # check if one of plugins did change request uri + if($request->uri eq 'http://MISSING_HOSTNAME/') { + die "HTTP::WebTest: request uri is not set"; } |
From: Ilya M. <m_...@us...> - 2002-03-24 11:01:31
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv27472/t/test.out Added Files: click_link2 Log Message: Added --- NEW FILE: click_link2 --- HTTP::WebTest: request uri is not set at lib/HTTP/WebTest/API.pm line NN. |
From: Ilya M. <m_...@us...> - 2002-03-22 07:43:23
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP In directory usw-pr-cvs1:/tmp/cvs-serv5251 Modified Files: WebTest.pm.in Log Message: Added workaround for warning caused by underscore char in $VERSION Index: WebTest.pm.in =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest.pm.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WebTest.pm.in 17 Feb 2002 10:48:51 -0000 1.5 --- WebTest.pm.in 22 Mar 2002 07:43:15 -0000 1.6 *************** *** 6,9 **** --- 6,11 ---- $VERSION = '1.99_04'; + # workaround for warning caused by underscore char in $VERSION + $VERSION = eval $VERSION; # actual content of HTTP::WebTest package is in HTTP::WebTest::API |
From: Ilya M. <m_...@us...> - 2002-03-04 14:59:24
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv16529 Modified Files: API.pm Log Message: Fix typo (again) Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** API.pm 4 Mar 2002 14:58:52 -0000 1.7 --- API.pm 4 Mar 2002 14:59:19 -0000 1.8 *************** *** 256,260 **** =head3 Example ! $webtest->run_tests($wt->parse($data)); =cut --- 256,260 ---- =head3 Example ! $webtest->run_tests($webtest->parse($data)); =cut |
From: Ilya M. <m_...@us...> - 2002-03-04 14:58:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv16355 Modified Files: API.pm Log Message: Fix typo Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** API.pm 20 Feb 2002 21:32:31 -0000 1.6 --- API.pm 4 Mar 2002 14:58:52 -0000 1.7 *************** *** 256,260 **** =head3 Example ! $webtest->run_tests($parse->parse($data)); =cut --- 256,260 ---- =head3 Example ! $webtest->run_tests($wt->parse($data)); =cut |
From: Ilya M. <m_...@us...> - 2002-02-21 01:48:56
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv27298 Modified Files: MANIFEST Log Message: Updated Index: MANIFEST =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MANIFEST 15 Feb 2002 14:57:45 -0000 1.6 --- MANIFEST 21 Feb 2002 01:48:52 -0000 1.7 *************** *** 17,20 **** --- 17,21 ---- lib/HTTP/WebTest/Plugin.pm lib/HTTP/WebTest/Plugin/Apache.pm + lib/HTTP/WebTest/Plugin/Click.pm lib/HTTP/WebTest/Plugin/ContentSizeTest.pm lib/HTTP/WebTest/Plugin/Cookies.pm *************** *** 44,47 **** --- 45,49 ---- t/08-plugins.t t/09-hooks.t + t/10-click.t t/HTTP/WebTest/Plugin/Counter.pm t/HelloWorld.pm *************** *** 77,80 **** --- 79,83 ---- t/test.out/borked7.err t/test.out/borked8.err + t/test.out/click_link1 t/test.out/cookie1 t/test.out/cookie2 *************** *** 111,115 **** --- 114,121 ---- t/test.out/user_agent t/test.shtml + t/test1.html t/test1.txt + t/test2.html.in t/test2.txt + t/test3.txt t/utils.pl |
From: Ilya M. <m_...@us...> - 2002-02-21 01:43:38
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv25857/t Added Files: test3.txt test2.html.in test1.html 10-click.t Log Message: Added --- NEW FILE: test3.txt --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test File 1</title> </head> <body> <a href="test2.html">Test 2</a> </body> </html> --- NEW FILE: test2.html.in --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test File 2</title> <base href="<<SERVER_URL>>dir/" /> </head> <a href="alttest1.txt">Text File</a> <body> </body> </html> --- NEW FILE: test1.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test File 1</title> </head> <body> <a href="">Self Reference</a> <a href="test2.html">Test 2</a> </body> </html> --- NEW FILE: 10-click.t --- #!/usr/bin/perl -w # $Id: 10-click.t,v 1.1 2002/02/21 01:43:35 m_ilya Exp $ # This script tests HTTP::WebTest::Plugin::Click plugin use strict; use HTTP::Status; use Test; use HTTP::WebTest; require 't/config.pl'; require 't/utils.pl'; use vars qw($HOSTNAME $PORT $URL $TEST); BEGIN { plan tests => 1 } # init tests my $PID = start_webserver(port => $PORT, server_sub => \&server_sub); my $WEBTEST = HTTP::WebTest->new; my $OPTS = { plugins => [ '::Click' ] }; # 1: test following links in HTML files { generate_testfile(file => 't/test2.html', server_url => $URL); my $tests = [ { url => abs_url($URL, '/test1.html'), text_require => [ '<title>Test File 1</title>' ] }, # link which points back to test1.html { click_link => 'Self Reference', text_require => [ '<title>Test File 1</title>' ] }, # link to test2.html { click_link => 'Test 2', text_require => [ '<title>Test File 2</title>' ] }, # link on text file from test2.html (note that it # has <base> tag) { click_link => 'Text File', text_require => [ 'TEST TEST' ] } ]; check_webtest(webtest => $WEBTEST, server_url => $URL, tests => $tests, opts => $OPTS, check_file => 't/test.out/click_link1'); } # try to stop server even we have been crashed END { stop_webserver($PID) if defined $PID } # 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 =~ m(/test1.txt|/dir/alttest1.txt)) { $connect->send_file_response('t/test1.txt'); } elsif($path eq '/test3.txt') { $connect->send_file_response('t/test3.txt'); } elsif($path eq '/test1.html' ) { $connect->send_file_response('t/test1.html'); } elsif($path eq '/test2.html' ) { $connect->send_file_response('t/test2.html'); } else { $connect->send_error(RC_NOT_FOUND); } } |
From: Ilya M. <m_...@us...> - 2002-02-21 01:43:38
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin In directory usw-pr-cvs1:/tmp/cvs-serv25857/lib/HTTP/WebTest/Plugin Added Files: Click.pm Log Message: Added --- NEW FILE: Click.pm --- # $Id: Click.pm,v 1.1 2002/02/21 01:43:35 m_ilya Exp $ package HTTP::WebTest::Plugin::Click; =head1 NAME HTTP::WebTest::Plugin::Click - Click buttons and links on web page =head1 SYNOPSIS Not Applicable =head1 DESCRIPTION =cut use strict; use HTML::TokeParser; use URI; use base qw(HTTP::WebTest::Plugin); =head1 TEST PARAMETERS =for pod_merge copy params =head2 click_button =head2 click_link =cut sub param_types { return q(click_button scalar click_link scalar); } sub prepare_request { my $self = shift; $self->validate_params(qw(click_button click_link)); # get current request object my $request = $self->webtest->last_request; # get number of previous test if any my $prev_test_num = $self->webtest->last_test_num - 1; return if $prev_test_num < 0; # get previous response object my $response = $self->webtest->tests->[$prev_test_num]->response; # no response - nothing to do return unless defined $response; # do nothing unless it is HTML return unless $response->content_type eq 'text/html'; # get various params we handle my $button = $self->test_param('click_button'); my $link = $self->test_param('click_link'); if(defined $link) { my $content = $response->content; my $base = $response->base; my $link = $self->find_link(base => $base, content_ref => \$content, pattern => $link); $request->uri($link) if defined $link; } } sub find_link { my $self = shift; my %param = @_; my $base = $param{base}; my $content_ref = $param{content_ref}; my $pattern = $param{pattern}; # look for matching link and base tag my $parser = HTML::TokeParser->new($content_ref); my $link = undef; while(my $token = $parser->get_tag(qw(a base))) { my $uri = $token->[1]{href}; next unless defined $uri; if($token->[0] eq 'base') { $base = $uri; } elsif($token->[0] eq 'a') { my $text = $parser->get_trimmed_text('/a'); if($text =~ /$pattern/i) { $link = $uri; last; } } } # we haven't found anything return undef unless defined $link; # return link return URI->new_abs($link, $base); } =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-21 01:43:38
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t/test.out In directory usw-pr-cvs1:/tmp/cvs-serv25857/t/test.out Added Files: click_link1 Log Message: Added --- NEW FILE: click_link1 --- Failed Succeeded Test Name 0 2 *** no name *** 0 2 *** no name *** 0 2 *** no name *** 0 2 *** no name *** URL: http://http.web.test/test1.html STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT <title>Test File 1</title> SUCCEED URL: http://http.web.test/test1.html STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT <title>Test File 1</title> SUCCEED URL: http://http.web.test/test2.html STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT <title>Test File 2</title> SUCCEED URL: http://http.web.test/dir/alttest1.txt STATUS CODE CHECK 200 OK SUCCEED REQUIRED TEXT TEST TEST SUCCEED Total web tests failed: 0 succeeded: 8 |
From: Ilya M. <m_...@us...> - 2002-02-21 01:43:11
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv25680 Modified Files: MANIFEST.SKIP Log Message: Updated Index: MANIFEST.SKIP =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/MANIFEST.SKIP,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MANIFEST.SKIP 24 Jan 2002 12:26:02 -0000 1.1.1.1 --- MANIFEST.SKIP 21 Feb 2002 01:43:04 -0000 1.2 *************** *** 15,17 **** --- 15,18 ---- t/real.wt$ t/good.wt$ + t/test2.html$ bin/wt$ |
From: Ilya M. <m_...@us...> - 2002-02-21 01:43:11
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv25680/t Modified Files: .cvsignore Log Message: Updated Index: .cvsignore =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 24 Jan 2002 12:26:11 -0000 1.1.1.1 --- .cvsignore 21 Feb 2002 01:43:04 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- real.wt good.wt + test2.html |
From: Ilya M. <m_...@us...> - 2002-02-21 01:02:19
|
Update of /cvsroot/http-webtest/HTTP-WebTest/t In directory usw-pr-cvs1:/tmp/cvs-serv11927/t Modified Files: utils.pl 07-compat.t 01-api.t Log Message: Rename generate_wscript() to generate_testfile() Index: utils.pl =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/utils.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** utils.pl 17 Feb 2002 14:15:29 -0000 1.3 --- utils.pl 21 Feb 2002 01:02:10 -0000 1.4 *************** *** 65,70 **** } ! # generate wt scripts from template ! sub generate_wscript { my %param = @_; --- 65,70 ---- } ! # generate test file from template ! sub generate_testfile { my %param = @_; Index: 07-compat.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/07-compat.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** 07-compat.t 24 Jan 2002 12:26:10 -0000 1.1.1.1 --- 07-compat.t 21 Feb 2002 01:02:10 -0000 1.2 *************** *** 25,29 **** # 1-4: run tests defined in wt script (check web_test method) { ! generate_wscript(file => 't/real.wt', server_url => $URL); my $output = ''; --- 25,29 ---- # 1-4: run tests defined in wt script (check web_test method) { ! generate_testfile(file => 't/real.wt', server_url => $URL); my $output = ''; *************** *** 46,50 **** # 5: check web_test method { ! generate_wscript(file => 't/good.wt', server_url => $URL); my $output = ''; --- 46,50 ---- # 5: check web_test method { ! generate_testfile(file => 't/good.wt', server_url => $URL); my $output = ''; Index: 01-api.t =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/01-api.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 01-api.t 7 Feb 2002 23:34:25 -0000 1.5 --- 01-api.t 21 Feb 2002 01:02:10 -0000 1.6 *************** *** 86,90 **** # 11: run tests defined in wt script { ! generate_wscript(file => 't/real.wt', server_url => $URL); my $output = ''; --- 86,90 ---- # 11: run tests defined in wt script { ! generate_testfile(file => 't/real.wt', server_url => $URL); my $output = ''; |
From: Ilya M. <m_...@us...> - 2002-02-20 21:32:47
|
Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest In directory usw-pr-cvs1:/tmp/cvs-serv30608 Modified Files: API.pm Log Message: Added method last_test_num Index: API.pm =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/API.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** API.pm 15 Feb 2002 10:38:33 -0000 1.5 --- API.pm 20 Feb 2002 21:32:31 -0000 1.6 *************** *** 111,115 **** # run all tests ! for my $test (@{$self->tests}) { $self->run_test($test, $self->_global_test_params); } --- 111,117 ---- # run all tests ! for my $i (0 .. @{$self->tests} - 1) { ! my $test = $self->tests->[$i]; ! $self->last_test_num($i); $self->run_test($test, $self->_global_test_params); } *************** *** 422,425 **** --- 424,437 ---- } + =head2 last_test_num () + + =head3 Returns + + A number of last test being or been run. + + =cut + + *last_test_num = make_access_method('LAST_TEST_NUM'); + =head2 last_test () *************** *** 576,580 **** C<HTTP::WebTest 2.xx> offers more rich API than its predecessor ! C<HTTP::WebTest 1.xx>. However while deprecated old API is still supported. --- 588,592 ---- C<HTTP::WebTest 2.xx> offers more rich API than its predecessor ! C<HTTP::WebTest 1.xx>. However while old API is deprecated it is still supported. |
From: Ilya M. <m_...@us...> - 2002-02-17 14:19:30
|
Update of /cvsroot/http-webtest/HTTP-WebTest In directory usw-pr-cvs1:/tmp/cvs-serv13046 Modified Files: Makefile.PL Log Message: Fix typo Index: Makefile.PL =================================================================== RCS file: /cvsroot/http-webtest/HTTP-WebTest/Makefile.PL,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.PL 15 Feb 2002 10:42:38 -0000 1.2 --- Makefile.PL 17 Feb 2002 14:19:25 -0000 1.3 *************** *** 161,165 **** HTTP-WebTest automated test suite contains tests for local web files test mode. Running these tests requires Apache web server. If you do ! not have Apache you can skip this tests. Run local web files test mode tests during 'make test'? [Y/n]: --- 161,165 ---- HTTP-WebTest automated test suite contains tests for local web files test mode. Running these tests requires Apache web server. If you do ! not have Apache you can skip these tests. Run local web files test mode tests during 'make test'? [Y/n]: |