Skip to main content

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
testCasecommentrequestexpectedResponseexpectedStateskippreActions
weather/start/Start
weatherwell, helloHello there!/Hello
weatherWhat’s the weather?/Hello/Weather

The weather test case consists of three steps:

  1. The user says “/start”. Expected reaction: the bot transitions to the /Start state.
  2. The user says “well, hello”. Expected reaction: the bot transitions to the /Hello state and replies “Hello there!”.
  3. 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 to TRUE.
Example of preActions usage
testCasecommentrequestexpectedResponseexpectedStateskippreActions
hello/start/Start
hellowell, helloHello there!/Hello
weatherWhat’s the weather?/Hello/Weatherhello
alarmSet an alarm/Hello/Alarmhello

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:

  1. The user says “/start”. Expected reaction: the bot transitions to the /Start state.
  2. 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:

  1. The preActions steps are performed:
    1. The user says “/start”.
    2. The user says “well, hello”.
  2. The user says “What’s the weather?”. Expected reaction: the bot transitions to the /Hello/Weather state.

The alarm test case:

  1. The preActions steps are performed:
    1. The user says “/start”.
    2. The user says “well, hello”.
  2. The user says “Set an alarm”. Expected reaction: the bot transitions to the /Hello/Alarm state.

This field is optional.