Create test cases
This document describes how to create test cases for your integrations. For information about test cases, supported test configurations, and its limitations, see Introduction to test cases .
Before you begin
-
To get the permission that you need to create test cases, ask your administrator to grant you the Application Integration Editor (
roles/integrations.integrationEditor) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations .This predefined role contains the
integrations.googleapis.com/testCases.createpermission, which is required to create test cases.You might also be able to get this permission with custom roles or other predefined roles .
- Ensure that your integration is in the
DRAFTstate. If your integration is in thePUBLISHEDstate, click Enable Editing . A new version in theDRAFTstate is created in the integration for you. The following figure shows the edit lock in the integration editor.

Create a test case
To create a test case, select one of the following options:Console
- In the Google Cloud console, go to the Application Integration page.
- In the navigation menu, click Integrations
.
The Integrations page appears listing all the integrations available in the Google Cloud project.
- Select an existing integration for which you want to create a test.
This opens the integration in the integration editor .
- Click Test Case
and then click + Create a new test case
. The Create test case
pane appears:

Then, do the following:
- From the Trigger list, select a trigger.
- In the Test name field, enter a name for your test.
- Optionally, in the Description field, enter a description for your test.
- Click Create
.
In the Integration editor page, the designer canvas displays Test case mode is active .
- Configure the test configuration for your trigger and tasks .
API
Call the projects.locations.integrations.versions.testCases.create
method
and provide any relevant parameters. For example:
POST https://integrations.googleapis.com/v1/{parent=projects/ PROJECT_ID /locations/ LOCATION /integrations/ INTEGRATION_NAME /versions/ INTEGRATION_VERSION }/testCases
Replace the following:
-
PROJECT_ID: the ID of the Google Cloud project -
LOCATION: the region where the integration is located -
INTEGRATION_NAME: the name of the integration -
INTEGRATION_VERSION: the version of the integration
The request body contains the TestCase
resource. For example:
{
"displayName": "example-test-case",
"triggerId": "api_trigger/example-trigger",
"testTaskConfigs": [{
"taskNumber": "1",
"mockConfig": {
"mockStrategy": "NO_MOCK_STRATEGY"
},
"task": "FieldMappingTask"
}],
}
Configure test configurations
After creating a test case, you can configure test configurations for your triggers and tasks.
What's next
- Learn about test cases .
-
Learn how to do the following:
- Configure test cases .
- Copy and delete test cases.
- Run a test case and view test case execution logs .
- Upload and download test cases .

