Test_POR_19_046_CreatePagesAtTheSameLevelWithSameNodeName
open /portal/public/classic/home
echo -- Create pages  at the same level with same node name--
windowMaximize
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//a[text()='Sign in']
echo -- Add the first page --
waitForElementPresent link=Add New Page
click link=Add New Page
waitForElementPresent //div[@id='UIPageNodeSelector']/div/div/div[2]/div/div/div/div[1]/a
click //div[@id='UIPageNodeSelector']/div/div/div[2]/div/div/div/div[1]/a
waitForElementPresent pageName
type pageName Test_POR_19_046
type pageDisplayName Test_POR_19_046
echo -- Click Next to move step 2 --
waitForElementPresent //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div
click //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div
echo -- Click Next to move step 3, keep empty layout --
waitForElementPresent //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div
click //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div
waitForElementPresent //div[@id='UIPageEditor']/div[1]/div/div/div/a[2]
clickAndWait //div[@id='UIPageEditor']/div[1]/div/div/div/a[2]
echo -- View new page--
assertLocation http://localhost:8080/portal/private/classic/Test_POR_19_046
echo -- Create same name page at the same level--
waitForElementPresent link=Add New Page
click link=Add New Page
click //div[@id='UIPageNodeSelector']/div/div/div[2]/div/div/div/div[1]/a
waitForElementPresent pageName
type pageName Test_POR_19_046
type pageDisplayName Test_POR_19_046
waitForElementPresent //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div
click //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div
waitForTextPresent This name already exists.
verifyTextPresent This name already exists.
waitForElementPresent link=OK
click link=OK
waitForElementPresent //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[1]/div/div/div/a
click //div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[1]/div/div/div/a
echo -- Delete node --
clickAndWait link=Site
waitForElementPresent link=Edit Navigation
click link=Edit Navigation
waitForElementPresent //div[@id='UINavigationNodeSelector']/div/div/div/div[2]/div/div/div[8]/div/a
click //div[@id='UINavigationNodeSelector']/div/div/div/div[2]/div/div/div[8]/div/a
waitForElementPresent //a[@class='NodeIcon DefaultPageIcon NodeSelected' and @title='Test_POR_19_046']
mouseDownRight //a[@class='NodeIcon DefaultPageIcon NodeSelected' and @title='Test_POR_19_046']
waitForElementPresent link=Delete Node
click link=Delete Node
assertConfirmation Are you sure you want to delete this node?
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=Sign out
clickAndWait link=Sign out