Test scenario syntax
You can use the test scenario syntax to load multiple entity loader and submit multiple event sequence files from a single test file. You can also write tests that can help you check entities and their values.
Purpose
Test scenarios are stored in the Test Scenario folder in the test client project. You create a test scenario to run a set of entity loader and event sequence files to a test server. You can also verify that an entity exists and check the value of the attributes of an entity.Syntax
The following syntax shows the constructs that you can use when you write a test scenario.
[using definitions from "<entity loader file>" ;]
[load entities from "<entity loader file>" ;]
[load entities from:
- "<entity loader file>" ;]
[submit events from "<event sequence file>";]
[submit events from :
- "<event sequence file>" ;]
[continue processing until <date> ;]
[check that <entity> <exists/does not exist> ; ]
[check that for <entity> [identified by <entity id>] :
- <list of tests> ; ]
Construct | Description | Example |
---|---|---|
check that <entity>exists/does not exist |
Detects the existence or absence of a specific entity. |
|
check that for <entity> : <list of tests> ; |
Verifies the expected results of a list of tests on a specified entity. This construct checks that the values of your entity correspond to the values expected in your list of tests. |
|
check that for <entity> identified by <entity id> <list of tests> ; |
Verifies the expected results of a list of tests. This construct checks that the values of entities that have IDs correspond to the values that you expect from your list of tests. |
|
load entities from "<entity loader file>" ; |
Loads entities from a single entity loader file. |
|
load entities from: - "<entity loader file>" ; |
Loads entities from a list of entity loader files. |
|
submit events from "<event sequence file>" ; |
Submits events from a single event sequence file. |
|
submit events from: - "<event sequence file>" ; |
Submits events from a list of event sequence files. |
|
continue processing until <date> |
Simulates the passing of time from the date of the last event in an event sequence to the date and time that you define in the continue processing until <date> construct. |
|
using definitions from: -"<common definitions file>" ; |
Specifies the common definitions file or files from which an entity loader, event sequence, or common definitions file uses the definitions. When you use this construct, it must be used in the header of the file and precede all of the other constructs. |
|
Example
In the following example, the scenario file includes two entity loader files that are named customer_ids and items, and an event sequence file named purchases.
load entities from:
- "customer_ids"
- "items" ;
submit events from "purchases" ;
check that pencil exists ;
check that for the customer identified by "Betty" :
- the age of this customer is between 18 and 65
- the address of this customer is not null
- the phone number of this customer is not null ;