# Automated tests

## What are *Automated tests*?

*Automated tests* allow you to easily test your application's performance with recognizing user intent and matching to the correct flow (based on your provided routing data), or they allow you to quickly execute saved conversation inputs when running frequent tests with your conversation workflows.

{% @arcade/embed flowId="zonr8jWWfJadNg4aUFmD" url="<https://app.arcade.software/share/zonr8jWWfJadNg4aUFmD>" %}

## Routing (intent recognition)

{% hint style="info" %}
This feature is currently available to enterprise tiers only.
{% endhint %}

To test your application's ability to recognize user intent and invoke the appropriate flow from provided routing data, create a routing test on your application:

* Click *Settings* tab of your application
* Under *Automated tests* section, select *+ New test* under *Routing*
* Enter a test name > Click *Save*
* Select *+ Add test*
* Select :sparkles:*Generate* to ingest training phrases from a flow(s)\*
  * Alternatively, you may skip this option and manually enter an utterance(s) to test
* Review or specify the flows you want to test each utterance against
* Select *Save*

\*If your flow's training data includes custom [*Slots*](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/advanced/slots-custom), the *Generate combinations* toggle ensures all variations of those slot values are simulated in the test.

{% hint style="success" %}
Once satisfied and ready to run your test, select the *Test executions* tab to process your test.
{% endhint %}

#### Execute routing test

To execute a saved routing test, select the test:

* Choose *Test executions* tab > Click *Execute test*
* Once the test completes its run, you may select it to view detailed results

{% @arcade/embed flowId="go05BzZyEmaR5rrkyr0P" url="<https://app.arcade.software/share/go05BzZyEmaR5rrkyr0P>" %}

{% hint style="info" %}
Failed phrases display the expected flow to be matched alongside the actual matched flow:
{% endhint %}

## Automated test *Settings*

Manage custom settings for all AI tests created and executed for your application. Select or create an AI test saved on your application, and choose the test's *Settings* tab:

{% @arcade/embed flowId="bN2e48BlNaBRTHus9Y8j" url="<https://app.arcade.software/share/bN2e48BlNaBRTHus9Y8j>" %}

* *Execute during build*: Automatically triggers your test after each new successful [build](https://docs.nlx.ai/platform/nlx-platform-guide/ai-applications/types/core/broken-reference)
* *Failure threshold*: Indicates the percentage of tests allowed to fail in the whole test suite before a build fails
* *Minimum confidence score*: Minimum confidence score indicates the NLP confidence value each test must achieve before it fails. This applies to every individual test

{% hint style="info" %}
To delete an automated flow recognition test, select the *Delete application test* option under Danger zone.
{% endhint %}

***

## Conversation flow test

To create an automated conversation flow test, begin by opening a Test chat in a flow:

* Select *Resources* in your workspace menu > Click *Flows* > Choose an existing flow
* Select the play icon in the toolbar of Canvas builder
* Provide inputs in the test panel to converse with your application
* To save your sequence of inputs, select the play button :arrow\_forward: icon in the test chat > Choose *+ New automated test*
* Enter a test name
* Click *Save*

Your named automated flow test will now be visible to replay. You may proceed from the point of the save and continue testing the conversation or generate additional automated tests.

{% hint style="info" %}
All saved automated flow tests will be visible from the test panel in the flow or from an application's *Automated tests.*
{% endhint %}
