How to test your stories

I have created a chatbot using rasa framework. There are number of stories written in it. So if i make change in any one of the stories. I have check the entire flow of my bot again i.e. checking all stories. That becomes a lengthy process. So is there any external tool or in-build functionality which can be used to check the flow of my bot again and agin after i make any change.

Did you look into the testing system of rasa?

Thanks for your reply!

I am using apis in my bot to fetch data. In the process I am using custom actions to fill few slots with json data. As mentioned in rasa testing docs: “If your custom actions append any events to the tracker, this has to be reflected in your end-to-end tests (e.g. by adding slot events to your end-to-end story).”

So should I write complete json data in my test file?

  • intent: intent_value
    • my_custom_action
    • slot{“my_slot”: json_data}

Is there any other way to check the flow of rasa bot?

In the stories, your slot setting event should be the slot value not the entire json (unless the json object is your intended slot). The content of the slot value in stories are examples of slot values for that particular story or intent.

The best way to create stories is to use Rasa X or the interactive mode of Rasa CLI.

Hope that helps~

I am passing a JSON object in a slot value, something like this :

SlotSet(“slot_name” : “[{‘a’:‘1’},{‘b’:‘2’},{‘c’:‘3’}]”)

Now white writing a test story I will have to mention the slot setting event after the action in which that slot value is filled up. So i am writing something like this:

intent: intent_value

  • my_custom_action
  • slot{“my_slot”: “[{‘a’:‘1’},{‘b’:‘2’},{‘c’:‘3’}]”}

But it is not working.

What exactly is the problem? I must admit i don’t have much experience with custom action testing, but it might just be the slot value failing due to not executing the custom action.

Solved! Thanks!

Passed the json itself.