Test_SNF_CS41_ManageAddressBook
open /portal
windowMaximize
echo -Manage Address Book-
waitForElementPresent //b[contains(text(),'Sign in')]
click //b[contains(text(),'Sign in')]
waitForElementPresent username
type username mary
type password gtn
clickAndWait id=UIPortalLoginFormAction
pause 5000
echo -- Add Address Book
waitForElementPresent link=Contacts
click link=Contacts
pause 2000
waitForElementPresent //a[@title='Add an Address book']
click //a[@title='Add an Address book']
waitForElementPresent categoryName
type categoryName Address_Book_41
type description Address_Book_41_description
click link=Save
echo -- Verify Address book created
waitForElementPresent xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41']
verifyElementPresent xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41']
pause 1000
echo -- Edit the added address book
mouseOver xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41']
contextMenu xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41']
waitForElementPresent link=Edit
click link=Edit
echo -- Verify edited value
waitForElementPresent //input[@value='Address_Book_41']
waitForElementPresent categoryName
type categoryName Address_Book_41_Edited
type description Address_Book_41_description_Edited
click link=Save
waitForElementPresent xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41_Edited']
verifyElementPresent xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41_Edited']
pause 1000
echo -- Delete Address Book
mouseOver xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41_Edited']
contextMenu xpath=//div[@class='PersonalAddress']//div[@title='Address_Book_41_Edited']
waitForElementPresent link=Delete
click link=Delete
assertConfirmation This address book will be deleted. Do you confirm?
clickAndWait link=Logout
close