- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- CoverageType
- IntentCoverage
- Intent
- TransitionCoverage
- Transition
- TransitionNode
- TransitionRouteGroupCoverage
- Coverage
- Transition
- Try it!
Calculates the test coverage for an agent.
HTTP request
GET https://{endpoint}/v3/{agent=projects/*/locations/*/agents/*}/testCases:calculateCoverage
Where {endpoint} is one of the supported service endpoints.
The URLs use gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
| agent | 
 Required. The agent to calculate coverage for. Format:  Authorization requires the following IAM permission on the specified resource  
 | 
Query parameters
| Parameters | |
|---|---|
| type | 
 Required. The type of coverage requested. | 
Request body
The request body must be empty.
Response body
The response message for TestCases.CalculateCoverage.
If successful, the response body contains data with the following structure:
| JSON representation | 
|---|
| { "agent": string, // Union field | 
| Fields | |
|---|---|
| agent | 
 The agent to calculate coverage for. Format:  | 
| Union field coverage_type. The type of coverage requested.coverage_typecan be only one of the following: | |
| intentCoverage | 
 Intent coverage. | 
| transitionCoverage | 
 Transition (excluding transition route groups) coverage. | 
| routeGroupCoverage | 
 Transition route group coverage. | 
Authorization scopes
Requires one of the following OAuth scopes:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/dialogflow
For more information, see the Authentication Overview.
CoverageType
The type of coverage score requested.
| Enums | |
|---|---|
| COVERAGE_TYPE_UNSPECIFIED | Should never be used. | 
| INTENT | Intent coverage. | 
| PAGE_TRANSITION | Page transition coverage. | 
| TRANSITION_ROUTE_GROUP | Transition route group coverage. | 
IntentCoverage
Intent coverage represents the percentage of all possible intents in the agent that are triggered in any of a parent's test cases.
| JSON representation | 
|---|
| {
  "intents": [
    {
      object ( | 
| Fields | |
|---|---|
| intents[] | 
 The list of Intents present in the agent | 
| coverageScore | 
 The percent of intents in the agent that are covered. | 
Intent
The agent's intent.
| JSON representation | 
|---|
| { "intent": string, "covered": boolean } | 
| Fields | |
|---|---|
| intent | 
 The intent full resource name | 
| covered | 
 Whether the intent is covered by at least one of the agent's test cases. | 
TransitionCoverage
Transition coverage represents the percentage of all possible page transitions (page-level transition routes and event handlers, excluding transition route groups) present within any of a parent's test cases.
| JSON representation | 
|---|
| {
  "transitions": [
    {
      object ( | 
| Fields | |
|---|---|
| transitions[] | 
 The list of Transitions present in the agent. | 
| coverageScore | 
 The percent of transitions in the agent that are covered. | 
Transition
A transition in a page.
| JSON representation | 
|---|
| { "source": { object ( | 
| Fields | |
|---|---|
| source | 
 The start node of a transition. | 
| index | 
 The index of a transition in the transition list. Starting from 0. | 
| target | 
 The end node of a transition. | 
| covered | 
 Whether the transition is covered by at least one of the agent's test cases. | 
| Union field detail. The detailed transition.detailcan be only one of the following: | |
| transitionRoute | 
 Intent route or condition route. | 
| eventHandler | 
 Event handler. | 
TransitionNode
The source or target of a transition.
| JSON representation | 
|---|
| { // Union field | 
| Fields | |
|---|---|
| Union field kind. A TransitionNode can be either a page or a flow.kindcan be only one of the following: | |
| page | 
 Indicates a transition to a  | 
| flow | 
 Indicates a transition to a  | 
TransitionRouteGroupCoverage
Transition route group coverage represents the percentage of all possible transition routes present within any of a parent's test cases. The results are grouped by the transition route group.
| JSON representation | 
|---|
| {
  "coverages": [
    {
      object ( | 
| Fields | |
|---|---|
| coverages[] | 
 Transition route group coverages. | 
| coverageScore | 
 The percent of transition routes in all the transition route groups that are covered. | 
Coverage
Coverage result message for one transition route group.
| JSON representation | 
|---|
| { "routeGroup": { object ( | 
| Fields | |
|---|---|
| routeGroup | 
 Transition route group metadata. Only name and displayName will be set. | 
| transitions[] | 
 The list of transition routes and coverage in the transition route group. | 
| coverageScore | 
 The percent of transition routes in the transition route group that are covered. | 
Transition
A transition coverage in a transition route group.
| JSON representation | 
|---|
| {
  "transitionRoute": {
    object ( | 
| Fields | |
|---|---|
| transitionRoute | 
 Intent route or condition route. | 
| covered | 
 Whether the transition route is covered by at least one of the agent's test cases. |