Dialog set fields
A file with a dialog set must have the following fields:
Other fields in the file are ignored.
testCase
The name of the test case that contains the step.
A test case can have several steps.
In this case, specify the same value for the steps in the testCase field.
The test case steps are performed in the same order as in the file. If one of the steps is unsuccessful, the following steps are also considered unsuccessful and are not performed.
Example: a test case with several steps
- Table
- CSV
| testCase | comment | request | expectedResponse | expectedState | skip | preActions |
|---|---|---|---|---|---|---|
| weather | /start | /Start | ||||
| weather | well, hello | Hello there! | /Hello | |||
| weather | What’s the weather? | /Hello/Weather |
testCase ,comment ,request ,expectedResponse ,expectedState ,skip ,preActions
weather , ,/start , ,/Start , ,
weather , ,"well, hello" ,Hello there! ,/Hello , ,
weather , ,What's the weather? , ,/Hello/Weather , ,
The weather test case consists of three steps:
- The user says “/start”.
Expected reaction: the bot transitions to the
/Startstate. - The user says “well, hello”.
Expected reaction: the bot transitions to the
/Hellostate and replies “Hello there!”. - The user says “What’s the weather?”.
Expected reaction: the bot transitions to the
/Hello/Weatherstate.
If the field is not filled out, a random identifier is used.
comment
Comment for the step. This field is optional.
request
The user request that the bot will react to.
expectedResponse и expectedState
Bot reaction:
-
expectedResponseis the expected text of bot’s response. The bot can give several responses in a row:-
In one state:
state: Hello
a: Hello!
a: How are you? -
When transitioning between states:
state: Hello
a: Hello!
go!: /Question
state: Question
a: How are you?
In these cases, specify responses in the
expectedResponsefield and separate them with a space:Hello! How are you? -
-
expectedStateis the first state the bot must transition to. Specify the full path. The path must start with/.
A step must have at least one of these fields filled out.
Only filled fields are checked during the test. If the expected values match the received ones, the step is considered successful.
skip
The field determines whether the step is skipped.
Possible values: TRUE, FALSE (default). The value is case-insensitive.
If TRUE, the step is skipped and not checked.
preActions
The name of the test case whose steps will be performed before the current step.
Steps from preActions:
- are not checked and do not affect the test result;
- are always performed, even if their
skipfield is set toTRUE.
Example of preActions usage
- Table
- CSV
| testCase | comment | request | expectedResponse | expectedState | skip | preActions |
|---|---|---|---|---|---|---|
| hello | /start | /Start | ||||
| hello | well, hello | Hello there! | /Hello | |||
| weather | What’s the weather? | /Hello/Weather | hello | |||
| alarm | Set an alarm | /Hello/Alarm | hello |
testCase ,comment ,request ,expectedResponse ,expectedState ,skip ,preActions
hello , ,/start , ,/Start , ,
hello , ,"well, hello" ,Hello there! ,/Hello , ,
weather , ,What's the weather? , ,/Hello/Weather , ,hello
alarm , ,Set an alarm , ,/Hello/Alarm , ,hello
To check the weather or set an alarm, the user must first say “/start” and “well, hello”. If you don’t want to add these steps to the weather and alarm test cases, you can specify them in the hello test case:
- The user says “/start”.
Expected reaction: the bot transitions to the
/Startstate. - The user says “well, hello”.
Expected reaction: the bot transitions to the
/Hellostate and replies “Hello there!”.
You can now perform these steps before the weather and alarm test cases using the preActions field.
The weather test case:
- The
preActionssteps are performed:- The user says “/start”.
- The user says “well, hello”.
- The user says “What’s the weather?”.
Expected reaction: the bot transitions to the
/Hello/Weatherstate.
The alarm test case:
- The
preActionssteps are performed:- The user says “/start”.
- The user says “well, hello”.
- The user says “Set an alarm”.
Expected reaction: the bot transitions to the
/Hello/Alarmstate.
This field is optional.