En este documento, se describe cómo crear casos de prueba para tus integraciones. Para obtener información sobre los casos de prueba, las configuraciones de prueba admitidas y sus limitaciones, consulta Introducción a los casos de prueba.
Asegúrate de que tu integración esté en el estado DRAFT. Si tu integración está en el estado PUBLISHED, haz clic en Habilitar edición. Se creará una versión nueva en el estado DRAFT en la integración.
En la siguiente figura, se muestra el bloqueo de edición en el editor de integración.
Crea un caso de prueba
Para crear un caso de prueba, selecciona una de las siguientes opciones:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-03 (UTC)"],[],[],null,["# Create test cases\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nCreate test cases\n=================\n\n|\n| **Preview\n| --- Test cases**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis 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](/application-integration/docs/test-cases).\n\nBefore you begin\n----------------\n\n-\n\n To get the permission that\n you need to create test cases,\n\n ask your administrator to grant you the\n\n\n [Application Integration Editor](/iam/docs/roles-permissions/integrations#integrations.integrationEditor) (`roles/integrations.integrationEditor`)\n IAM role on project.\n\n\n For more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\n This predefined role contains the\n ` integrations.googleapis.com/testCases.create`\n permission,\n which is required to\n create test cases.\n\n\n You might also be able to get\n this permission\n with [custom roles](/iam/docs/creating-custom-roles) or\n other [predefined roles](/iam/docs/roles-overview#predefined).\n- 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.\n\n \u003cbr /\u003e\n\n\nCreate a test case\n------------------\n\nTo create a test case, select one of the following options:\n\n### Console\n\n1. In the Google Cloud console, go to the **Application Integration** page.\n\n [Go to Application Integration](https://console.cloud.google.com/integrations)\n2. In the navigation menu, click **Integrations** .\n\n The **Integrations** page appears listing all the integrations available in the Google Cloud project.\n3. Select an existing integration for which you want to create a test. This opens the integration in the *integration editor*.\n\n4. Click **Test Case** and then click **+ Create a new test case** . The **Create test case** pane appears:\n\n \u003cbr /\u003e\n\n\n Then, do the following:\n 1. From the **Trigger** list, select a trigger.\n 2. In the **Test name** field, enter a name for your test.\n 3. Optionally, in the **Description** field, enter a description for your test.\n 4. Click **Create** .\n\n In the Integration editor page, the designer canvas displays **Test case mode is active**.\n5. Configure the test configuration for your [trigger](#configure-test-config-triggers) and [tasks](#configure-test-config-tasks).\n\n### API\n\nCall the [`projects.locations.integrations.versions.testCases.create` method](/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions.testCases/create) and provide any relevant parameters. For example: \n\n```sh\nPOST https://integrations.googleapis.com/v1/{parent=projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/INTEGRATION_VERSION}/testCases\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the Google Cloud project\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the region where the integration is located\n- \u003cvar translate=\"no\"\u003eINTEGRATION_NAME\u003c/var\u003e: the name of the integration\n- \u003cvar translate=\"no\"\u003eINTEGRATION_VERSION\u003c/var\u003e: the version of the integration\n\nThe request body contains the [TestCase](/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions.testCases#TestCase) resource. For example: \n\n```json\n \n{\n \"displayName\": \"example-test-case\",\n \"triggerId\": \"api_trigger/example-trigger\",\n \"testTaskConfigs\": [{\n \"taskNumber\": \"1\",\n \"mockConfig\": {\n \"mockStrategy\": \"NO_MOCK_STRATEGY\"\n },\n \"task\": \"FieldMappingTask\"\n }],\n}\n```\n| **Note:** You cannot edit your integration when the Test Case mode is enabled.\n\nConfigure test configurations\n-----------------------------\n\nAfter creating a test case, you can [configure test configurations](/application-integration/docs/configure-test-cases) for your triggers and tasks.\n\nWhat's next\n-----------\n\n- Learn about [test cases](/application-integration/docs/test-cases).\n- Learn how to do the following:\n\n - [Configure test cases](/application-integration/docs/configure-test-cases).\n - [Copy](/application-integration/docs/manage-test-cases#copy) and [delete](/application-integration/docs/manage-test-cases#delete) test cases.\n - [Run a test case](/application-integration/docs/run-test-cases) and [view test case execution logs](/application-integration/docs/integration-execution-logs#view-integration-execution-logs).\n - [Upload and download test cases](/application-integration/docs/upload-download-test-cases)."]]