Test_SNF_CS42_ShareAddressBook
open /csdemo
windowMaximize
echo -Share Address Book-
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username john
type password gtn
clickAndWait id=UIPortalLoginFormAction
echo -- Share address book
waitForElementPresent link=Contacts
click link=Contacts
waitForElementPresent //div[@title='My Contacts']
mouseOver //div[@title='My Contacts']
contextMenu //div[@title='My Contacts']
waitForElementPresent link=Share
click link=Share
waitForElementPresent user
type user root
click canEdit
click link=Save
type user demo
click link=Save
click link=Close
waitForElementPresent //div[@class='IconHolder SharedAddressIcon']
click link=Sign out
echo -- Login by root to check shared address book
open /csdemo
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait id=UIPortalLoginFormAction
waitForElementPresent link=Contacts
click link=Contacts
waitForElementPresent //div[@title='john - My Contacts']
mouseOver //div[@title='john - My Contacts']
contextMenu //div[@title='john - My Contacts']
waitForElementPresent link=Edit
clickAndWait link=Sign out
echo -- Login by demo to check shared address book
open /csdemo
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username demo
type password gtn
clickAndWait id=UIPortalLoginFormAction
waitForElementPresent link=Contacts
click link=Contacts
waitForElementPresent //div[@title='john - My Contacts']
click //div[@title='john - My Contacts']
waitForElementPresent link=John Anthony
click link=Sign out
echo -- Login by john to remove share users
open /csdemo
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username john
type password gtn
clickAndWait id=UIPortalLoginFormAction
waitForElementPresent link=Contacts
click link=Contacts
waitForElementPresent //div[@title='My Contacts']
mouseOver //div[@title='My Contacts']
contextMenu //div[@title='My Contacts']
waitForElementPresent //div[@id='tmpMenuElement']/div/div[2]/div/div/div[4]/a
click //div[@id='tmpMenuElement']/div/div[2]/div/div/div[4]/a
waitForElementPresent //img[@alt='Delete']
click //img[@alt='Delete']
assertConfirmation Are you sure you want to remove this permission ?
waitForElementPresent //img[@alt='Delete']
click //img[@alt='Delete']
assertConfirmation Are you sure you want to remove this permission ?
clickAndWait link=Sign out
close