Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest
In directory usw-pr-cvs1:/tmp/cvs-serv21918/lib/HTTP/WebTest
Modified Files:
Cookbook.pod
Log Message:
Added docs about Click plugin
Index: Cookbook.pod
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Cookbook.pod,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Cookbook.pod 16 Feb 2002 00:40:41 -0000 1.8
--- Cookbook.pod 27 Apr 2002 22:02:51 -0000 1.9
***************
*** 58,62 ****
=head2 Check Login Form
! This wtscripts tests login form on http://fsck.com/rt2/:
test_name = Login page
--- 58,62 ----
=head2 Check Login Form
! This wtscript tests login form on http://fsck.com/rt2/:
test_name = Login page
***************
*** 82,85 ****
--- 82,131 ----
end_test
+ =head2 Using link and button names instead of URLs in tests
+
+ This wtscript tests couple of static pages on my website. It is
+ similar to example in section L<Check Static Website> but it uses test
+ parameter C<click_link> to specify link to be followed on next test
+ request instead of hardcoded URI:
+
+ # load HTTP::WebTest::Plugin::Click module which provides test
+ # parameter 'click_link'
+ plugins = ( ::Click )
+
+ test_name = First page
+ url = http://martynov.org/
+ text_require = ( Ilya Martynov's Web Site )
+ end_test
+
+ test_name = Mail-CheckUser page
+ click_link = Mail-CheckUser
+ text_require = ( Mail-CheckUser
+ Download )
+ regex_require = ( Mail-CheckUser-[\d\.]+\.tar\.gz )
+ end_test
+
+ 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>:
+
+ # load HTTP::WebTest::Plugin::Click module which provides test
+ # parameter 'click_button'
+ plugins = ( ::Click )
+
+ test_name = Login page
+ url = http://fsck.com/rt2/
+ text_require = ( Login
+ Username:
+ Password:)
+ end_test
+
+ test_name = Submit correct username & password
+ click_button = Login
+ params = ( user => guest
+ pass => guest )
+ regex_require = ( Signed in as.*?guest.*?\. )
+ end_test
+
=head1 ADVANCED
***************
*** 101,109 ****
It is possible to define new checks without writting new plugin
! module. Here fragment of wtscript file which checks if a new record
have been inserted into a database as result of test request.
# load HTTP::WebTest::Plugin::Hooks module which provides test
! # parameter on_response
plugins = ( ::Hooks )
--- 147,155 ----
It is possible to define new checks without writting new plugin
! module. Here fragment of wtscript file which checks if a new record
have been inserted into a database as result of test request.
# load HTTP::WebTest::Plugin::Hooks module which provides test
! # parameter 'on_response'
plugins = ( ::Hooks )
***************
*** 132,141 ****
Sometimes it is needed to feed the results of a previous test into the
! next test. For example, C<Add Record> creates a database record, emits
! HTML containing the new record id, and C<Delete Record> deletes the
! database record using the record id generated in C<Add Record>.
It is possible to use L<HTTP::WebTest|HTTP::WebTest> to write such
! tests. Here incomplete example of wtscript which implements it.
# load HTTP::WebTest::Plugin::Hooks module which provides test
--- 178,187 ----
Sometimes it is needed to feed the results of a previous test into the
! next test. For example, C<Add Record> creates a database record,
! emits HTML containing the new record id, and C<Delete Record> deletes
! the database record using the record id generated in C<Add Record>.
It is possible to use L<HTTP::WebTest|HTTP::WebTest> to write such
! tests. Here incomplete example of wtscript which implements it.
# load HTTP::WebTest::Plugin::Hooks module which provides test
|