Difference between revisions of "Example Selenium test suite"
From Organic Design wiki
| Line 1: | Line 1: | ||
| + | __NOTOC__ | ||
| + | |||
;See also | ;See also | ||
*[[Special:Selenium]] | *[[Special:Selenium]] | ||
| − | *[[Special:Selenium/{{ | + | ;Tests |
| + | *[{{SERVER}}/wiki/index.php/Special:Selenium?suite=Selenium_example&test=Create_account Create account] | ||
| + | *[{{SERVER}}/wiki/index.php/Special:Selenium?suite=Selenium_example&test=Login Login] | ||
| + | *[{{SERVER}}/wiki/index.php/Special:Selenium?suite=Selenium_example&test=Edit_an_article Edit an article] | ||
| + | *[{{SERVER}}/wiki/index.php/Special:Selenium?suite=Selenium_example&test=Edit_a_section Edit a section] | ||
| + | *[{{SERVER}}/wiki/index.php/Special:Selenium?suite=Selenium_example&test=Logout Logout] | ||
| − | == | + | ==Create account== |
| − | This test is an example of transclusion of another article which itself a test article encapsulated in | + | This test is an example of transclusion of another article which itself a test article encapsulated in selenium tags. |
| − | {{:Test:Create account | + | {{:Test:Create account}} |
| − | == | + | ==Login== |
this test is an example of an inline <nowiki><selenium></nowiki> test. | this test is an example of an inline <nowiki><selenium></nowiki> test. | ||
| − | <selenium><html> | + | <selenium> |
| + | <html> | ||
<head> | <head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| − | <title> | + | <title>Login</title> |
</head> | </head> | ||
<body> | <body> | ||
<table cellpadding="1" cellspacing="1" border="1"> | <table cellpadding="1" cellspacing="1" border="1"> | ||
<thead> | <thead> | ||
| − | <tr><td rowspan="1" colspan="3"> | + | <tr><td rowspan="1" colspan="3">Login</td></tr> |
</thead><tbody> | </thead><tbody> | ||
<tr> | <tr> | ||
<td>open</td> | <td>open</td> | ||
<td>/wiki/index.php?title=Special:Userlogout</td> | <td>/wiki/index.php?title=Special:Userlogout</td> | ||
| + | |||
<td></td> | <td></td> | ||
</tr> | </tr> | ||
| + | <tr> | ||
| + | <td>clickAndWait</td> | ||
| + | <td>link=Log in / create account</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td>type</td> | ||
| + | <td>wpName1</td> | ||
| + | <td>foo</td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td>type</td> | ||
| + | <td>wpPassword1</td> | ||
| + | <td>bar</td> | ||
| + | |||
| + | </tr> | ||
<tr> | <tr> | ||
<td>clickAndWait</td> | <td>clickAndWait</td> | ||
| − | <td> | + | <td>wpLoginattempt</td> |
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>verifyTitle</td> | ||
| + | <td>glob:*successful*</td> | ||
| + | |||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | </tbody></table> | ||
| + | </body> | ||
| + | </html> | ||
| + | </selenium> | ||
| + | |||
| + | ==Edit an article== | ||
| + | <selenium> | ||
| + | <html> | ||
| + | <head> | ||
| + | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| + | <title>Edit an article</title> | ||
| + | </head> | ||
| + | <body> | ||
| + | <table cellpadding="1" cellspacing="1" border="1"> | ||
| + | <thead> | ||
| + | <tr><td rowspan="1" colspan="3">Edit an article</td></tr> | ||
| + | </thead><tbody> | ||
| + | |||
| + | <tr> | ||
| + | <td>open</td> | ||
| + | |||
| + | <td>/TestArticle</td> | ||
<td></td> | <td></td> | ||
</tr> | </tr> | ||
| Line 33: | Line 90: | ||
<tr> | <tr> | ||
<td>clickAndWait</td> | <td>clickAndWait</td> | ||
| − | <td>link= | + | <td>link=Edit</td> |
<td></td> | <td></td> | ||
</tr> | </tr> | ||
| Line 40: | Line 97: | ||
<td>storeEval</td> | <td>storeEval</td> | ||
<td>new Date().getTime()-1000000000000</td> | <td>new Date().getTime()-1000000000000</td> | ||
| − | <td> | + | <td>content</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>type</td> | <td>type</td> | ||
| − | <td> | + | |
| − | <td>${ | + | <td>wpTextbox1</td> |
| + | <td>*Test: ${content} ~~~~</td> | ||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>clickAndWait</td> | ||
| + | <td>wpSave</td> | ||
| + | <td></td> | ||
| + | |||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>verifyHtmlSource</td> | ||
| + | <td>regex:<li>Test: ${content}</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | </tbody></table> | ||
| + | </body> | ||
| + | </html> | ||
| + | </selenium> | ||
| + | |||
| + | ==Edit a section== | ||
| + | <selenium> | ||
| + | <html> | ||
| + | <head> | ||
| + | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| + | <title>Edit a section</title> | ||
| + | </head> | ||
| + | <body> | ||
| + | <table cellpadding="1" cellspacing="1" border="1"> | ||
| + | <thead> | ||
| + | <tr><td rowspan="1" colspan="3">Edit a section</td></tr> | ||
| + | </thead><tbody> | ||
| + | |||
| + | <tr> | ||
| + | <td>open</td> | ||
| + | |||
| + | <td>/User_talk:Foo</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>clickAndWait</td> | ||
| + | <td>link=+</td> | ||
| + | <td></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>type</td> | <td>type</td> | ||
| − | <td> | + | <td>wpSummary</td> |
| − | <td> | + | <td>foo</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>type</td> | <td>type</td> | ||
| − | <td> | + | |
| − | <td> | + | <td>wpTextbox1</td> |
| + | <td>bar</td> | ||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>clickAndWait</td> | ||
| + | <td>wpSave</td> | ||
| + | <td></td> | ||
| + | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td>clickAndWait</td> | <td>clickAndWait</td> | ||
| − | <td> | + | <td>link=edit</td> |
<td></td> | <td></td> | ||
</tr> | </tr> | ||
| Line 69: | Line 179: | ||
<tr> | <tr> | ||
<td>verifyTitle</td> | <td>verifyTitle</td> | ||
| − | <td>glob:* | + | |
| + | <td>Editing*(section)*</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | </tbody></table> | ||
| + | </body> | ||
| + | </html> | ||
| + | </selenium> | ||
| + | ==Logout== | ||
| + | <selenium> | ||
| + | <html> | ||
| + | <head> | ||
| + | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
| + | <title>Logout</title> | ||
| + | </head> | ||
| + | <body> | ||
| + | <table cellpadding="1" cellspacing="1" border="1"> | ||
| + | <thead> | ||
| + | <tr><td rowspan="1" colspan="3">Logout</td></tr> | ||
| + | </thead><tbody> | ||
| + | |||
| + | <tr> | ||
| + | <td>open</td> | ||
| + | |||
| + | <td>/</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>clickAndWait</td> | ||
| + | <td>link=Log out</td> | ||
| + | <td></td> | ||
| + | </tr> | ||
| + | |||
| + | <tr> | ||
| + | <td>verifyHtmlSource</td> | ||
| + | <td>glob:*You are now logged out.*</td> | ||
<td></td> | <td></td> | ||
</tr> | </tr> | ||
Revision as of 22:28, 25 December 2007
- See also
- Tests
Create account
This test is an example of transclusion of another article which itself a test article encapsulated in selenium tags. <selenium>
| Create Account | ||
| open | {{localurl:Special:Userlogout}} | |
| open | {{localurl:Main Page}} | |
| clickAndWait | link=Log in / create account | |
| clickAndWait | link=Create an account | |
| storeEval | new Date().getTime()-1000000000000 | username |
| type | wpName2 | ${username} |
| type | wpPassword2 | password |
| type | wpRetype | password |
| clickAndWait | wpCreateaccount | |
| verifyTitle | glob:*successful* | |
</selenium>
Login
this test is an example of an inline <selenium> test. <selenium>
| Login | ||
| open | /wiki/index.php?title=Special:Userlogout | |
| clickAndWait | link=Log in / create account | |
| type | wpName1 | foo |
| type | wpPassword1 | bar |
| clickAndWait | wpLoginattempt | |
| verifyTitle | glob:*successful* | |
</selenium>
Edit an article
<selenium>
| Edit an article | ||
| open | /TestArticle | |
| clickAndWait | link=Edit | |
| storeEval | new Date().getTime()-1000000000000 | content |
| type | wpTextbox1 | *Test: ${content} ~~~~ |
| clickAndWait | wpSave | |
| verifyHtmlSource | regex: |
|
</selenium>
Edit a section
<selenium>
| Edit a section | ||
| open | /User_talk:Foo | |
| clickAndWait | link=+ | |
| type | wpSummary | foo |
| type | wpTextbox1 | bar |
| clickAndWait | wpSave | |
| clickAndWait | link=edit | |
| verifyTitle | Editing*(section)* | |
</selenium>
Logout
<selenium>
| Logout | ||
| open | / | |
| clickAndWait | link=Log out | |
| verifyHtmlSource | glob:*You are now logged out.* | |
</selenium>



