Test_SNF_ECMS_50_ManageRelation_ecmdemo
open /portal/public/default/
windowMaximize
clickAndWait link=Visit the Acme Website
echo -- Log in
click link=Login
type username root
type password gtn
clickAndWait link=Sign in
echo -- Site Explorer
clickAndWait //a[@href='/portal/private/acme/siteExplorer']
echo --Open  driver pane
waitForElementPresent //div[@title='Show Drives']
click //div[@title='Show Drives']
echo --Open Private driver
waitForElementPresent link=Private
click link=Private
echo --  Select Admin View
waitForElementPresent //a[@title='Admin View']
click //a[@title='Admin View']
echo -- Go to Action tab
pause 3000
waitForElementPresent link=Actions
click link=Actions
echo --Create a Article document
waitForElementPresent link=Add Document
click link=Add Document
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 Lam Y khue, Em yeu chi
selectFrame relative=top
selectFrame //td[@id='cke_contents_content']/iframe
type //html/body Tai sao chi lai tu` choi em chu', Em muon het len. EM YEU CHI. Minh bi dien mia roi
selectFrame relative=top
echo -- Save as Draft
waitForElementPresent link=Save as Draft
click link=Save as Draft
pause 3000
echo -- Close
waitForElementPresent link=Close
click link=Close
echo --Go to Private
waitForElementPresent //div[@title='Private']
click //div[@title='Private']
echo --create another document
waitForElementPresent link=Add Document
click link=Add Document
waitForElementPresent selectTemplate label=Kofax document
select selectTemplate label=Kofax document
type name Kofax
echo --  Save as Draft "Kofax document "
waitForElementPresent link=Save as Draft
click link=Save as Draft
pause 3000
echo --  Close
waitForElementPresent link=Close
click link=Close
echo -- Add Relation
waitForElementPresent link=Test_SNF_ECMS_50
click link=Test_SNF_ECMS_50
echo --Open Add relation form
waitForElementPresent //a[text()='Admin']
click //a[text()='Admin']
echo --  Manage Relations
waitForElementPresent link=Manage Relations
click link=Manage Relations
echo --  Go to "Select relation tab"
waitForElementPresent //div[@id='UIRelationManager']/div/div/div[1]/div[1]/div/div/div/div/div[2]/div/div/div/div
click //div[@id='UIRelationManager']/div/div/div[1]/div[1]/div/div/div/div/div[2]/div/div/div/div
echo -- Select node to relation
echo --   User
waitForElementPresent //div[text()='Users']
click //div[text()='Users']
echo --   root
waitForElementPresent //div[text()='root']
click //div[text()='root']
echo --   Private
waitForElementPresent //div[text()='Private']
click //div[text()='Private']
echo --   Choose Kofax file
waitForElementPresent //div[@id='UISelectPathPanel']/table/tbody/tr[2]/td[2]/a/div
click //div[@id='UISelectPathPanel']/table/tbody/tr[2]/td[2]/a/div
waitForTextPresent /Users/root/Private/Kofax
verifyTextPresent /Users/root/Private/Kofax
echo --  Close
waitForElementPresent link=Close
click link=Close
echo --Go to Infor Tab
pause 3000
waitForElementPresent link=Info
click link=Info
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
waitForElementPresent link=Close
click link=Close
echo -- Delete document
waitForElementPresent link=Test_SNF_ECMS_50
mouseDownRight link=Test_SNF_ECMS_50
click link=Delete
echo -- Ok
waitForElementPresent //div[@id='UIPopupWindow']//a[text()='OK']
click //div[@id='UIPopupWindow']//a[text()='OK']
pause 3000
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
click link=Delete
echo -- Ok
waitForElementPresent //div[@id='UIPopupWindow']//a[text()='OK']
click //div[@id='UIPopupWindow']//a[text()='OK']
pause 3000
waitForElementNotPresent link=Kofax
verifyElementNotPresent link=Kofax
echo -- Log out
waitForElementPresent link=Logout
clickAndWait link=Logout