background image
<< Multi-Application -Utility function | Multi-Application - SetUpMachine >>
Multi-Application - Notification example 2 explained
<< Multi-Application -Utility function | Multi-Application - SetUpMachine >>
User's Guide
22 M
Notification example 2 explained
// machine and waits to be notified that new mail has arrived.
multitestcase TwoUserNotification ( STRING sMachine1, STRING sMachine2 )
//=== MULTI-APPLICATION SETUP SECTION ===================//
SetUpMachine( sMachine1, CcMail )
SetUpMachine( sMachine2, CcMail, "EnsureInBoxIsEmpty" )
SetMachineData( sMachine1, "Username", "QAtest1" )
SetMachineData( sMachine1, "Password", "QAtest1" )
SetMachineData( sMachine2, "Username", "QAtest2" )
SetMachineData( sMachine2, "Password", "QAtest2" )
//=== TEST BEGINS HERE ==================================//
// Switch to the first machine:
SetMachine( sMachine1 )
// Send mail from user 1 to user 2
SimpleMessage("QAtest2", "Message to user 2", "Message from me to you.")
// Switch to the second machine:
SetMachine( sMachine2 )
// Wait for notification to occur, then acknowledge it:
Verify( CcMailNewMailAlert.Exists( NOTIFICATION_TIMEOUT ), TRUE )
Verify( CcMailNewMailAlert.IsActive(), TRUE, "ALERT" )
// Refresh the In box and check that a message is waiting there:
CcMail.xWindow.GoToInbox.Pick ()
Verify( CcMail.Message.DeleteMessage.IsEnabled(), TRUE,
Notification example 2 explained
The code in this two-user notification test is much the same as the code in the
single-user example, except that the test is distributed across two CcMail
applications. Thus the primary differences in this example are in program
flow. The following is what happens--note that it happens sequentially rather
than concurrently:
Before the test starts: