Test_SNF_SOC_12_Demo_LeaveSpace
open /socialdemo/public/classic/
windowMaximize
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
waitForElementPresent link=Spaces
click link=Spaces
echo -- Add a new Space
waitForElementPresent link=Add New Space
click link=Add New Space
waitForElementPresent name
type name Space12
type description This is description for Space_12
waitForElementPresent link=Create
click link=Create
pause 1000
echo -- Verify space created
waitForElementPresent link=Space12
verifyElementPresent link=Space12
click link=Space12
waitForTextPresent Space12 was created
verifyTextPresent Space12 was created
echo -- Invite a user to join the Space
waitForElementPresent link=Space Settings
click link=Space Settings
waitForElementPresent //div[@id='UISpaceSettingPortlet']//div[@class='TabsContainer']/div[3]//div[@class='MiddleTab']
click //div[@id='UISpaceSettingPortlet']//div[@class='TabsContainer']/div[3]//div[@class='MiddleTab']
waitForElementPresent user
type user mary
waitForElementPresent //form[@id='UISpaceMember']/div[2]/div/div/div/div/div[1]/div[2]/div
click //form[@id='UISpaceMember']/div[2]/div/div/div/div/div[1]/div[2]/div
waitForTextPresent mary
verifyTextPresent mary
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo -- Accept the Invite
open /socialdemo/public/classic/
click link=Sign in
waitForElementPresent username
type username mary
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
waitForElementPresent link=Spaces
click link=Spaces
waitForElementPresent link=Invitations
click link=Invitations
waitForElementPresent //a[@class='Icon IconAccept']
click //a[@class='Icon IconAccept']
echo -- Verify Accept the Invite successfully
waitForElementPresent link=My Spaces
click link=My Spaces
waitForTextPresent This is description for Space_12
verifyTextPresent This is description for Space_12
echo -- Leave Space
waitForElementPresent //a[@class='Icon IconLeaveSpace']
click //a[@class='Icon IconLeaveSpace']
waitForTextNotPresent This is description for Space_12
verifyTextNotPresent This is description for Space_12
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo -- Check member list after user leave
open /socialdemo/public/classic/
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
waitForElementPresent link=Spaces
click link=Spaces
waitForElementPresent //div[@id='UIManageMySpaces']/div[2]/div[2]/div[1]/div[1]/a[3]
clickAndWait //div[@id='UIManageMySpaces']/div[2]/div[2]/div[1]/div[1]/a[3]
waitForElementPresent //div[@id='UISpaceMenu']/div/div[4]/a
clickAndWait //div[@id='UISpaceMenu']/div/div[4]/a
waitForTextNotPresent mary
verifyTextNotPresent mary
waitForElementPresent link=Spaces
click link=Spaces
waitForElementPresent //a[@title='Delete Space']
click //a[@title='Delete Space']
waitForConfirmation Are you sure to delete this space? This can not be undone. All page navigations and this group will be deleted, too.
echo -- Verify space deleted
waitForTextNotPresent Space12
verifyTextNotPresent Space12
waitForElementPresent link=Sign out
clickAndWait link=Sign out