Difference between revisions of "Testscripts"
From Amahi Wiki
(Created page with 'Testsscripts look like: app << { ... test ... } There are three types of tests: * checking a page test * submitting a form * clicking on a link = Checking a page == :p…') |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | Testscripts look like: | |
app << { ... test ... } | app << { ... test ... } | ||
Line 9: | Line 9: | ||
* clicking on a link | * clicking on a link | ||
− | = Checking a page | + | = Checking a page = |
:page => ['Title', 'some string'] | :page => ['Title', 'some string'] | ||
+ | |||
+ | The testing engine will look for | ||
+ | |||
+ | <title>Title</title> | ||
+ | |||
+ | and | ||
+ | |||
+ | some string | ||
+ | |||
+ | in the HTML of the current page. | ||
+ | |||
+ | = Submitting a Form = | ||
+ | |||
+ | :form => [['field-name1', 'keystrokes'], ... , 'form-name'] | ||
+ | |||
+ | The testing engine will look for | ||
+ | |||
+ | <form name="form-name" ...> | ||
+ | <input name="field-name1" .../> | ||
+ | <input name="field-name2" .../> | ||
+ | </form> | ||
+ | |||
+ | and then input the keystrokes in the fields, followed by submitting the form. | ||
+ | |||
+ | = Clicking on a Link = | ||
+ | |||
+ | :click => 'Sign out' | ||
+ | |||
+ | The testing engine will look for a <code><nowiki><a ...>Sign out</a></nowiki></code> and click on it. |
Latest revision as of 01:49, 7 July 2010
Testscripts look like:
app << { ... test ... }
There are three types of tests:
- checking a page test
- submitting a form
- clicking on a link
Checking a page
:page => ['Title', 'some string']
The testing engine will look for
<title>Title</title>
and
some string
in the HTML of the current page.
Submitting a Form
:form => [['field-name1', 'keystrokes'], ... , 'form-name']
The testing engine will look for
<form name="form-name" ...> <input name="field-name1" .../> <input name="field-name2" .../> </form>
and then input the keystrokes in the fields, followed by submitting the form.
Clicking on a Link
:click => 'Sign out'
The testing engine will look for a <a ...>Sign out</a>
and click on it.