setTimeout 120000
open /nuxeo/logout
retrieveCurrentDateInfo
type username bree
type password bree1
clickAndWait Submit
waitForPageToLoad 15000
verifyTextPresent bree
verifyElementPresent link=Manage
clickAndWait link=Manage
select document_edit:nxl_cm_mailbox:nxw_mailbox_profiles label=Case creation
clickAndWait //input[@value='Save']
verifyTextPresent Mailbox modified
open /nuxeo/logout
type username bree
type password bree1
clickAndWait Submit
clickAndWait link=Draft
verifyElementPresent link=New
mouseDown link=New
clickAndWait link=Case
retrieveTestFolderPath
type document_create:nxl_cm_case:nxw_title Case incoming mail for John, cc to Smith
clickAndWait link=Create
verifyTextPresent Case saved
verifyTextPresent Case incoming mail for John, cc to Smith
clickAndWait link=Case Item
retrieveTestFolderPath
type document_create:nxl_cm_document:nxw_title Incoming mail for John, cc to Smith
select document_create:nxl_cm_document:nxw_document_type Article
watchA4jRequests
click document_create:nxl_cm_document:nxw_contactsParticipants:nxw_contactsParticipants_add
waitForA4jRequest 10000
type document_create:nxl_cm_document:nxw_contactsParticipants:nxw_contactsParticipants_list:0:nxw_contactsParticipants_name Name1
type document_create:nxl_cm_document:nxw_contactsParticipants:nxw_contactsParticipants_list:0:nxw_contactsParticipants_surname Surname1
type document_create:nxl_cm_document:nxw_contactsParticipants:nxw_contactsParticipants_list:0:nxw_contactsParticipants_service Service1
type document_create:nxl_cm_document:nxw_document_dateInputDate ${currentMonth}/${currentDay}/${currentYear} 12:00 PM
type document_create:nxl_cm_document:nxw_receive_dateInputDate ${currentMonth}/${currentDay}/${currentYear} 12:00 PM
watchA4jRequests
click document_create:nxl_cm_document:nxw_contactsSenders:nxw_contactsSenders_add
waitForA4jRequest 10000
type document_create:nxl_cm_document:nxw_contactsSenders:nxw_contactsSenders_list:0:nxw_contactsSenders_name Name2
type document_create:nxl_cm_document:nxw_contactsSenders:nxw_contactsSenders_list:0:nxw_contactsSenders_surname Surname2
type document_create:nxl_cm_document:nxw_contactsSenders:nxw_contactsSenders_list:0:nxw_contactsSenders_service Service2
watchA4jRequests
type document_create:nxl_cm_document:nxw_reference Test Mail reference
click //input[@type='file']
storeExpression javascript{storedVars.testfolderpath + 'hello.pdf';} importUrl
type //input[@type='file'] ${importUrl}
clickAndWait link=Create
verifyElementPresent Link=Incoming mail for John, cc to Smith
clickAndWait link=Incoming mail for John, cc to Smith
clickAndWait link=Case incoming mail for John, cc to Smith
clickAndWait link=Distribute
clickAndWait link=Mailboxes
watchA4jRequests
typeKeys //input[@id='distribution_participants:nxl_cm_participants:nxw_action_participants_suggest'] doe
waitForA4jRequest 10000
verifyText //*[@id='distribution_participants:nxl_cm_participants:nxw_action_participants_suggestionBox:suggest']/x:tbody/x:tr[1]/x:td[2] John Doe (Nuxeo)
watchA4jRequests
click //*[@id='distribution_participants:nxl_cm_participants:nxw_action_participants_suggestionBox:suggest']/x:tbody/x:tr[1]/x:td[2]
waitForA4jRequest 10000
watchA4jRequests
typeKeys //input[@id='distribution_participants:nxl_cm_participants:nxw_copy_participants_suggest'] smith
waitForA4jRequest 10000
verifyText //*[@id='distribution_participants:nxl_cm_participants:nxw_copy_participants_suggestionBox:suggest']/x:tbody/x:tr[1]/x:td[2] John Smith (Nuxeo)
watchA4jRequests
click //*[@id='distribution_participants:nxl_cm_participants:nxw_copy_participants_suggestionBox:suggest']/x:tbody/x:tr[1]/x:td[2]
waitForA4jRequest 10000
type distribution_participants:nxl_cm_participants:nxw_distribution_comment my distribution test comment
clickAndWait Link=Send
verifyTextPresent Incoming mail for John, cc to Smith
verifyTextPresent The distribution is done
verifyElementPresent link=Distribute
verifyElementPresent link=Distribute
clickAndWait link=Routing history
verifyText //*[@id='tab_history:cm_distribution_history']/table/thead/tr/th[4] Comment
verifyText //*[@id='tab_history:cm_distribution_history']/table/tbody/tr/td[4]/div/pre my distribution test comment
verifyText //*[@id='tab_history:cm_distribution_history']/table/thead/tr/th[5] Action recipients
verifyText //*[@id='tab_history:cm_distribution_history']/table/tbody/tr/td[5]/div/pre John Doe (Nuxeo)
verifyText //*[@id='tab_history:cm_distribution_history']/table/thead/tr/th[6] Copy recipients
verifyText //*[@id='tab_history:cm_distribution_history']/table/tbody/tr/td[6]/div/pre John Smith (Nuxeo)
clickAndWait link=Bree Van de Kaamp (Nuxeo)
clickAndWait link=Sent
verifyElementPresent link=Case incoming mail for John, cc to Smith
clickAndWait link=Case incoming mail for John, cc to Smith
verifyElementPresent link=Incoming mail for John, cc to Smith
clickAndWait link=Incoming mail for John, cc to Smith
verifyTitle Nuxeo Platform - Incoming mail for John, cc to Smith
verifyElementPresent link=Incoming mail for John, cc to Smith
open /nuxeo/logout
open /nuxeo/
type username jdoe
type password jdoe1
clickAndWait Submit
verifyTextPresent jdoe
waitForTextPresent My Mailboxes
clickAndWait link=Test Mailbox
clickAndWait link=Draft
verifyTextNotPresent Case incoming mail for John, cc to Smith
clickAndWait link=Log out
type username jdoe
type password jdoe1
clickAndWait Submit
waitForPageToLoad 15000
verifyTextPresent jdoe
clickAndWait link=John Doe (Nuxeo)
clickAndWait link=Inbox
verifyElementPresent link=Case incoming mail for John, cc to Smith
clickAndWait link=Log out
type username jsmith
type password jsmith1
clickAndWait Submit
waitForPageToLoad 15000
verifyTextPresent jsmith
clickAndWait link=John Smith (Nuxeo)
clickAndWait link=Inbox
verifyElementPresent link=Case incoming mail for John, cc to Smith
clickAndWait link=Log out