Location: PHPKode > projects > phpautotest > help.php
<?php
session_start();

require 'includes/phpautotest_config.php';
require 'includes/phpautotest_functions.php';

require 'includes/header.php';
require 'includes/top_menu.php';
?>

<span class = 'header_text'>phpautotest help</span>

<P>Regression testing is a type of software testing that makes sure that your web-site works as expected after bug-fixes and last minute changes. Despite being a good practice this sort of testing is very tedious to perform manually. This is where phpautotest comes in.</P>

<P>phpautotest is a tool for testing PHP-driven websites. It has to be walked through your web-site once, it can then follow the same steps and report whether the pages did not work as expected. Variable values as well as HTML output can be tested.</P>

<P><font size = +1 color = '#BBBBBB'>Important restrictions</font></P>

<P>
<ul>
	<li>Variables will not be recorded if your PHP code uses <b>exit()</b> or <b>die()</b>. To fix this use <b>return</b> instead.</li>
	<li>Cookies are not supported as of now.</li>
</ul>
</P>

<P><font size = +1 color = '#BBBBBB'>Installation</font></P>
<P>To install phpautotest first run install.php. Afterwards to change any settings edit <i>phpautotest_config.php</i> in the includes folder. The file is self-explanatory.</P>

<P><font size = +1 color = '#BBBBBB'>Recording a sequence of pages</font></P>
<P>Recording a sequence of pages is a very simple affair, simply click on "start recording", enter a URL to start with and click the start button. The URL opens in a frame and you can move from page to page by clicking links, submitting forms, etc. Everything is recorded so that phpautotest can follow your steps later on and report any discrepancies.</P>

<P>Once you have finished recording click on the link right at the top of the page to return to phpautotest's main panel. Next click on "edit test" to create HTML and variable tests for each page you recorded earlier.<P>

<P><font size = +1 color = '#BBBBBB'>Testing HTML output</font></P>
<P>You can ask phpautotest to search for particular text in the HTML output, if it cannot be found it is mentioned in the test report. Text can be tested using regular expressions. <b>Characters such as <i>^.[]$()|*+?{\</i> have to be escaped using \</b> as they are used in pattern matching.

<P>phpautotest downloads a copy of every page and escapes the above mentioned characters for you automatically. <b>To view the downloaded HTML click on "show http output" while editing tests</b>. If you're not familiar with pattern matching using regular expressions please refer to the PHP manual.</P>

<P><font size = +1 color = '#BBBBBB'>Testing PHP variables</font></P>
<P>PHP variables are recorded at the end of execution of each PHP page you visit. These variables are stored by phpautotest so that they can be compared later on. Remember to append ".php" at the end of your URL's or variables will not be recorded.</P>
<P>Variables stored at the time of recording a test case are stored in an array named <i>$expected</i>. Variables stored during the regression test are stored in array named <i>$actual</i>. A sample test can be viewed by clicking <i>paste sample php test code</i>.</P>
<?php
require 'includes/footer.php';
?>
Return current item: phpautotest