# REST Resource: projects.locations.agents.testCases

- [Resource: TestCase](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#TestCase)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#TestCase.SCHEMA_REPRESENTATION)
- [TestConfig](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#TestConfig)
  - [JSON representation](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#TestConfig.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#METHODS_SUMMARY)

## Resource: TestCase

Represents a test case.

| JSON representation |
|---|
| ``` { "name": string, "tags": [ string ], "displayName": string, "notes": string, "testConfig": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#TestConfig`) }, "testCaseConversationTurns": [ { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/ConversationTurn`) } ], "creationTime": string, "lastTestResult": { object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases.results#TestCaseResult`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` The unique identifier of the test case. `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/create#google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase` will populate the name automatically. Otherwise use format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/testCases/<TestCaseID>`. |
| `tags[]` | `string` Tags are short descriptions that users may apply to test cases for organizational and filtering purposes. Each tag should start with "#" and has a limit of 30 characters. |
| `displayName` | `string` Required. The human-readable name of the test case, unique within the agent. Limit of 200 characters. |
| `notes` | `string` Additional freeform notes about the test case. Limit of 400 characters. |
| `testConfig` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases#TestConfig`)`` Config for the test case. |
| `testCaseConversationTurns[]` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/ConversationTurn`)`` The conversation turns uttered when the test case was created, in chronological order. These include the canonical set of agent utterances that should occur when the agent is working properly. |
| `creationTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. When the test was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `lastTestResult` | ``object (`https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases.results#TestCaseResult`)`` The latest test result. |

## TestConfig

Represents configurations for a test case.

| JSON representation |
|---|
| ``` { "trackingParameters": [ string ], "flow": string, "page": string } ``` |

| Fields ||
|---|---|
| `trackingParameters[]` | `string` Session parameters to be compared when calculating differences. |
| `flow` | `string` Flow name to start the test case with. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`. Only one of `flow` and `page` should be set to indicate the starting point of the test case. If neither is set, the test case will start with start page on the default start flow. |
| `page` | `string` The `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.flows.pages#Page` to start the test case with. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`. Only one of `flow` and `page` should be set to indicate the starting point of the test case. If neither is set, the test case will start with start page on the default start flow. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/batchDelete` | Batch deletes test cases. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/batchRun` | Kicks off a batch run of test cases. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/calculateCoverage` | Calculates the test coverage for an agent. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/create` | Creates a test case for the given agent. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/export` | Exports the test cases under the agent to a Cloud Storage bucket or a local file. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/get` | Gets a test case. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/import` | Imports the test cases from a Cloud Storage bucket or a local file. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/list` | Fetches a list of test cases for a given agent. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/patch` | Updates the specified test case. |
| ### `https://docs.cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.testCases/run` | Kicks off a test case run. |