SA_CleanUpTest
waitForElementPresent link=Document Library Permissions Test Page
clickAtAndWait link=Document Library Permissions Test Page
pause 5000
store eval(selenium.isElementPresent('//span[3]/a/img')) PortletPresent
gotoIf !${PortletPresent} PortletNotPresent
store eval(selenium.isElementPresent('//td[4]/span/ul/li/strong/a')) DLFoldersNotPresent1
gotoIf !${DLFoldersNotPresent1} NoFoldersPresent1
clickAt //td[4]/span/ul/li/strong/a Actions
waitForElementPresent //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a Delete
clickAndWait //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a Delete
assertConfirmation Are you sure you want to delete this?
label NoFoldersPresent1
store eval(selenium.isElementPresent('//td[4]/span/ul/li/strong/a')) DLFoldersNotPresent2
gotoIf !${DLFoldersNotPresent2} NoFoldersPresent2
clickAt //td[4]/span/ul/li/strong/a Actions
waitForElementPresent //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a Delete
clickAndWait //div[@class='lfr-component lfr-menu-list']/ul/li[3]/a Delete
assertConfirmation Are you sure you want to delete this?
label NoFoldersPresent2
click //img[@alt='Remove']
assertConfirmation Are you sure you want to remove this component?
label PortletNotPresent
clickAt _145_addApplication
waitForElementPresent //div[@title='Document Library']/p/a
clickAt //div[@title='Document Library']/p/a
waitForElementPresent //section
assertElementPresent //section