Test_SNF_SOC_08_Demo_RequestandAcceptSpace
open /socialdemo/public/classic/
windowMaximize
echo --  Request and Accept user
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
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 Space08
type description This is description for Space_08
clickAt link=Create 2,2
pause 2000
echo -- Verify space created
waitForElementPresent link=Space08
click link=Space08
waitForTextPresent Space08 was created
verifyTextPresent Space08 was created
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo --User 1 request  to join the Space
click link=Sign in
waitForElementPresent username
type username mary
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForTextPresent This is description for Space_08
verifyTextPresent This is description for Space_08
waitForElementPresent //div/a[text()='Space08']/ancestor::div/ul//a[@title='Join']
click //div/a[text()='Space08']/ancestor::div/ul//a[@title='Join']
echo --Check Pending list space after request--
waitForElementPresent link=Pending Requests
clickAndWait link=Pending Requests
waitForTextPresent This is description for Space_08
verifyTextPresent This is description for Space_08
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo --User 2 request  to join the Space
click link=Sign in
waitForElementPresent username
type username demo
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
waitForElementPresent link=Spaces
clickAndWait link=Spaces
pause 500
waitForTextPresent This is description for Space_08
verifyTextPresent This is description for Space_08
waitForElementPresent //div/a[text()='Space08']/ancestor::div/ul//a[@title='Join']
click //div/a[text()='Space08']/ancestor::div/ul//a[@title='Join']
echo --Check Pending list space after request--
waitForElementPresent link=Pending Requests
clickAndWait link=Pending Requests
waitForTextPresent This is description for Space_08
verifyTextPresent This is description for Space_08
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo -- Accept Request of User 1--
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForElementPresent link=Space08
click link=Space08
echo -- Space Settings
waitForElementPresent //a[contains(@href,'space08/settings')]
click //a[contains(@href,'space08/settings')]
echo -- Member tabs
waitForElementPresent //div[text()='Members']
click //div[text()='Members']
echo -- Accept Mary
waitForElementPresent //td[text()='mary']/following-sibling::td/a[@title='Validate']
click //td[text()='mary']/following-sibling::td/a[@title='Validate']
echo -- Deny request of Demo--
waitForElementPresent //td[text()='demo']/following-sibling::td/a[@title='Decline']
click //td[text()='demo']/following-sibling::td/a[@title='Decline']
echo -- - Check member list after User accept/deny--
waitForElementPresent //a[contains(@href,'space08/members')]
click //a[contains(@href,'space08/members')]
waitForElementPresent link=Mary Kelly
verifyElementPresent link=Mary Kelly
verifyElementNotPresent link=Demo gtn
echo --Check My space list of user that accepted request--
waitForElementPresent link=Sign out
clickAndWait link=Sign out
click link=Sign in
waitForElementPresent username
type username mary
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForElementPresent link=My Spaces
clickAndWait link=My Spaces
waitForTextPresent This is description for Space_08
verifyTextPresent This is description for Space_08
echo --Check Public space list of user that deny request--
waitForElementPresent link=Sign out
clickAndWait link=Sign out
click link=Sign in
waitForElementPresent username
type username demo
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForElementPresent link=My Spaces
clickAndWait link=My Spaces
waitForTextPresent You do not have any spaces yet
verifyTextPresent You do not have any spaces yet
echo -- Delete Space created
waitForElementPresent link=Sign out
clickAndWait link=Sign out
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
waitForElementPresent link=Spaces
clickAndWait link=Spaces
waitForElementPresent //div//a[text()='Space08']/ancestor::div/ul//a[@title='Delete']
click //div//a[text()='Space08']/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 Space08
verifyTextNotPresent Space08
waitForElementPresent link=Sign out
clickAndWait link=Sign out