See the supported connectors for Application Integration.

Manage test cases

This document describes how to manage test cases for your integrations. You can manage your test cases in the following ways:

For information about test cases, supported test configurations, and its limitations, see Introduction to test cases.

Before you begin

  • To get the permissions that you need to manage test cases, ask your administrator to grant you the Application Integration Editor (roles/integrations.integrationEditor) IAM role on project. For more information about granting roles, see Manage access to projects, folders, and organizations.

    This predefined role contains the permissions required to manage test cases. To see the exact permissions that are required, expand the Required permissions section:

    Required permissions

    The following permissions are required to manage test cases:

    • List test cases: integrations.googleapis.com/testCases.get
    • Copy a test case:
      • integrations.googleapis.com/testCases.get
      • integrations.googleapis.com/testCases.create
    • Delete a test case: integrations.googleapis.com/testCases.delete

    You might also be able to get these permissions with custom roles or other predefined roles.

  • Ensure that your integration is in the DRAFT state. If your integration is in the PUBLISHED state, click Enable Editing. A new version in the DRAFT state is created in the integration for you. The following figure shows the edit lock in the integration editor.

    Integrations edit lock Integrations edit lock

  • Ensure that you have a test case in the integration. For information about how to create a test case, see Create Test Cases.

Test Case edit locks

In Application Integration, test cases are design-time entities that are often developed in collaboration with multiple authors. Although a test case can only be actively edited by one author at a time, teams can collaborate on a test case.

If you open the test case that is being edited by another user, the following message appears in the integration editor because only one user can update the test case at a given time:

test-user@gmail.com is currently editing the test case. Edit features are temporarily disabled.

To edit the test case, click Take Over. The following figure shows the edit lock.

Test case edit lock Test case edit lock

List test cases

To list test cases, select one of the following options:

Console

  1. In the Google Cloud console, go to the Application Integration page.

    Go to Application Integration

  2. In the navigation menu, click Integrations.

    The Integrations page appears listing all the integrations available in the Google Cloud project.

  3. Select an existing integration that contains test cases.

    This opens the integration in the integration editor.

  4. Click Test Case and then click Open test cases. The Test Cases pane appears with a list of test cases for the current integration version.

API

Call the projects.locations.integrations.versions.testCases.list method and provide any relevant parameters. For example:

GET 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

Edit a test case

To edit a test case, follow these steps:

  1. In the Google Cloud console, go to the Application Integration page.

    Go to Application Integration

  2. In the navigation menu, click Integrations.

    The Integrations page appears listing all the integrations available in the Google Cloud project.

  3. Select an existing integration that contains test cases.

    This opens the integration in the integration editor.

  4. Click Test Case and then click Open test cases. The Test Cases pane appears with a list of test cases for the current integration version.
  5. Select the test case that you want to edit.

    In the Integration editor page, the designer canvas displays Test case mode is active.

    If a task in the integration is deleted, the test case becomes invalid as shown in the following image:

    Integrations edit lock Integrations edit lock

  6. If a task in the integration is deleted, click Delete to update the test case.
  7. Update the configuration details of the test case and run the test case.

Copy a test case

To create a copy a test case in the same integration, select one of the following options:

Console

  1. In the Google Cloud console, go to the Application Integration page.

    Go to Application Integration

  2. In the navigation menu, click Integrations.

    The Integrations page appears listing all the integrations available in the Google Cloud project.

  3. Select an existing integration that contains test cases.

    This opens the integration in the integration editor.

  4. Click Test Case and then click Open test cases. The Test Cases pane appears with a list of test cases for the current integration version.
  5. Select the test case that you want to copy.

    In the Integration editor page, the designer canvas displays Test case mode is active.

  6. Click Duplicate. The Duplicate the test case page appears. Then, do the following:
    1. In the Test name field, enter the name of the test case.
    2. Optionally, in the Description field, enter a description of the test case.
    3. Click Create. The test case is created in the same integration.

API

Follow these steps:

  • Call the projects.locations.integrations.versions.testCases.get method and provide any relevant parameters. For example:

    GET https://integrations.googleapis.com/v1/{parent=projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/INTEGRATION_VERSION}/testCases/TEST_CASE_ID
    

    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
    • TEST_CASE_ID: the ID of the test case
  • In the output response, copy the text proto of the test case.

  • Call the projects.locations.integrations.versions.testCases.create method and provide the text proto that you copied in the preceding step.

    For example:

    POST https://integrations.googleapis.com/v1/{parent=projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/INTEGRATION_VERSION}/testCases
    

Delete a test case

To delete a test case, select one of the following options:

Console

  1. In the Google Cloud console, go to the Application Integration page.

    Go to Application Integration

  2. In the navigation menu, click Integrations.

    The Integrations page appears listing all the integrations available in the Google Cloud project.

  3. Select an existing integration for which you want to create a test.

    This opens the integration in the integration editor.

  4. Click Test Case and then click Open test cases. The Test Cases pane appears with a list of test cases for the current integration version.
  5. Select the test case that you want to delete.

    In the Integration editor page, the designer canvas displays Test case mode is active.

  6. Click Delete.

API

Call the projects.locations.integrations.versions.testCases.delete method. For example:

DELETE https://integrations.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/INTEGRATION_VERSION/testCases/TEST_CASE_ID

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
  • TEST_CASE_ID: the ID of the test case that you want delete

What's next