Test_SNF_ECMS_85_ApproveHolidayProcess_ecmdemo
open /ecmdemo/public/acme/
echo -- Login
windowMaximize
click link=Login
waitForElementPresent username
type username mary
type password gtn
clickAndWait link=Sign in
echo -- Open form to create request
waitForElementPresent link=Business Process Controller
clickAndWait link=Business Process Controller
echo --  BP Definition Controller
waitForElementPresent //div[@id='UIControllerManager']//div[text()="BP Definition Controller"]
click //div[@id='UIControllerManager']//div[text()="BP Definition Controller"]
echo --  Holiday process
waitForElementPresent //img[@title='Manage Start']
click //img[@title='Manage Start']
echo --  End (dd/mm/yyyy)
waitForElementPresent end
click end
waitForElementPresent link=29
click link=29
waitForElementPresent link=Submit
click link=Submit
pause 5000
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo -- Log in by Administration
waitForElementPresent link=Login
click link=Login
waitForElementPresent username
type username root
type password gtn
clickAndWait link=Sign in
echo -- Open form and approve task
waitForElementPresent link=Business Process Controller
clickAndWait link=Business Process Controller
waitForElementPresent //a[text()='Manage']
click //a[text()='Manage']
waitForElementPresent link=Approve
click link=Approve
echo Add James into HR
waitForElementPresent link=Users and groups management
clickAndWait link=Users and groups management
waitForElementPresent link=Group Management
click link=Group Management
waitForElementPresent //a[@title="Organization"]
click //a[@title="Organization"]
waitForElementPresent //a[@title="Management"]
click //a[@title="Management"]
waitForElementPresent link=Human Resources
click link=Human Resources
waitForElementPresent //a[@title="Select User"]
click //a[@title="Select User"]
waitForNotChecked james
click james
waitForElementPresent //div[contains(text(),'Add')]
click //div[contains(text(),'Add')]
waitForSelectedValue membership member
select membership label=author
waitForElementPresent link=Save
click link=Save
pause 10000
waitForElementPresent link=Sign out
clickAndWait link=Sign out
waitForElementPresent link=Login
click link=Login
echo -- Validate by human resource
waitForElementPresent username
type username james
type password gtn
clickAndWait link=Sign in
echo -- Business Process Controller
waitForElementPresent link=Business Process Controller
clickAndWait link=Business Process Controller
echo -- Manage
waitForElementPresent link=Manage
click link=Manage
pause 10000
echo -- read
waitForElementPresent link=Read
click link=Read
echo -- Log out
waitForElementPresent link=Sign out
clickAndWait link=Sign out
echo -- Log in by Administration remove James
waitForElementPresent link=Login
click link=Login
waitForElementPresent username
type username root
type password gtn
clickAndWait link=Sign in
waitForElementPresent link=Users and groups management
clickAndWait link=Users and groups management
waitForElementPresent link=Group Management
click link=Group Management
waitForElementPresent //a[@title="Organization"]
click //a[@title="Organization"]
waitForElementPresent //a[@title="Management"]
click //a[@title="Management"]
waitForElementPresent link=Human Resources
click link=Human Resources
waitForElementPresent //img[@alt='DeleteUser']
click //img[@alt='DeleteUser']
assertConfirmation Are you sure you want to delete user james from group organization/management/human-resources?
echo -- Log out end
waitForElementPresent link=Sign out
clickAndWait link=Sign out