[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/test/helpers/ -> uiscriptrunner.class.php (sommaire)

(pas de description)

Poids: 191 lignes (5 kb)
Inclus ou requis:0 fois
Référencé: 2 fois
Nécessite: 0 fichiers

Définit 1 class

UIScriptRunner:: (5 méthodes):
  UIScriptRunner()
  run()
  getFailedStep()
  getFailedStepErrorMessage()
  _runStep()


Classe: UIScriptRunner  - X-Ref

\ingroup Test

This is a helper class that allows to execute scripts (defined as a PHP array with certain values)
to test user interfaces. Scripts are quite simple and are based on the idea of fetching a URL
(or submitting a form) and expecting to find a certain value in the resulting page.

Scripts are fairly simple with only a small subsets of properties. The following is an
example of a script that logs in, selects a blog and logs out:

<pre>
Array(
"login" => Array(
"url" => "http://localhost/lt/admin.php",
"type" => "post",
"params" => Array(
"userName" => "user",
"userPassword" => "password",
"op" => "Login"
),
"expected" => "Dashboard",
"message" => "The dashboard did not appear when logging in"
),
"select_blog" => Array(
"url" => "http://localhost/lt/admin.php",
"type" => "get",
"params" => Array(
"op" => "blogSelect",
"blogId" => "1"
),
"expected" => "New Post",
"message" => "The blog could not be selected after the dashboard"
),
"logout" => Array(
"url" => "http://localhost/lt/admin.php",
"type" => "get",
"params" => Array( "op" => "Logout" ),
"expected" => "You have been successfully logged out",
"message" => "The logout screen was not displayed correctly"
)
);
</pre>

Handling of HTTP requests is handled via the HttpClient class, and cookies are kept
accross requests.

In order to incorporate these in your tests scripts, please use the method
LifeTypeTestCase::assertUIScript()
UIScriptRunner()   X-Ref
Pas de description

run( $script )   X-Ref
Runs a UI script from an array


getFailedStep()   X-Ref
If UIStepRunner::run() returns false, this method will return the name of the
step that failed.

return: A String

getFailedStepErrorMessage()   X-Ref
If UIStepRunner::run() returns false, this method will return the name of the
step that failed.

return: A String

_runStep( $step )   X-Ref




Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics