Test_PRL_07_02_005_AddRemoteGadgetWithURLExisting
open /portal/public/classic/
echo -- Add a remote gadget with URL existing --
windowMaximize
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
clickAndWait link=Application Registry
click link=Gadget
waitForElementPresent //div[@id='UIGadgetManagement']/div[1]/div[1]
click //div[@id='UIGadgetManagement']/div[1]/div[1]
waitForElementPresent url
type url http://www.labpixies.com/campaigns/babylon/babylon.xml
click link=Add
waitForElementPresent link=Click here to add into categories
click link=Click here to add into categories
waitForElementPresent category_Gadgets
click category_Gadgets
waitForElementPresent //form[@id='GadgetCategory']/div[2]/div/div/table/tbody/tr/td/div[1]/div/div/div
click //form[@id='GadgetCategory']/div[2]/div/div/table/tbody/tr/td/div[1]/div/div/div
echo -- Add URL is the same existing --
waitForElementPresent //div[@id='UIGadgetManagement']/div[1]/div[1]
click //div[@id='UIGadgetManagement']/div[1]/div[1]
waitForElementPresent url
type url http://www.labpixies.com/campaigns/babylon/babylon.xml
waitForElementPresent link=Add
click link=Add
waitForTextPresent This url is existing, please select another one!
verifyTextPresent This url is existing, please select another one!
waitForElementPresent //div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a
click //div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a
echo -- Delete this gadget--
waitForElementPresent link=Babylon Translation Box
click link=Babylon Translation Box
waitForElementPresent //div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[1]/a[2]
click //div[@id='UIGadgetManagement']/div[2]/div[1]/div/div/div/div[1]/a[2]
assertConfirmation Are you sure to delete this gadget?
waitForElementPresent link=Sign out
clickAndWait link=Sign out