Test_SNF_ECMS_50_ManageRelation_ecmdemo
open /ecmdemo/public/acme/
windowMaximize
echo --Login
click link=Login
waitForElementPresent username
type username root
type password gtn
clickAndWait link=Sign in
echo --Go to Content Explorer
waitForElementPresent //a[@href='/ecmdemo/groups/:platform:web-contributors/siteExplorer']
clickAndWait //a[@href='/ecmdemo/groups/:platform:web-contributors/siteExplorer']
echo --Open  driver pane
waitForElementPresent //div[@title='Show Drives']
click //div[@title='Show Drives']
echo --Open Public driver
waitForElementPresent link=Public
click link=Public
echo -- Go to Action tab
pause 1000
waitForElementPresent link=Actions
click link=Actions
pause 1000
echo --Create a Article document
waitForElementPresent link=Add Document
click link=Add Document
waitForElementPresent link=Article
click link=Article
waitForElementPresent title
type title Test_SNF_ECMS_50
waitForElementPresent //td[@id='cke_contents_summary']/iframe
selectFrame //td[@id='cke_contents_summary']/iframe
type //html/body Test_SNF_ECMS_50
selectFrame relative=top
selectFrame //td[@id='cke_contents_content']/iframe
type //html/body Test_SNF_ECMS_50
selectFrame relative=top
echo -- Save
waitForElementPresent link=Save & Close
click link=Save & Close
pause 1000
echo --Go to Public
waitForElementPresent //div[@title='Public']
click //div[@title='Public']
echo --create another document
waitForElementPresent link=Add Document
click link=Add Document
pause 1000
waitForElementPresent link=Kofax document
click link=Kofax document
pause 1000
type name Kofax
echo --  Save  "Kofax document "
waitForElementPresent link=Save & Close
click link=Save & Close
pause 1000
echo -- Add Relation
waitForElementPresent link=Test_SNF_ECMS_50
click link=Test_SNF_ECMS_50
echo --Open Add relation form
pause 1000
waitForElementPresent //a[text()='Admin']
click //a[text()='Admin']
pause 1000
echo --  Manage Relations
waitForElementPresent link=Manage Relations
click link=Manage Relations
echo --  Go to "Select relation tab"
waitForElementPresent //div[text()='Select relation']
click //div[text()='Select relation']
echo -- Select node to relation
echo --   User
waitForElementPresent //div[text()='Users']
click //div[text()='Users']
waitForElementPresent //div[text()='r___']
click //div[text()='r___']
waitForElementPresent //div[text()='ro___']
click //div[text()='ro___']
waitForElementPresent //div[text()='roo___']
click //div[text()='roo___']
echo --   root
waitForElementPresent //div[text()='root']
click //div[text()='root']
echo --   Public
waitForElementPresent //div[text()='Public']
click //div[text()='Public']
echo --   Choose Kofax file
waitForElementPresent //div[@id='UISelectPathPanel']//a[contains(@href,"Kofax")]
click //div[@id='UISelectPathPanel']//a[contains(@href,"Kofax")]
waitForTextPresent /Users/r___/ro___/roo___/root/Private/Kofax
verifyTextPresent /Users/r___/ro___/roo___/root/Private/Kofax
echo --  Close
waitForElementPresent link=Close
click link=Close
echo --Go to Infor Tab
pause 1000
waitForElementPresent link=Info
click link=Info
pause 1000
echo -- Verify link to Kofax: Select Relation
waitForElementPresent link=Show/Hide Relations
click link=Show/Hide Relations
echo -- Check in Relations List
waitForElementPresent //div[@class='UIViewRelationList']//a[text()='Kofax']
click //div[@class='UIViewRelationList']//a[text()='Kofax']
echo -- Check References List
waitForElementPresent //div[@class='UIViewRelationList']//a[text()='Test_SNF_ECMS_50']
verifyElementPresent //div[@class='UIViewRelationList']//a[text()='Test_SNF_ECMS_50']
echo -- Show
waitForElementPresent link=Show/Hide Relations
click link=Show/Hide Relations
echo -- Delete Relation: Go to Admin Tab
waitForElementPresent link=Admin
click link=Admin
waitForElementPresent link=Test_SNF_ECMS_50
click link=Test_SNF_ECMS_50
echo -- Access Manage Relations
waitForElementPresent link=Manage Relations
click link=Manage Relations
echo -- Delete icon
waitForElementPresent //img[@alt='Delete']
click //img[@alt='Delete']
assertConfirmation Do you really want to delete this relation?
waitForTextPresent Empty data
verifyTextPresent Empty data
echo -- Close
pause 1000
waitForElementPresent link=Close
click link=Close
echo -- Delete document
waitForElementPresent link=Test_SNF_ECMS_50
mouseDownRight link=Test_SNF_ECMS_50
waitForElementPresent link=Delete
click link=Delete
echo -- Ok
waitForElementPresent //div[@id='UIPopupWindow']//a[text()='OK']
click //div[@id='UIPopupWindow']//a[text()='OK']
pause 1000
waitForElementNotPresent //div[@class='UIViewRelationList']//a[text()='Test_SNF_ECMS_50']
verifyElementNotPresent //div[@class='UIViewRelationList']//a[text()='Test_SNF_ECMS_50']
echo -- Delete Kofax document
waitForElementPresent link=Kofax
mouseDownRight link=Kofax
waitForElementPresent link=Delete
click link=Delete
echo -- Ok
waitForElementPresent //div[@id='UIPopupWindow']//a[text()='OK']
click //div[@id='UIPopupWindow']//a[text()='OK']
pause 1000
waitForElementNotPresent //div[@class='UIViewRelationList']//a[text()='Kofax']
verifyElementNotPresent //div[@class='UIViewRelationList']//a[text()='Kofax']
echo -- Log out
waitForElementPresent link=Sign out
clickAndWait link=Sign out