Dialogflow ES Unit Testing Framework

Generating test scripts

In Dialogflow CX, test scripts are generated in the simulator (where you can just save the Test case). But you don’t have this option in Dialogflow ES. So you need to generate your own test scripts. And test coverage for pure FAQ chatbots is very different from test coverage for multi-turn chatbots.

How to automatically generate the test script

I have built a tool which allows you to automatically generate the test script for your ES bot. Go to the tool page and click on the “How to Use this Tool” button, or click here to read the tutorial.

Running Test Scripts

Once you have flattened your ES agent ZIP file into a CSV file, you can use it with PyCharm and run your test scripts. In my Improving Dialogflow ES accuracy course, I explain how you can set up automated conversation testing using Python.


Dialogflow CX does have built-in Test Cases. That is one more reason why CX is more powerful and better suited for building complex flows than ES. However, there is no standard framework for ES. If you want to do conversation testing, my suggestion is to

Verbatim vs non-verbatim test phrases

While it might make sense to use an existing training phrase as a test phrase, in practice that is not a good idea. I explain why in this video: