aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
aster.cloud aster.cloud
  • /
  • Platforms
    • Public Cloud
    • On-Premise
    • Hybrid Cloud
    • Data
  • Architecture
    • Design
    • Solutions
    • Enterprise
  • Engineering
    • Automation
    • Software Engineering
    • Project Management
    • DevOps
  • Programming
    • Learning
  • Tools
  • About
  • Engineering

Test Cases In Dialogflow CX

  • aster.cloud
  • January 31, 2022
  • 3 minute read

As a developer, you want to ensure that as you develop new features for your Dialogflow CX agent, you want to ensure that it passes a fixed number of Test Cases that you have marked as Golden Test Cases. Dialogflow CX not only provides you with a feature to manage a list of Test Cases that you can run against your agent but also understand Test coverage.

This blog post will take a sample Dialogflow Agent and will highlight how you can get started today with not just testing the agent but capturing those test runs as golden test cases, building up a test suite and also understanding test coverage.


Partner with aster.cloud
for your next big idea.
Let us know here.



From our partners:

CITI.IO :: Business. Institutions. Society. Global Political Economy.
CYBERPOGO.COM :: For the Arts, Sciences, and Technology.
DADAHACKS.COM :: Parenting For The Rest Of Us.
ZEDISTA.COM :: Entertainment. Sports. Culture. Escape.
TAKUMAKU.COM :: For The Hearth And Home.
ASTER.CLOUD :: From The Cloud And Beyond.
LIWAIWAI.COM :: Intelligence, Inside and Outside.
GLOBALCLOUDPLATFORMS.COM :: For The World's Computing Needs.
FIREGULAMAN.COM :: For The Fire In The Belly Of The Coder.
ASTERCASTER.COM :: Supra Astra. Beyond The Stars.
BARTDAY.COM :: Prosperity For Everyone.

Sample Agent : ABC Holiday Resorts

We will utilize an existing Agent that has been made available for download here. Go ahead and restore the sample Agent (ABC Holiday Resorts) into a sample Agent project following the steps given over here. Once you have restored the agent, you should be able to see the sample flow that is shown below:

 

The Sample agent has a single flow and the agent currently supports users in three different areas:

  • Get Information on current offers/deals
  • Get Information on current cities in which resorts are present
  • Reserve a vacation in one of the resorts

Given that the objective here is to highlight the Test Cases feature of Dialogflow, the Agent has been kept simple and does not have any external integrations and complex validations.

You can try out the Agent by using the Test Agent feature in Dialogflow CX console with the following phrases:

  • What are the current offers?
  • Where are the resorts?
  • Book a vacation
Read More  CIS Hardening Support In Container-Optimized OS From Google

Test Cases and Coverage

The first up step is to visit the Test Cases feature in Dialogflow CX console. Go to the Manage tab and then the Test Cases section as shown below:

 

\

 

Since we do not have any Test Cases provided as part of the initial restore of the Agent and the fact that we have not captured any so far, the list is empty.

Click on Coverage and you will see the coverage for various Flows, Intents, Route Groups in the Agent. This is also currently not there since we do not have any Test Cases.

 

Capturing a Test Case

We can capture a Test Case via the Test Agent feature in the console. The steps to capture a Test Case is given below:

  • Assuming that your Agent is open in the Dialogflow CX console, click on the Test Agent button.
  • Provide the utterances as you go through the flow.

A sample test case is shown below. This exercises the option of asking the Agent about current offers/deals.

 

Once the flow is complete, click on the Save button.

This will ask you for the Test Cases, which we can provide as shown below and finally click on the Save button. This will save the Test Case.

 

Viewing Test Cases and Coverage

You can view the current list of Test Cases, via the Test Cases link in the Manage Tab, as shown below:

 

There are a couple of Test Cases that we added and you can also check the Coverage by clicking on the Coverage option in the screen above.

Read More  Google Cloud Moves Cloud Client Libraries For Node.js Support For Version 10 To Maintenance

 

The Transition coverage is shown above and you can see the value for Yes for the two test cases that we captured. Additionally, you can also see the Intents coverage via the Intents option above. The screen is shown below:

 

