SA_CleanUpTest
open /web/guest/home/
waitForElementPresent link=Image Gallery Permissions Test Page
clickAtAndWait link=Image Gallery Permissions Test Page
store eval(selenium.isElementPresent('//span[3]/a/img')) PortletPresent
gotoIf !${PortletPresent} PortletNotPresent
store eval(selenium.isElementPresent('//td[4]/ul/li/strong/a')) Folder1Present
gotoIf !${Folder1Present} Folder1NotPresent
clickAt //td[4]/ul/li/strong/a
waitForElementPresent //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a
clickAndWait //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a
assertConfirmation Are you sure you want to delete this?
label Folder1NotPresent
store eval(selenium.isElementPresent('//td[4]/ul/li/strong/a')) Folder2Present
gotoIf !${Folder2Present} Folder2NotPresent
clickAt //td[4]/ul/li/strong/a
waitForElementPresent //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a
clickAndWait //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a
assertConfirmation Are you sure you want to delete this?
label Folder2NotPresent
click //img[@alt='Remove']
assertConfirmation Are you sure you want to remove this component?
label PortletNotPresent
clickAt _145_addApplication
pause 5000
waitForVisible layout_configuration_content
type layout_configuration_content i
waitForElementPresent //div[@title='Image Gallery']/p/a
clickAt //div[@title='Image Gallery']/p/a
waitForElementPresent //section
assertElementPresent //section