Scripted testing (E2E Testing) | Rasa Documentation

Evaluating Your CALM Assistant

This page covers how to evaluate your CALM assistant comprehensively using end-to-end (E2E) tests. You’ll learn why E2E tests are an essential component of your testing and quality strategy, the difference between qualitative and quantitative assessments, and best practices for writing and running your tests.

You can do 3 types of evaluation in Rasa:

What Is E2E Testing?

End-to-End testing in Rasa checks your assistant as a whole system, from user message to final bot response or action. This includes:

In short, E2E tests act like conversation “blueprints” that must pass unchanged, ensuring your assistant consistently handles the end-to-end user journey.

How to Write E2E Tests

E2E test cases live in YAML files in your project’s tests directory. These can be subdivided for better organization (e.g., tests/e2e_test_cases.yml).

1. Step-Based Test Case Format:

Create a file (e.g., tests/e2e_test_cases.yml) where you include test cases:

Each test_case:

2. Writing Steps

user step
Simulates the user’s message. May optionally include metadata to specify additional context (e.g., device info or session data).

bot or utter step
Checks the expected textual response from the bot.

Slot checks

3. Using Assertions Instead of Steps

If you want more detailed checks, you can use assertions. For example:

test_cases:
  - test_case: flight_booking
    steps:
      - user: "I want to book a flight"
        assertions:
          - flow_started: "flight_booking"
          - bot_uttered:
              utter_name: "utter_ask_destination"
      - user: "New York"
        assertions:
          - slot_was_set:
              - name: "destination"
                value: "New York"

Assertions allow you to check events like flows starting, or to confirm if a generative response is relevant/grounded, among others.

How to Run Tests

Once you have written your E2E tests, you can run them via the CLI using the command: rasa test e2e

Testing Custom Actions

By default, E2E tests call your action server in the background if your endpoints.yml is configured. Make sure the action server is running:


rasa run actions &
rasa test e2e

Interpreting Results

Test Results Analysis

When running test cases with assertions, the test runner provides an accuracy summary for each assertion type in that specific test run. The accuracy is calculated by dividing the number of successful assertions by the total of successful and failed assertions.

To Sum it Up: