Difference between revisions of "Example Selenium test suite"

From Organic Design wiki
(sync)
m
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{legacy}}
  
;See also
+
== Links to the suite & individual tests ==
*[{{SERVER}}/wiki/extensions/Selenium/selenium-core-0/core/TestRunner.html?test=..%2F..%2F..%2F..%2Findex.php%3Ftitle%3DSpecial%3ASelenium%26suite%3DSelenium_example Selenium-core]
+
Links to the test and suites can be created as they have in this section, but the easiest way to select and run tests is from the [[Special:Selenium|Selenium special page]]. For the test suite article to be available from the select list in the special page, it must be categorised into [[:Category:Selenium]].
 +
*'''[{{fullurl:Special:Selenium|suite={{FULLPAGENAMEE}}}} Suite of all the tests]'''
 +
*[{{fullurl:Special:Selenium|suite={{FULLPAGENAMEE}}}}&test=Create_account Create account]
 +
*[{{fullurl:Special:Selenium|suite={{FULLPAGENAMEE}}}}&test=Login Login]
 +
*[{{fullurl:Special:Selenium|suite={{FULLPAGENAMEE}}}}&test=Edit_an_article Edit an article]
 +
*[{{fullurl:Special:Selenium|suite={{FULLPAGENAMEE}}}}&test=Edit_a_section Edit a section]
 +
*[{{fullurl:Special:Selenium|suite={{FULLPAGENAMEE}}}}&test=Logout Logout]
  
;Suite
+
== Create account ==
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example Suite generation]
+
This test is an example of transclusion of another article ([[Example Selenium test]]) which itself a test article encapsulated in selenium tags.
;Tests
+
{{:Example Selenium test}}
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example&test=Create_account Create account]
 
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example&test=Login Login]
 
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example&test=Edit_an_article Edit an article]
 
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example&test=Edit_a_section Edit a section]
 
*[{{SERVER}}/wiki/index.php?title=Special:Selenium&suite=Selenium_example&test=Logout Logout]
 
  
==Create account==
+
== Login ==
This test is an example of transclusion of another article ([[Test:Create account]]) which itself a test article encapsulated in selenium tags.
+
This test is an example of an inline <nowiki><selenium></nowiki> test.
{{:Test:Create account}}
 
 
 
==Login==
 
this test is an example of an inline <nowiki><selenium></nowiki> test.
 
 
<selenium>
 
<selenium>
 
<html>
 
<html>
Line 32: Line 29:
 
<tr>
 
<tr>
 
<td>open</td>
 
<td>open</td>
<td>/wiki/index.php?title=Special:Userlogout</td>
+
<td>{{localurl:Special:Userlogout}}</td>
  
 
<td></td>
 
<td></td>
Line 45: Line 42:
  
 
<td>wpName1</td>
 
<td>wpName1</td>
<td>${username}</td>
+
<td>Foo</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>type</td>
 
<td>type</td>
 
<td>wpPassword1</td>
 
<td>wpPassword1</td>
<td>password</td>
+
<td>bar</td>
  
 
</tr>
 
</tr>
Line 71: Line 68:
 
</selenium>
 
</selenium>
  
==Edit an article==
+
== Edit an article ==
 
<selenium>
 
<selenium>
 
<html>
 
<html>
Line 87: Line 84:
 
<td>open</td>
 
<td>open</td>
  
<td>/wiki/index.php?title=TestArticle</td>
+
<td>{{localurl:TestArticle}}</td>
 
<td></td>
 
<td></td>
 
</tr>
 
</tr>
Line 128: Line 125:
 
</selenium>
 
</selenium>
  
==Edit a section==
+
== Edit a section ==
 
<selenium>
 
<selenium>
 
<html>
 
<html>
Line 144: Line 141:
 
<td>open</td>
 
<td>open</td>
  
<td>/wiki/index.php?title=User_talk:Foo</td>
+
<td>{{localurl:User talk:Foo}}</td>
 
<td></td>
 
<td></td>
 
</tr>
 
</tr>
Line 191: Line 188:
 
</html>
 
</html>
 
</selenium>
 
</selenium>
==Logout==
+
 
 +
== Logout ==
 
<selenium>
 
<selenium>
 
<html>
 
<html>
Line 207: Line 205:
 
<td>open</td>
 
<td>open</td>
  
<td>/wiki/index.php?title=Main_page</td>
+
<td>{{localurl:Main Page}}</td>
 
<td></td>
 
<td></td>
 
</tr>
 
</tr>
Line 227: Line 225:
 
</html>
 
</html>
 
</selenium>
 
</selenium>
 
[[Category:Selenium]]
 

Latest revision as of 14:24, 22 October 2014

Legacy.svg Legacy: This article describes a concept that has been superseded in the course of ongoing development on the Organic Design wiki. Please do not develop this any further or base work on this concept, now this page is for historic record only.


Links to the suite & individual tests

Links to the test and suites can be created as they have in this section, but the easiest way to select and run tests is from the Selenium special page. For the test suite article to be available from the select list in the special page, it must be categorised into Category:Selenium.

Create account

This test is an example of transclusion of another article (Example Selenium test) 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 {{localurl: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

Edit an article
open {{localurl: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 {{localurl: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 {{localurl:Main Page}}
    clickAndWait link=Log out
    verifyHtmlSource glob:*You are now logged out.*

    </selenium>