You should go ahead and try out other flows and scenarios via the Test Agent feature. Capture those Test Cases and take a look at the overall coverage. This will ensure that you are testing the transitions and intents and if there are newer versions of the Agent, you can ensure that there is no regression by running these Test Cases at any time via the Run option.

Additionally, if you would like to look at Test Cases in detail, we suggest looking at the prebuilt Agents that are available as part of Dialogflow CX. Import one of the pre-built Agents like Travel : Car Rental Agent or Travel : Baggage Claim Agent and visit the Test Cases.

This concludes our overview of Test Cases in Dialogflow CX. Feel free to reach out to me on Twitter @iRomin for any questions or feedback. Do check out the references in the next section for learning more about Dialogflow CX and Test Cases.

References

  • ABC Holiday Resorts – Sample Agent File
  • Dialogflow CX Documentation
  • Dialogflow CX Testing
  • Dialogflow CX prebuilt Agents
  • Travel : Car Rental Agent
  • Travel : Baggage Claim Agent

 

 

By: Romin Irani (Developer Advocate)
Source: Google Cloud Blog


For enquiries, product placements, sponsorships, and collaborations, connect with us at [email protected]. We'd love to hear from you!

Our humans need coffee too! Your support is highly appreciated, thank you!

aster.cloud

Related Topics
  • Dialogflow CX
  • Google Cloud
You May Also Like
View Post
  • Engineering
  • Technology

Apple supercharges its tools and technologies for developers to foster creativity, innovation, and design

  • June 9, 2025
View Post
  • Engineering

Just make it scale: An Aurora DSQL story

  • May 29, 2025
View Post
  • Engineering
  • Technology

Guide: Our top four AI Hypercomputer use cases, reference architectures and tutorials

  • March 9, 2025
View Post
  • Computing
  • Engineering

Why a decades old architecture decision is impeding the power of AI computing

  • February 19, 2025
View Post
  • Engineering
  • Software Engineering

This Month in Julia World

  • January 17, 2025
View Post
  • Engineering
  • Software Engineering

Google Summer of Code 2025 is here!

  • January 17, 2025
View Post
  • Data
  • Engineering

Hiding in Plain Site: Attackers Sneaking Malware into Images on Websites

  • January 16, 2025
View Post
  • Computing
  • Design
  • Engineering
  • Technology

Here’s why it’s important to build long-term cryptographic resilience

  • December 24, 2024

Stay Connected!
LATEST
  • Send SMS texts with Amazon’s SNS simple notification service
    • July 1, 2025
  • Camping 2
    The Summer Adventures : Camping Essentials
    • June 27, 2025
  • Host a static website on AWS with Amazon S3 and Route 53
    • June 27, 2025
  • Prioritize security from the edge to the cloud
    • June 25, 2025
  • 6 edge monitoring best practices in the cloud
    • June 25, 2025
  • Genome 6
    AlphaGenome: AI for better understanding the genome
    • June 25, 2025
  • 7
    Pure Accelerate 2025: All the news and updates live from Las Vegas
    • June 18, 2025
  • 8
    ‘This was a very purposeful strategy’: Pure Storage unveils Enterprise Data Cloud in bid to unify data storage, management
    • June 18, 2025
  • What is cloud bursting?
    • June 18, 2025
  • 10
    There’s a ‘cloud reset’ underway, and VMware Cloud Foundation 9.0 is a chance for Broadcom to pounce on it
    • June 17, 2025
about
Hello World!

We are aster.cloud. We’re created by programmers for programmers.

Our site aims to provide guides, programming tips, reviews, and interesting materials for tech people and those who want to learn in general.

We would like to hear from you.

If you have any feedback, enquiries, or sponsorship request, kindly reach out to us at:

[email protected]
Most Popular
  • Oracle adds xAI Grok models to OCI
    • June 17, 2025
  • What is confidential computing?
    • June 17, 2025
  • Fine-tune your storage-as-a-service approach
    • June 16, 2025
  • 4
    Advanced audio dialog and generation with Gemini 2.5
    • June 15, 2025
  • Google Cloud, Cloudflare struck by widespread outages
    • June 12, 2025
  • /
  • Technology
  • Tools
  • About
  • Contact Us

Input your search keywords and press Enter.