test_cases
Creates, updates, deletes, gets or lists a test_cases
resource.
Overview
Name | test_cases |
Type | Resource |
Id | google.dialogflow.test_cases |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_agents_test_cases_get
- projects_locations_agents_test_cases_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique identifier of the test case. TestCases.CreateTestCase will populate the name automatically. Otherwise use format: projects//locations//agents//testCases/ . |
creationTime | string (google-datetime) | Output only. When the test was created. |
displayName | string | Required. The human-readable name of the test case, unique within the agent. Limit of 200 characters. |
lastTestResult | object | The latest test result. (id: GoogleCloudDialogflowCxV3TestCaseResult) |
notes | string | Additional freeform notes about the test case. Limit of 400 characters. |
tags | array | 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. |
testCaseConversationTurns | array | 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. |
testConfig | object | Config for the test case. (id: GoogleCloudDialogflowCxV3TestConfig) |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique identifier of the test case. TestCases.CreateTestCase will populate the name automatically. Otherwise use format: projects//locations//agents//testCases/ . |
creationTime | string (google-datetime) | Output only. When the test was created. |
displayName | string | Required. The human-readable name of the test case, unique within the agent. Limit of 200 characters. |
lastTestResult | object | The latest test result. (id: GoogleCloudDialogflowCxV3TestCaseResult) |
notes | string | Additional freeform notes about the test case. Limit of 400 characters. |
tags | array | 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. |
testCaseConversationTurns | array | 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. |
testConfig | object | Config for the test case. (id: GoogleCloudDialogflowCxV3TestConfig) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_agents_test_cases_get | select | projectsId , locationsId , agentsId , testCasesId | Gets a test case. | |
projects_locations_agents_test_cases_list | select | projectsId , locationsId , agentsId | pageSize , pageToken , view | Fetches a list of test cases for a given agent. |
projects_locations_agents_test_cases_create | insert | projectsId , locationsId , agentsId | Creates a test case for the given agent. | |
projects_locations_agents_test_cases_patch | update | projectsId , locationsId , agentsId , testCasesId | updateMask | Updates the specified test case. |
projects_locations_agents_test_cases_batch_delete | delete | projectsId , locationsId , agentsId | Batch deletes test cases. | |
projects_locations_agents_test_cases_run | exec | projectsId , locationsId , agentsId , testCasesId | Kicks off a test case run. This method is a long-running operation. The returned Operation type has the following method-specific fields: - metadata : RunTestCaseMetadata - response : RunTestCaseResponse | |
projects_locations_agents_test_cases_batch_run | exec | projectsId , locationsId , agentsId | Kicks off a batch run of test cases. This method is a long-running operation. The returned Operation type has the following method-specific fields: - metadata : BatchRunTestCasesMetadata - response : BatchRunTestCasesResponse | |
projects_locations_agents_test_cases_calculate_coverage | exec | projectsId , locationsId , agentsId | type | Calculates the test coverage for an agent. |
projects_locations_agents_test_cases_import | exec | projectsId , locationsId , agentsId | Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected. This method is a long-running operation. The returned Operation type has the following method-specific fields: - metadata : ImportTestCasesMetadata - response : ImportTestCasesResponse | |
projects_locations_agents_test_cases_export | exec | projectsId , locationsId , agentsId | Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases. This method is a long-running operation. The returned Operation type has the following method-specific fields: - metadata : ExportTestCasesMetadata - response : ExportTestCasesResponse |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
agentsId | string | |
locationsId | string | |
projectsId | string | |
testCasesId | string | |
pageSize | integer (int32) | |
pageToken | string | |
type | string | |
updateMask | string (google-fieldmask) | |
view | string |
SELECT
examples
- projects_locations_agents_test_cases_get
- projects_locations_agents_test_cases_list
Gets a test case.
SELECT
name,
creationTime,
displayName,
lastTestResult,
notes,
tags,
testCaseConversationTurns,
testConfig
FROM google.dialogflow.test_cases
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
AND testCasesId = '{{ testCasesId }}' -- required;
Fetches a list of test cases for a given agent.
SELECT
name,
creationTime,
displayName,
lastTestResult,
notes,
tags,
testCaseConversationTurns,
testConfig
FROM google.dialogflow.test_cases
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND agentsId = '{{ agentsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND view = '{{ view }}';
INSERT
examples
- projects_locations_agents_test_cases_create
- Manifest
Creates a test case for the given agent.
INSERT INTO google.dialogflow.test_cases (
data__name,
data__tags,
data__displayName,
data__notes,
data__testConfig,
data__testCaseConversationTurns,
data__lastTestResult,
projectsId,
locationsId,
agentsId
)
SELECT
'{{ name }}',
'{{ tags }}',
'{{ displayName }}',
'{{ notes }}',
'{{ testConfig }}',
'{{ testCaseConversationTurns }}',
'{{ lastTestResult }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ agentsId }}'
RETURNING
name,
creationTime,
displayName,
lastTestResult,
notes,
tags,
testCaseConversationTurns,
testConfig
;
# Description fields are for documentation purposes
- name: test_cases
props:
- name: projectsId
value: string
description: Required parameter for the test_cases resource.
- name: locationsId
value: string
description: Required parameter for the test_cases resource.
- name: agentsId
value: string
description: Required parameter for the test_cases resource.
- name: name
value: string
description: >
The unique identifier of the test case. TestCases.CreateTestCase will populate the name automatically. Otherwise use format: `projects//locations//agents//testCases/`.
- name: tags
value: array
description: >
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.
- name: displayName
value: string
description: >
Required. The human-readable name of the test case, unique within the agent. Limit of 200 characters.
- name: notes
value: string
description: >
Additional freeform notes about the test case. Limit of 400 characters.
- name: testConfig
value: object
description: >
Config for the test case.
- name: testCaseConversationTurns
value: array
description: >
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.
- name: lastTestResult
value: object
description: >
The latest test result.
UPDATE
examples
- projects_locations_agents_test_cases_patch
Updates the specified test case.
UPDATE google.dialogflow.test_cases
SET
data__name = '{{ name }}',
data__tags = '{{ tags }}',
data__displayName = '{{ displayName }}',
data__notes = '{{ notes }}',
data__testConfig = '{{ testConfig }}',
data__testCaseConversationTurns = '{{ testCaseConversationTurns }}',
data__lastTestResult = '{{ lastTestResult }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND agentsId = '{{ agentsId }}' --required
AND testCasesId = '{{ testCasesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
creationTime,
displayName,
lastTestResult,
notes,
tags,
testCaseConversationTurns,
testConfig;
DELETE
examples
- projects_locations_agents_test_cases_batch_delete
Batch deletes test cases.
DELETE FROM google.dialogflow.test_cases
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND agentsId = '{{ agentsId }}' --required;
Lifecycle Methods
- projects_locations_agents_test_cases_run
- projects_locations_agents_test_cases_batch_run
- projects_locations_agents_test_cases_calculate_coverage
- projects_locations_agents_test_cases_import
- projects_locations_agents_test_cases_export
Kicks off a test case run. This method is a long-running operation. The returned Operation
type has the following method-specific fields: - metadata
: RunTestCaseMetadata - response
: RunTestCaseResponse
EXEC google.dialogflow.test_cases.projects_locations_agents_test_cases_run
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required,
@testCasesId='{{ testCasesId }}' --required
@@json=
'{
"environment": "{{ environment }}"
}';
Kicks off a batch run of test cases. This method is a long-running operation. The returned Operation
type has the following method-specific fields: - metadata
: BatchRunTestCasesMetadata - response
: BatchRunTestCasesResponse
EXEC google.dialogflow.test_cases.projects_locations_agents_test_cases_batch_run
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required
@@json=
'{
"environment": "{{ environment }}",
"testCases": "{{ testCases }}"
}';
Calculates the test coverage for an agent.
EXEC google.dialogflow.test_cases.projects_locations_agents_test_cases_calculate_coverage
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required,
@type='{{ type }}';
Imports the test cases from a Cloud Storage bucket or a local file. It always creates new test cases and won't overwrite any existing ones. The provided ID in the imported test case is neglected. This method is a long-running operation. The returned Operation
type has the following method-specific fields: - metadata
: ImportTestCasesMetadata - response
: ImportTestCasesResponse
EXEC google.dialogflow.test_cases.projects_locations_agents_test_cases_import
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required
@@json=
'{
"gcsUri": "{{ gcsUri }}",
"content": "{{ content }}"
}';
Exports the test cases under the agent to a Cloud Storage bucket or a local file. Filter can be applied to export a subset of test cases. This method is a long-running operation. The returned Operation
type has the following method-specific fields: - metadata
: ExportTestCasesMetadata - response
: ExportTestCasesResponse
EXEC google.dialogflow.test_cases.projects_locations_agents_test_cases_export
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@agentsId='{{ agentsId }}' --required
@@json=
'{
"gcsUri": "{{ gcsUri }}",
"dataFormat": "{{ dataFormat }}",
"filter": "{{ filter }}"
}';