Automating agent tests with Testing API and Agentforce DX
Key Takeaway
Agentforce DX can create, deploy, and run agent tests on its own. Without Salesforce CLI, use the Testing API: Metadata API builds and deploys the tests, and Connect API runs them.
You can test Agentforce agents in three ways: through the Testing Center user interface in the org, through commands in Agentforce DX, or through code with the Testing API. Agentforce DX and the Testing API let a team build, deploy, and run agent tests as part of a development workflow instead of by hand.
Three ways to test agents
Choose the method that best fits your workflow and technical needs.
| How you test | Test definition format | |
|---|---|---|
| Testing Center | User interface in the Salesforce org | CSV |
| Agentforce DX | Command line | YAML |
| Testing API | Code | XML |
The test definition format points to the method. For example, a scenario that mentions YAML test definitions points to Agentforce DX.
Agentforce DX and the Testing API both support custom evaluations. When a scenario calls for custom evaluations, pick one of these two methods.