Test_SNF_ECMS_68_ManageTaxonomy_ecmdemo
open /ecmdemo/public/acme/
windowMaximize
echo -- Login
click link=Login
type username root
type password gtn
clickAndWait link=Sign in
echo --  Go to sites Administration
clickAndWait //a[@href='/ecmdemo/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']
waitForElementPresent add_node
check add_node
waitForElementPresent set_property
check set_property
waitForElementPresent remove
check remove
waitForElementPresent link=Save
click link=Save
echo --  Next
waitForElementPresent //form[@id='UIPermissionTreeForm']//a[text()='Next']
click //form[@id='UIPermissionTreeForm']//a[text()='Next']
echo --  Register an action for this tree
waitForElementPresent actionName
type actionName action
addSelection lifecycle label=User Action
click //option[@value='read']
waitForElementPresent targetWorkspace label=collaboration
select targetWorkspace label=collaboration
echo --  Search Target path
waitForElementPresent //form[@id='UIActionForm']/div[2]/table/tbody/tr[8]/td[2]/table/tbody/tr/td[2]/a[1]/img
click //form[@id='UIActionForm']/div[2]/table/tbody/tr[8]/td[2]/table/tbody/tr/td[2]/a[1]/img
waitForElementPresent //img[@title='AddRootNode']
click //img[@title='AddRootNode']
waitForElementPresent //form[@id='UIActionForm']/div[2]/div/table/tbody/tr/td/div[2]/div/div/div/a
click //form[@id='UIActionForm']/div[2]/div/table/tbody/tr/td/div[2]/div/div/div/a
echo --Create the first child node
waitForElementPresent //img[@title='Add']
click //img[@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[@title='Add']
click //img[@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']
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[2]/div/div/div/div/div[3]/div/div/a/div
verifyVisible //div[@id="UITaxonomyTreeCreateChild"]/div[2]/div/div/div/div/div[3]/div/div/a/div
echo --Go to test taxonomy
waitForElementPresent //div[@id='UITaxonomyTreeCreateChild']/div[2]/div/div/div/div/div[1]/a
click //div[@id='UITaxonomyTreeCreateChild']/div[2]/div/div/div/div/div[1]/a
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[2]/div/div/div/div/div[2]/div/div/a/div
verifyVisible //div[@id="UITaxonomyTreeCreateChild"]/div[2]/div/div/div/div/div[2]/div/div/a/div
pause 10000
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]
echo --Edit taxonomy tree
waitForElementPresent //tr[5]/td[5]/div/img[1]
click //tr[5]/td[5]/div/img[1]
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 //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]
echo --Delete Taxonomy
waitForElementPresent //tr[5]/td[5]/div/img[2]
click //tr[5]/td[5]/div/img[2]
assertConfirmation Are you sure to delete?
echo --Logout
waitForElementPresent link=Sign out
clickAndWait link=Sign out