App-SimpleScan
view release on metacpan or search on metacpan
lib/App/SimpleScan/Cookbook.pm view on Meta::CPAN
use strict;
=head1 NAME
App::SimpleScan::Cookbook
=head1 DESCRIPTION
This is a documentation-only module that describes how to use C<simple_scan>,
and outlines some techniques you can use for some common Web testing problems.
=head1 BASICS
C<simple_scan> reads I<test specifications> from standard input and generates
Perl code based on these specifications. It can either
=over 4
=item * execute them immediately,
=item * print them on standard output without executing them,
=item * or do both: execute them and then print the generated code on standard output.
=back
=head1 TEST SPECS
Test specifications describe
=over 4
=item * I<where> the page is that you want to check,
=item * some I<content> (in the form of a Perl regular expression) that you want look for
=item * a "success code", which defines whether or not the regex should match, and optionally allows you to run the test as a TODO, or skip it altogether.
=over
=item Y - The regular expression should match.
=item N - The regular expression should I<not> match.
=item TY - This a "TODO" test; eventually the regular expression should match, but isn't expected to now. (If it does, C<simple_report> will not that a test "UNEXPECTEDLY SUCCEEDED".)
=item TN - This "TODO" test is expected to match now, but eventually should not. (If it fails to match, this is also an "unexpected success".)
=item S - This test is to be skipped. Useful for putting in a placeholder test tht you don't currently want to run. This is usually useful when you have a test which is expensive or slow to run, and which you know currently will not pass.
=back
=item * and a comment about why you care
=back
C<simple_scan> always uses an HTTP GET to access the URL; if you need to do stuff like log in, or other setup that requires any other HTTP action, you'll need to use a plugin (see below).
Note that TODO tests get run whether or not they will pass; we just mind if
they currently fail. Skipped tests are not run at all. Use skipped tests if you
want to save time; use TODO tests if you want to be alerted of a change (from
passing to failing or vice versa).
Some example test specs:
( run in 0.925 second using v1.01-cache-2.11-cpan-2398b32b56e )