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
/Start
state. - The user says “well, hello”.
Expected reaction: the bot transitions to the
/Hello
state and replies “Hello there!”. - The user says “What’s the weather?”.
Expected reaction: the bot transitions to the
/Hello/Weather
state.
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:
-
expectedResponse
is 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
expectedResponse
field and separate them with a space:Hello! How are you?
-
-
expectedState
is 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
skip
field 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
/Start
state. - The user says “well, hello”.
Expected reaction: the bot transitions to the
/Hello
state 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
preActions
steps 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/Weather
state.
The alarm
test case:
- The
preActions
steps 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/Alarm
state.
This field is optional.