Test_SNF_KS_75_ksdemo_SpaceSettingsInWiki
open /portal/public/intranet/
windowMaximize
waitForElementPresent //div[contains(text(),'Sign in')]
click //div[contains(text(),'Sign in')]
waitForElementPresent username
type username root
waitForElementPresent password
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
open /portal/private/intranet/wiki
echo - Choose a default & Allow user to select syntax
waitForElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent //div[@id='UIWikiSettingContainer']//a[text()='Syntax']
click //div[@id='UIWikiSettingContainer']//a[text()='Syntax']
waitForElementPresent DefaultSyntax
select DefaultSyntax label=MediaWiki 1.0
waitForElementPresent AllowChooseOthers
check AllowChooseOthers
waitForElementPresent //div[@id='UIWikiSettingContainer']//a[text()='Save']
click //div[@id='UIWikiSettingContainer']//a[text()='Save']
waitForElementPresent //div[@id='UIWikiPortlet']//a[text()='OK']
click //div[@id='UIWikiPortlet']//a[text()='OK']
echo - Verify the default syntax
waitForElementPresent link=Wiki Home
clickAndWait link=Wiki Home
waitForElementPresent link=Blank Page
click link=Blank Page
waitForText //div[@id='UIWikiSidePanelArea']/div[1] MEDIAWIKI 1.0
verifyText //div[@id='UIWikiSidePanelArea']/div[1] MEDIAWIKI 1.0
echo - Test the syntax select box
waitForElementPresent SyntaxType
verifyElementPresent SyntaxType
verifyValue SyntaxType mediawiki/1.0
select SyntaxType label=TWiki 1.0
waitForText //div[@id='UIWikiSidePanelArea']/div[1] TWIKI 1.0
verifyText //div[@id='UIWikiSidePanelArea']/div[1] TWIKI 1.0
echo - Reset the default settings
waitForElementPresent link=Cancel
click link=Cancel
waitForElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent DefaultSyntax
select DefaultSyntax label=XWiki 2.0
waitForElementPresent AllowChooseOthers
uncheck AllowChooseOthers
waitForElementPresent //form[@id='UIWikiSettingContainer_SyntaxSetting_']//a[text()='Save']
click //form[@id='UIWikiSettingContainer_SyntaxSetting_']//a[text()='Save']
waitForElementPresent //div[@id='UIWikiPortlet']//a[text()='OK']
click //div[@id='UIWikiPortlet']//a[text()='OK']
echo - Verify the reset
waitForElementPresent link=Wiki Home
clickAndWait link=Wiki Home
waitForElementPresent link=Blank Page
click link=Blank Page
waitForText //div[@id='UIWikiSidePanelArea']/div[1] XWIKI 2.0
verifyText //div[@id='UIWikiSidePanelArea']/div[1] XWIKI 2.0
verifyElementPresent //div[@class='SyntaxType']//select[@class='selectbox' and @disabled='disabled']
waitForElementPresent link=Cancel
click link=Cancel
echo - Check Permission
waitForElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent //div[@id='UIWikiSettingContainer']//a[text()='Permission']
click //div[@id='UIWikiSettingContainer']//a[text()='Permission']
echo - Remove "Edit Pages" right for Owner "any"
waitForElementPresent //div[@id='UIPermissionGrid']//input[@name='EDITPAGEany']
uncheck //div[@id='UIPermissionGrid']//input[@name='EDITPAGEany']
echo - Add account demo
waitForElementPresent //div[@id='UIWikiPermissionOwner']//img[@title='Select User']
click //div[@id='UIWikiPermissionOwner']//img[@title='Select User']
waitForElementPresent //input[@name='demo']
check //input[@name='demo']
waitForElementPresent //div[@id='UIWikiUserPermissionPopupSelector']//a[text()='Add']
click //div[@id='UIWikiUserPermissionPopupSelector']//a[text()='Add']
echo - Save Permission
waitForElementPresent //div[@id='UIWikiPermissionOwner']//img[@title='Add Entry']
click //div[@id='UIWikiPermissionOwner']//img[@title='Add Entry']
waitForElementPresent link=Save
click link=Save
waitForElementPresent //div[@id='UIWikiPortlet']//a[text()='OK']
click //div[@id='UIWikiPortlet']//a[text()='OK']
echo - Add new permission
waitForElementPresent //div[@id='UIWikiPortlet']//a[text()='OK']
click //div[@id='UIWikiPortlet']//a[text()='OK']
waitForElementPresent //div[@id='UIPermissionGrid']//input[@name='EDITPAGEdemo']
check //div[@id='UIPermissionGrid']//input[@name='EDITPAGEdemo']
echo - Remove permission
waitForElementPresent //img[contains(@onclick,'&objectId=demo')]
click //img[contains(@onclick,'&objectId=demo')]
waitForElementPresent link=Save
click link=Save
waitForElementPresent //div[@id='UIWikiPortlet']//a[text()='OK']
click //div[@id='UIWikiPortlet']//a[text()='OK']
echo - Add Template
waitForElementPresent link=Template
click link=Template
waitForElementPresent link=Add more
click link=Add more
waitForElementPresent //input[@id='TitleInput']
type //input[@id='TitleInput'] New template
waitForElementPresent //input[@id='Description']
type //input[@id='Description'] Description of New template
waitForElementPresent //form[@id='UIWikiPageEditForm']//textarea[@id='Markup']
type //form[@id='UIWikiPageEditForm']//textarea[@id='Markup'] This is content of template
echo - Save template
waitForElementPresent //a[@id='UISubmitToolBar_SaveTemplate_']
clickAndWait //a[@id='UISubmitToolBar_SaveTemplate_']
waitForElementPresent //div[@id='UIWikiPortlet']//a[text()='OK']
click //div[@id='UIWikiPortlet']//a[text()='OK']
echo - Search template
waitForElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent link=Template
click link=Template
waitForElementPresent //input[@id='TemplateSeachBox']
type //input[@id='TemplateSeachBox'] New template
waitForElementPresent link=Search
click link=Search
waitForTextPresent New template
verifyTextPresent New template
waitForTextPresent Description of New template
verifyTextPresent Description of New template
echo - Edit template
waitForElementPresent //div[@id='UIWikiTemplateGrid']//a[text()='Edit']
click //div[@id='UIWikiTemplateGrid']//a[text()='Edit']
waitForElementPresent //input[@id='TitleInput']
type //input[@id='TitleInput'] New template
waitForElementPresent //input[@id='Description']
type //input[@id='Description'] Description of New template Update
waitForElementPresent //form[@id='UIWikiPageEditForm']//textarea[@id='Markup']
type //form[@id='UIWikiPageEditForm']//textarea[@id='Markup'] This is content of template Update
echo - Save template
waitForElementPresent //a[@id='UISubmitToolBar_SaveTemplate_']
clickAndWait //a[@id='UISubmitToolBar_SaveTemplate_']
echo - Add new page using template
waitForElementPresent //div[@id='UIWikiPageControlArea_PageToolBar_Add_']
mouseOver //div[@id='UIWikiPageControlArea_PageToolBar_Add_']
waitForElementPresent //div[@id='UIWikiPageControlArea_PageToolBar_Add_']//a[@title='From Template...']
click //div[@id='UIWikiPageControlArea_PageToolBar_Add_']//a[@title='From Template...']
waitForElementPresent //a[@onclick="eXo.wiki.UIWikiAjaxRequest.makeNewHash('#AddPageWithTemplate/New_template');"]
click //a[@onclick="eXo.wiki.UIWikiAjaxRequest.makeNewHash('#AddPageWithTemplate/New_template');"]
waitForElementPresent link=Save
clickAndWait link=Save
waitForTextPresent New template
verifyTextPresent New template
echo - Delete data: page
waitForElementPresent //div[@id='UIWikiPageControlArea_PageToolBar_More_']
mouseOver //div[@id='UIWikiPageControlArea_PageToolBar_More_']
waitForElementPresent link=Delete Page
click link=Delete Page
waitForElementPresent //div[@id='UIWikiPageArea']//a[text()='OK']
clickAndWait //div[@id='UIWikiPageArea']//a[text()='OK']
waitForTextNotPresent New template
verifyTextNotPresent New template
echo - Delete data: template
waitForElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent link=Template
click link=Template
echo - The 1st to search template
waitForElementPresent //input[@id='TemplateSeachBox']
type //input[@id='TemplateSeachBox'] New template
waitForElementPresent link=Search
click link=Search
waitForTextPresent New template
verifyTextPresent New template
echo - After that, delete search result
waitForElementPresent //div[@id='UIWikiTemplateGrid']//a[text()='Delete']
click //div[@id='UIWikiTemplateGrid']//a[text()='Delete']
assertConfirmation Are you sure to delete this template?
waitForTextNotPresent New template
verifyTextNotPresent New template
echo - Sign out & finish
waitForElementPresent link=Logout
clickAndWait link=Logout
waitForTextPresent Sign in
verifyTextPresent Sign in