Test_SNF_ECMS_68_ManageTaxonomy_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 --  Go to Site Admin
clickAndWait //a[contains(@href, '/portal/private/acme/wcmAdmin')]
echo --  Go to Ontologies
waitForElementPresent //div[@class='TabIcon DefaultItemIcon OntologiesIcon']
click //div[@class='TabIcon DefaultItemIcon OntologiesIcon']
echo --  Go to Manage Taxonomy trees
waitForElementPresent link=Manage Categories
click link=Manage Categories
echo --  Add taxonomy
waitForElementPresent link=Add Taxonomy Tree
click link=Add Taxonomy Tree
waitForElementPresent TaxoTreeName
type TaxoTreeName Test_68
waitForElementPresent TaxoTreeWorkspace label=collaboration
select TaxoTreeWorkspace label=collaboration
waitForElementPresent //option[@value='collaboration']
click //option[@value='collaboration']
echo --  Select Home path
waitForElementPresent //img[@title='Add Path']
click //img[@title='Add Path']
echo --  Tick RootNode
waitForElementPresent //img[@title='AddRootNode']
click //img[@title='AddRootNode']
echo --  Next
waitForElementPresent link=Next
click link=Next
echo --  Set permission for taxonomy tree node :Select everyone
waitForElementPresent //img[@title='Select everyone']
click //img[@title='Select everyone']
check add_node
check set_property
check remove
waitForElementPresent link=Save
click link=Save
pause 5000
echo --  Next
waitForElementPresent //form[@id='UIPermissionTreeForm']//a[text()='Next']
click //form[@id='UIPermissionTreeForm']//a[text()='Next']
echo --  Register an action for this tree
waitForElementPresent lifecycle
addSelection lifecycle label=User Action
click //option[@value='read']
waitForElementPresent actionName
type actionName action
waitForElementPresent targetWorkspace label=collaboration
select targetWorkspace label=collaboration
echo --  Search Target path
waitForElementPresent //a[@onclick="javascript:eXo.webui.UIForm.submitEvent('UIActionForm','ShowComponent','&objectId=targetPath' )"]
click //a[@onclick="javascript:eXo.webui.UIForm.submitEvent('UIActionForm','ShowComponent','&objectId=targetPath' )"]
waitForElementPresent //img[@title='AddRootNode']
click //img[@title='AddRootNode']
echo --  Save
waitForElementPresent //form[@id='UIActionForm']//a[text()='Save']
click //form[@id='UIActionForm']//a[text()='Save']
echo --Create the first child node
waitForElementPresent //img[contains(@onclick,"Test_68") and @title="Add"]
click //img[contains(@onclick,"Test_68") and @title="Add"]
waitForElementPresent taxonomyName
type taxonomyName child 1
waitForElementPresent //form[@id='UITaxonomyTreeCreateChildForm']//a[text()='Save']
click //form[@id='UITaxonomyTreeCreateChildForm']//a[text()='Save']
echo --Create the second child node
waitForElementPresent //img[contains(@onclick,"Test_68") and @title="Add"]
click //img[contains(@onclick,"Test_68") and @title="Add"]
waitForElementPresent taxonomyName
type taxonomyName child 2
waitForElementPresent //form[@id='UITaxonomyTreeCreateChildForm']//a[text()='Save']
click //form[@id='UITaxonomyTreeCreateChildForm']//a[text()='Save']
echo --View 2 child nodes
waitForElementPresent //div[@id='UITaxonomyTreeCreateChild']//div[@title='Test_68']
click //div[@id='UITaxonomyTreeCreateChild']//div[@title='Test_68']
echo --Copy child 1 to child 2
waitForElementPresent //img[@title='Copy']
click //img[@title='Copy']
echo --  Paste to Child2
waitForElementPresent //tr[2]/td[2]/div/img[4]
click //tr[2]/td[2]/div/img[4]
echo --View Child 2
waitForElementPresent //div[@id='UITaxonomyTreeCreateChild']//div[text()='child 2']
click //div[@id='UITaxonomyTreeCreateChild']//div[text()='child 2']
echo --verify child 1 in child 2
waitForElementPresent //div[@id="UITaxonomyTreeCreateChild"]//div[@title="child 1"]
verifyVisible //div[@id="UITaxonomyTreeCreateChild"]//div[@title="child 1"]
echo --Go to test taxonomy
waitForElementPresent //div[@id='UITaxonomyTreeCreateChild']//a[@title="Up Level"]
click //div[@id='UITaxonomyTreeCreateChild']//a[@title="Up Level"]
echo --Cut child 2 to child 1
waitForElementPresent //tr[2]/td[2]/div/img[3]
click //tr[2]/td[2]/div/img[3]
waitForElementPresent //img[@title='Paste']
click //img[@title='Paste']
echo --View child 1
waitForElementPresent //div[@id='UITaxonomyTreeCreateChild']/div[2]/div/div/div/div/div[2]/a/div
click //div[@id='UITaxonomyTreeCreateChild']/div[2]/div/div/div/div/div[2]/a/div
echo -- Verify child 2 in child 1
waitForElementPresent //div[@id="UITaxonomyTreeCreateChild"]//div[@title="child 2"]
verifyVisible //div[@id="UITaxonomyTreeCreateChild"]//div[@title="child 2"]
pause 3000
echo -- Delete child 2 in child 1
waitForElementPresent //img[6]
click //img[6]
assertConfirmation Do you really want to delete ?
echo --close the form to add taxonomy
waitForElementPresent //div[2]/div[2]/div/div[1]/div/div/div/div[2]
click //div[2]/div[2]/div/div[1]/div/div/div/div[2]
pause 3000
echo --Edit taxonomy tree
waitForElementPresent //img[contains(@onclick,"Test_68") and @title="Edit taxonomy Tree"]
click //img[contains(@onclick,"Test_68") and @title="Edit taxonomy Tree"]
echo --  Prevous
waitForElementPresent //div[@id='UITaxonomyTreeCreateChild']//a[text()='Previous']
click //div[@id='UITaxonomyTreeCreateChild']//a[text()='Previous']
waitForElementPresent lifecycle label=User Action
addSelection lifecycle label=User Action
waitForElementPresent //option[@value='read']
click //option[@value='read']
echo --  Save
waitForElementPresent //form[@id='UIActionForm']//a[text()='Save']
click //form[@id='UIActionForm']//a[text()='Save']
echo -- Close
waitForElementPresent //a[text()='Close']
click //a[text()='Close']
echo --Delete Taxonomy : Test_68
waitForElementPresent //img[contains(@onclick,"Test_68") and @title="Delete taxonomy Tree"]
click //img[contains(@onclick,"Test_68") and @title="Delete taxonomy Tree"]
assertConfirmation Are you sure to delete?
echo --Logout
waitForElementPresent link=Logout
clickAndWait link=Logout