background image
<< Multi-Application - if-else construct | Multi-Application - Notification example 1 explained >>
Multi-Application - Code for notification example
<< Multi-Application - if-else construct | Multi-Application - Notification example 1 explained >>
User's Guide
395
22 M
ULTI
-A
PPLICATION
T
ESTING
Code for notification example 1
Code for notification example 1
This section contains the complete testcase file for a single-user notification
test. It shows a testing technique for a type of communication frequently used
in client/server applications. The example after this one shows a notification
test between two users running their own copies of the client application.
This illustrates doing the simplest case first and then adding the next level of
complexity when you go from one user to two users. The section after this
test code explains the testing technique.
// ccmail.t
use "ccmail.inc"
LogMeIn()
LogInUser(GetMachineData( NULL, "Username" ),
GetMachineData( NULL, "Password" ) )
//------------------------------------------------------------
multitestcase SingleUserNotification ( STRING sMachine1 optional )
if( sMachine1 == NULL )
sMachine1 = "(local)"
//=== MULTI-APPLICATION SETUP SECTION ===================//
SetUpMachine( sMachine1, CcMail, "EnsureInBoxIsEmpty" )
SetMachineData( sMachine1, "Username", "QAtest1" )
SetMachineData( sMachine1, "Password", "QAtest1" )
SetMultiAppStates()
//=== TEST BEGINS HERE ==================================//
SetMachine( sMachine1 )
SimpleMessage( "QAtest1", "Message to myself", "A message to myself" )
Verify( CcMailNewMailAlert.Exists( NOTIFICATION_TIMEOUT ), TRUE )
Verify( CcMailNewMailAlert.IsActive(), TRUE, "ALERT" )
CcMailNewMailAlert.OK.Click()
CcMail.xWindow.GoToInbox.Pick ()
Verify( CcMail.Message.DeleteMessage.IsEnabled(), TRUE,
"MESSAGE WAITING" )
Note This script continues in "Code for notification example 2" on
page 398.