Test_USR_SOC_01_FindUser
open /socialdemo/public/classic/
windowMaximize
echo --Prepare data--
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
open http://localhost:8080/socialdemo/private/classic/NewStaff
echo --Create new user using "New Staff" portlet
waitForElementPresent username
type username test_01
type password userstories1
type Confirmpassword userstories1
type firstName Lam
type lastName Vu
type email test_01@gmail.com
waitForElementPresent link=Save
click link=Save
waitForElementPresent //div[@id='UIAccountPortlet']//div[@class='UIPopupWindow UIDragObject']//a
click //div[@id='UIAccountPortlet']//div[@class='UIPopupWindow UIDragObject']//a
echo --Check display new user in directory--
waitForElementPresent link=Directory
clickAndWait link=Directory
waitForTextPresent Lam Vu
verifyTextPresent Lam Vu
waitForElementPresent link=Sign out
clickAndWait link=Sign out
open /socialdemo/public/classic/
echo -- Update Profile
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username test_01
type password userstories1
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
waitForElementPresent link=Profile
click link=Profile
echo -- Edit Position
waitForElementPresent link=Edit
click link=Edit
waitForElementPresent position
type position Designer
waitForElementPresent link=Save
click link=Save
waitForTextPresent Designer
verifyTextPresent Designer
pause 1000
echo -- Update Contact
waitForElementPresent //div[@class='UIContactSection']//a
click //div[@class='UIContactSection']//a
waitForElementPresent gender
select gender label=male
waitForElementPresent //div[@id='UITitleBar']/h5/a[2]
click //div[@id='UITitleBar']/h5/a[2]
echo -- Verify Contact information updated
pause 2000
waitForTextPresent Gender : male
verifyTextPresent Gender : male
echo -- Update Experiences info--
waitForElementPresent //div[@class='experience']//a
click //div[@class='experience']//a
waitForElementPresent //div[@class='experience']//table[@class='UIFormGrid']//a
click //div[@class='experience']//table[@class='UIFormGrid']//a
waitForElementPresent //td[2]/input
type //td[2]/input eXo Platform
type //tr[2]/td[2]/input Designer
type //textarea[@id='skills1'] design
type //tr[5]/td[2]/input 05/05/2010
type //tr[6]/td[2]/input[1] 06/01/2011
waitForElementPresent //div[@id='UITitleBar']/h5/a[2]
click //div[@id='UITitleBar']/h5/a[2]
echo -- Verify experience after edited
pause 1000
waitForTextPresent Designer at eXo Platform
verifyTextPresent Designer at eXo Platform
verifyTextPresent May 5 2010 to June 1 2011
verifyTextPresent design
echo --Access to Directory page--
waitForElementPresent link=Sign out
clickAndWait link=Sign out
open /socialdemo/public/classic/
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']//div[@class='ButtonMiddle']/a
waitForElementPresent link=Directory
clickAndWait link=Directory
echo --Find User by name--
type Search Lam
waitForElementPresent //form[@id='UIProfileUserSearch']/div[2]/div[1]/div[2]/a
click //form[@id='UIProfileUserSearch']/div[2]/div[1]/div[2]/a
waitForTextPresent Lam Vu
verifyTextPresent Lam Vu
echo --Find User by Profile info--
waitForElementPresent //a[@id='MoreSearch']
click //a[@id='MoreSearch']
type position Designer
type skills design
select gender label=male
waitForElementPresent //form[@id='UIProfileUserSearch']/div[2]/div[1]/div[2]/a
click //form[@id='UIProfileUserSearch']/div[2]/div[1]/div[2]/a
waitForTextPresent Lam Vu
verifyTextPresent Lam Vu
echo --Find User by First char name--
waitForElementPresent link=L
click link=L
waitForTextPresent Lam Vu
verifyTextPresent Lam Vu
echo --Find All users--
waitForElementPresent //a[@id='searchAll']
click //a[@id='searchAll']
waitForTextPresent Lam Vu
verifyTextPresent Demo gtn
verifyTextPresent Mary Kelly
verifyTextPresent John Anthony
open http://localhost:8080/socialdemo/private/classic/ManagementUser
waitForTextPresent test_01
verifyTextPresent test_01
waitForElementPresent xpath=//div[@class='UIListUsers']//tbody/tr[5]//img[@class='DeleteUserIcon']
click xpath=//div[@class='UIListUsers']//tbody/tr[5]//img[@class='DeleteUserIcon']
waitForConfirmation Are you sure you want to delete test user?
waitForElementPresent link=Directory
clickAndWait link=Directory
waitForTextNotPresent Lam Vu
verifyTextNotPresent Lam Vu
waitForElementPresent link=Sign out
clickAndWait link=Sign out