Dokumen ini menjelaskan cara menjalankan kasus pengujian untuk integrasi Anda. Untuk mengetahui informasi tentang kasus pengujian, konfigurasi pengujian yang didukung, dan batasannya, lihat Pengantar kasus pengujian.
Sebelum memulai
Untuk mendapatkan izin yang
diperlukan untuk menjalankan kasus pengujian,
minta administrator Anda untuk memberi Anda
peran IAM Application Integration Invoker (roles/integrations.integrationInvoker)
di project.
Untuk mengetahui informasi selengkapnya tentang cara memberikan peran, lihat Mengelola akses ke project, folder, dan organisasi.
Peran bawaan ini berisi izin integrations.googleapis.com/testCases.invoker, yang diperlukan untuk menjalankan kasus pengujian.
Pastikan Anda memiliki kasus pengujian dalam integrasi. Untuk mengetahui informasi tentang cara membuat kasus pengujian, lihat Membuat Kasus Pengujian.
Menjalankan kasus pengujian
Untuk menjalankan kasus pengujian, pilih salah satu opsi berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 UTC."],[[["\u003cp\u003eThis document guides you through running test cases for Application Integration, providing instructions for both the Google Cloud console and API methods.\u003c/p\u003e\n"],["\u003cp\u003eBefore running test cases, you must have the \u003ccode\u003eApplication Integration Invoker\u003c/code\u003e IAM role to obtain the necessary \u003ccode\u003eintegrations.googleapis.com/testCases.invoker\u003c/code\u003e permission, and you also must ensure a test case exists within the integration.\u003c/p\u003e\n"],["\u003cp\u003eYou can run a test case by navigating to the Application Integration page in the Google Cloud console, selecting an integration, and then choosing a test case from the "Test Cases" pane, where you can set an execution deadline.\u003c/p\u003e\n"],["\u003cp\u003eTest cases can also be run via the API by calling the \u003ccode\u003eprojects.locations.integrations.versions.testCases.executeTest\u003c/code\u003e method with relevant parameters like the project ID, location, integration name, version, and test case ID.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and review the execution logs of your test runs via the "Logs" page to examine the results and debug any issues.\u003c/p\u003e\n"]]],[],null,["# Run test cases\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nRun 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 run 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 run test cases,\n\n ask your administrator to grant you the\n\n\n [Application Integration Invoker](/iam/docs/roles-permissions/integrations#integrations.integrationInvoker) (`roles/integrations.integrationInvoker`)\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.invoker`\n permission,\n which is required to\n run 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 you have a test case in the integration. For information about how to create a test case, see [Create Test Cases](/application-integration/docs/create-test-cases).\n\nRun a test case\n---------------\n\nTo run 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 **Open test cases** . The **Test Cases** pane appears with a list of test cases for the current integration version.\n5. Select the test case that you want to run. In the Integration editor page, the designer canvas displays **Test case mode is active**.\n\n6. Click **play_circleTest** . The **Run test case** page appears. Then, do the following:\n 1. Enter the **Execution deadline**.\n 2. Click **Run test** .\n\n You can view logs for your test cases. To view and inspect the [execution logs](/application-integration/docs/integration-execution-logs) of the test run, click **View logs**.\n\n### API\n\nCall the [`projects.locations.integrations.versions.testCases.executeTest` method](/application-integration/docs/reference/rest/v1/projects.locations.integrations.versions.testCases/executeTest) and provide any relevant parameters. For example: \n\n```\nPOST https://integrations.googleapis.com/v1/{parent=projects/PROJECT_ID/locations/LOCATION/integrations/INTEGRATION_NAME/versions/INTEGRATION_VERSION}/testCases/TEST_CASE_ID:executeTest\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- \u003cvar translate=\"no\"\u003eTEST_CASE_ID\u003c/var\u003e: the ID of the test case that you want run\n\nView test case execution logs\n-----------------------------\n\nYou can view the test case executions logs on the **Logs** page. For information about how to view the logs, see [View execution logs in Application Integration](/application-integration/docs/integration-execution-logs#view-integration-execution-logs).\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 - [Create test cases](/application-integration/docs/create-test-cases).\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 - [Upload and download test cases](/application-integration/docs/upload-download-test-cases)."]]