Test_SNF_SOC_02_Demo_CreateEditDeleteSpace
open /socialdemo/public/classic/
windowMaximize
echo -- Sign in Root
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
echo -- Access Spaces
waitForElementPresent link=Spaces
clickAndWait link=Spaces
echo -- Add a new Space
waitForElementPresent link=Add New Space
click link=Add New Space
waitForElementPresent displayName
type displayName Space02
type description This is description for Space_02
echo -- Create
waitForElementPresent link=Create
clickAt link=Create 2,2
pause 2000
echo -- Verify space created
waitForElementPresent link=Space02
click link=Space02
waitForTextPresent Space02 was created by Root Root
verifyTextPresent Space02 was created by Root Root
echo -- Space Settings
verifyElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent displayName Space02
type description This is description for Space_02_Edit
echo -- Save Settings
waitForElementPresent link=Save
click link=Save
echo --  Verify change
waitForTextPresent Update info of space successful.
verifyTextPresent Update info of space successful.
waitForElementPresent link=OK
click link=OK
echo -- Verify the space edited--
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForTextPresent This is description for Space_02_Edit
verifyTextPresent This is description for Space_02_Edit
echo -- Access space
waitForElementPresent link=Space02
click link=Space02
echo -- Delete Space created
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForElementPresent //div//a[text()='Space02']/ancestor::div/ul//a[@title='Delete']
click //div//a[text()='Space02']/ancestor::div/ul//a[@title='Delete']
waitForConfirmation Cannot undo one deleted space with all its page navigations and group. Are you sure to delete this space?
echo -- Verify space deleted
waitForTextNotPresent Space02
verifyTextNotPresent Space02
echo -- Sign out
waitForElementPresent link=Sign out
clickAndWait link=Sign out