|
'========================================================================================
' Test Name : Open Order
'
' Description : This test verifies that an order can be opened through the Open Order Form window by:
' 1. The Order No.
' 2. The Date of Flight
' 3. The Name of Customer
'
' IMPORTANT NOTE!!! : The flight that is to be opened has to be unique to the database. Therefore, the test uses an array variable
' that can be changed by the tester, which holds all the neccessary information on the flight.
'
' Note : The test will insert the order using insert_order() (flt_lib) and will delete the order when finished. If the order is not successfully
' inserted into the database, the test will terminate.
'
' Date : May 5,2004
'========================================================================================
'=========================== Static Variables and Functions ===========================================================
'Dictionary object to hold flight information for insertion. Like the use of Enum
Dim flight
Set flight = CreateObject("Scripting.Dictionary")
flight.Add "Fly From", "Los Angeles" ' Add some keys and items.
flight.Add "Fly To", "Denver"
flight.Add "Date", "060636" ' meaning 06/06/2036
flight.Add "Flight No.", "1"
flight.Add "Class", "First"
flight.Add "Name", "Kenny Rogers"
flight.Add "Tickets","4"
'ItemDemo = d.Item("c") ' Get the item.
'=================================================================================================================
RunAction "OpenApplication [FlightLib]", oneIteration
RunAction "InsertOrder [FlightLib]", oneIteration, flight("Name") , flight("Fly From"), flight("Fly To"), flight("Date"), flight("Flight No."), flight("Class"), flight("Tickets"), OrderNum
' Updated before the step
RunAction "ClearMainWindow [FlightLib1]", oneIteration
' STEP 1. Opening an order by the Order Number.
RunAction "OpenOrder [FlightLib1]", oneIteration,OrderNum
RunAction "ClearMainWindow [FlightLib1]", oneIteration
' STEP 2. Opening an order by Date of Flight.
RunAction "OpenOrderForm [FlightLib]", oneIteration
Window("Flight Reservation").Dialog("Open Order").Activate
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Flight Date").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinObject("FlightDateEdit").Type flight("Date")
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
'# Checking if application could open order using Date
If Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Exist(2) Then
Reporter.ReportEvent FAIL,"FlightDate: " , " Does not exist in the Database."
Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton("Cancel").Click
Else
Window("Flight Reservation").Dialog("Open Order").Dialog("Search Results").WinButton("OK").Click
Reporter.ReportEvent PASS,"FlightDate: " , " Flight Existed in the DB and opened successfully"
End If
RunAction "ClearMainWindow [FlightLib1]", oneIteration
' STEP 3. Insert an order by Customer Name.
RunAction "OpenOrderForm [FlightLib]", oneIteration
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Customer Name").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("CustomerNameEdit").Set flight("Name")
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
'# Checking if application could open order using Date
If Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Exist(2) Then
Reporter.ReportEvent FAIL,"Name: " , " Such name doesn't exist in the DB."
Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton("Cancel").Click
Else
Window("Flight Reservation").Dialog("Open Order").Dialog("Search Results").WinButton("OK").Click
Reporter.ReportEvent PASS,"FlightDate: " , " Flight Existed in the DB and opened successfully"
End If
RunAction "ClearMainWindow [FlightLib1]", oneIteration
'put the order number
RunAction "DeleteOrder [FlightLib]", oneIteration,OrderNum
'clear window
RunAction "ClearMainWindow [FlightLib1]", oneIteration |
|