Test_SNF_SOC_11_Demo_AddandDeleteApplication
open /portal/public/intranet/
windowMaximize
echo -- Add and Delete Application in Space
click //b[contains(text(),'Sign in')]
waitForElementPresent username
type username john
type password gtn
clickAndWait id=UIPortalLoginFormAction
waitForElementPresent link=My Spaces
clickAndWait link=My Spaces
echo -- Add a new Space
waitForElementPresent link=Add New Space
click link=Add New Space
waitForElementPresent displayName
type displayName Space11
type description This is description for Space_11
click link=Create
pause 30000
echo -- Verify space created
waitForElementPresent link=Space11
click link=Space11
waitForTextPresent Space11 was created
verifyTextPresent Space11 was created
echo -- Go to  Settings
verifyElementPresent //a[contains(@href,'spaces:space11') and @title='Settings']
click //a[contains(@href,'spaces:space11') and @title='Settings']
echo -- Select Applications
waitForElementPresent //div[@id='UISpaceSettingPortlet']//div[text()='Applications']
click //div[@id='UISpaceSettingPortlet']//div[text()='Applications']
echo -- Add Application
waitForElementPresent link=Add Application
click link=Add Application
echo -- Select Authoring Dashboard
waitForElementPresent link=Contents
click link=Contents
waitForElementPresent //div[text()='Authoring Dashboard']/following-sibling::div[@title='Install']
click //div[text()='Authoring Dashboard']/following-sibling::div[@title='Install']
pause 2000
echo -- Check Application added
click css=#AddApplication > div.OverflowContainer.ClearFix > a.CloseButton
waitForElementPresent //div[@class='NormalTab']//a[contains(@href,'spaces:space11') and @title='Authoring Dashboard']
verifyVisible //div[@class='NormalTab']//a[contains(@href,'spaces:space11') and @title='Authoring Dashboard']
echo -- Delete Application
waitForElementPresent //div[text()='Authoring Dashboard']/following-sibling::div/a[@title='Remove']
click //div[text()='Authoring Dashboard']/following-sibling::div/a[@title='Remove']
pause 10000
waitForElementNotPresent //div[@class='NormalTab']//a[contains(@href,'spaces:space11') and @title='Authoring Dashboard']
verifyElementNotPresent //div[@class='NormalTab']//a[contains(@href,'spaces:space11') and @title='Authoring Dashboard']
echo -- Log out
waitForElementPresent link=Logout
clickAndWait link=Logout