Difference between revisions of "Example Selenium test suite"

From Organic Design wiki
(Syncing example to local wiki)
(sync)
Line 2: Line 2:
  
 
;See also
 
;See also
*[{{SERVER}}/wiki/extensions/Selenium/selenium-core-0/core/TestRunner.html Selenium test environment]
+
*[{{SERVER}}/wiki/extensions/Selenium/selenium-core-0/core/TestRunner.html?test=..%2F..%2F..%2F..%2Findex.php%3Ftitle%3DSpecial%3ASelenium%26suite%3DSelenium_example Selenium-core]
*[{{SERVER}}/wiki/extensions/Selenium/selenium-core-0/core/TestRunner.html?test=..%2F..%2F..%2F..%2Findex.php%3Ftitle%3DSpecial%3ASelenium%26suite%3DSelenium_example&resultsUrl=..%2FpostResultss Selenium example]
+
 
*[[Special:Selenium|Selenium special page]]
 
 
;Suite
 
;Suite
 
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example Suite generation]
 
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example Suite generation]
Line 46: Line 45:
  
 
<td>wpName1</td>
 
<td>wpName1</td>
<td>foo</td>
+
<td>${username}</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>type</td>
 
<td>type</td>
 
<td>wpPassword1</td>
 
<td>wpPassword1</td>
<td>bar</td>
+
<td>password</td>
  
 
</tr>
 
</tr>
Line 88: Line 87:
 
<td>open</td>
 
<td>open</td>
  
<td>/TestArticle</td>
+
<td>/wiki/index.php?title=TestArticle</td>
 
<td></td>
 
<td></td>
 
</tr>
 
</tr>
Line 145: Line 144:
 
<td>open</td>
 
<td>open</td>
  
<td>/User_talk:Foo</td>
+
<td>/wiki/index.php?title=User_talk:Foo</td>
 
<td></td>
 
<td></td>
 
</tr>
 
</tr>
Line 208: Line 207:
 
<td>open</td>
 
<td>open</td>
  
<td>/</td>
+
<td>/wiki/index.php?title=Main_page</td>
 
<td></td>
 
<td></td>
 
</tr>
 
</tr>

Revision as of 08:07, 27 December 2007


See also
Suite
Tests

Create account

This test is an example of transclusion of another article (Test:Create account) which itself a test article encapsulated in selenium tags. <selenium> Create Account

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

Login
open /wiki/index.php?title=Special:Userlogout
clickAndWait link=Log in / create account
type wpName1 ${username}
type wpPassword1 password
clickAndWait wpLoginattempt
verifyTitle glob:*successful*

</selenium>

Edit an article

<selenium> Edit an article

Edit an article
open /wiki/index.php?title=TestArticle
clickAndWait link=Edit
storeEval new Date().getTime()-1000000000000 content
type wpTextbox1 *Test: ${content} ~~~~
clickAndWait wpSave
verifyHtmlSource regex:
  • Test: ${content}
  • </selenium>

    Edit a section

    <selenium> Edit a section

    Edit a section
    open /wiki/index.php?title=User_talk:Foo
    clickAndWait link=+
    type wpSummary foo
    type wpTextbox1 bar
    clickAndWait wpSave
    clickAndWait link=edit
    verifyTitle Editing*(section)*

    </selenium>

    Logout

    <selenium> Logout

    Logout
    open /wiki/index.php?title=Main_page
    clickAndWait link=Log out
    verifyHtmlSource glob:*You are now logged out.*

    </selenium>