Test_SNF_SOC_09_Demo_RemoveUserfromSpace
open /socialdemo/public/classic/
windowMaximize
echo --  Remove User
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
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 Space09
type description This is description for Space_09
waitForElementPresent link=Create
click link=Create
echo -- Verify space created
waitForElementPresent link=Space09
verifyElementPresent link=Space09
click link=Space09
waitForTextPresent Space09 was created
verifyTextPresent Space09 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/a[2]
click //form[@id='UISpaceMember']/div[2]/div/a[2]
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
pause 500
echo -- Verify your Space Invitation is displayed
waitForTextPresent This is description for Space_09
verifyTextPresent This is description for Space_09
waitForElementPresent //a[@class='Icon IconAccept']
click //a[@class='Icon IconAccept']
echo --Check My space list of user after accept invitation--
waitForElementPresent link=My Spaces
click link=My Spaces
waitForTextPresent This is description for Space_09
verifyTextPresent This is description for Space_09
waitForElementPresent link=Sign out
clickAndWait link=Sign out
open /socialdemo/public/classic/
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
echo -- - Verify accepted user is displayed in Member lisr
waitForElementPresent link=Members
click link=Members
waitForElementPresent link=Mary Kelly
verifyElementPresent link=Mary Kelly
echo -- - Remove user
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 //form[@id='UISpaceMember']/table/tbody/tr[2]/td[3]/a
click //form[@id='UISpaceMember']/table/tbody/tr[2]/td[3]/a
waitForTextNotPresent mary
verifyTextNotPresent mary
echo -- Delete Space created
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.
waitForElementPresent link=Sign out
clickAndWait link=Sign out