JSPWiki Test Asserted Permissions | ||
store | /@selenium.context@ | baseUrl |
store | javascript{'Test-asserted-permissions-'+new Date().getTime()} | group |
store | Janne Jalkanen FredFlintstone | members |
store | ${baseUrl}/Wiki.jsp | url |
store | ${baseUrl}/UserPreferences.jsp?redirect=Main | prefsurl |
store | ${baseUrl}/Login.jsp | loginurl |
store | ${baseUrl}/Group.jsp? | viewgroupurl |
store | ${baseUrl}/NewGroup.jsp? | newgroupurl |
store | ${baseUrl}/EditGroup.jsp? | editgroupurl |
store | janne | TestUsername |
store | myP@5sw0rd | TestPassword |
Create new group with 'janne' and 'FredFlintstone' as members | ||
open | ${url} | |
verifyTitle | JSPWiki: Main | |
verifyTextPresent | G’day (anonymous guest) | |
login | ||
open | ${loginurl} | |
verifyTitle | JSPWiki: Login | |
type | j_username | ${TestUsername} |
type | j_password | ${TestPassword} |
clickAndWait | submitlogin | |
verifyTextNotPresent | Please sign in | |
verifyTextPresent | G’day | |
verifyTextPresent | (authenticated) | |
First, name the group | ||
open | ${newgroupurl} | |
verifyTitle | JSPWiki: New Group | |
verifyElementPresent | css=form#createGroup input[name="ok"] | |
verifyElementPresent | group | |
verifyElementPresent | members | |
type | group | ${group} |
type | members | ${members} |
clickAndWait | css=form#createGroup input[name="ok"] | |
Verify the group was created | ||
verifyTextNotPresent | Could not create group | |
open | ${viewgroupurl}group=${group} | |
verifyTitle | JSPWiki: ${group} | |
verifyTextPresent | This is the wiki group called | |
Log out | ||
clickAndWait | link=Log out | |
Verifiy that anonymous users can't view the group | ||
open | ${viewgroupurl}group=${group} | |
verifyTextPresent | Please sign in | |
Log in again and verify we can read it | ||
open | ${loginurl} | |
type | j_username | ${TestUsername} |
type | j_password | ${TestPassword} |
clickAndWait | submitlogin | |
open | ${viewgroupurl}group=${group} | |
verifyTextPresent | This is the wiki group called | |
Log out | ||
clickAndWait | link=Log out | |
Verify that asserted user 'Fred' can view the group but not edit | ||
open | ${url} | |
clickAndWait | link=My Prefs | |
verifyTitle | JSPWiki: User Preferences | |
verifyElementPresent | assertedName | |
verifyElementPresent | css=form#setCookie input[name="ok"] | |
type | assertedName | FredFlintstone |
clickAndWait | css=form#setCookie input[name="ok"] | |
Now navigate back to the main page; see the 'G'day message' for FredFlintstone | ||
verifyTitle | JSPWiki: Main | |
verifyTextPresent | G’day | |
verifyElementPresent | link=FredFlintstone | |
verifyTextPresent | (not logged in) | |
assertCookie | regex:JSPWikiAssertedName=FredFlintstone | |
open | ${viewgroupurl}group=${group} | |
verifyTitle | JSPWiki: ${group} | |
verifyTextPresent | This is the wiki group called | |
Try to edit it should not be allowed | ||
open | ${editgroupurl}group=${group} | |
verifyTextPresent | Please sign in | |
Clear user cookie | ||
open | ${prefsurl} | |
verifyTitle | JSPWiki: User Preferences | |
verifyValue | assertedName | FredFlintstone |
verifyElementPresent | css=form#clearCookie input[name="ok"] | |
clickAndWait | css=form#clearCookie input[name="ok"] |