Test Automation

The following endpoints enable you to use the Test Automation feature programmatically.

Rate limits

Test Automation resources have the following rate limits:

Quick reference

TypeResourceDescription
POST/api/test_cases/run_requestsRun test cases.
GET/api/test_cases/run_requests/{id}Get the current state of a test case run request.
GET/api/recipes/{recipe_id}/test_casesGet test cases.

Run test cases

Use this endpoint to run test cases. You can specify the test cases to run in the following ways:

  • All test cases of all recipes in a manifest
  • All test cases of all recipes in a project
  • All test cases of all recipes in a folder
  • All test cases belonging to a particular recipe
  • Test cases you specify

This endpoint is asynchronous. You can use the run request id to poll the current state of the request using the /api/test_cases/run_requests/{id} endpoint.

POST /api/test_cases/run_requests

Request body

NameTypeDescription
manifest_idinteger optionalRun test cases for all recipes in the export manifest you specify.
project_idinteger optionalRun test cases for all recipes in the project you specify. Use the list projects endpoint to retrieve the IDs of all projects in your workspace.
folder_idinteger optionalRun test cases for all recipes in the folder you specify.
recipe_idinteger optionalRun all test cases for the recipe you specify.
test_case_idsarray of strings optionalRun specific test cases by ID.

Sample request

shell
curl  -X POST https://www.workato.com/api/test_cases/run_requests \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{
            "manifest_id": "0"
          }'

Sample response

json
{
  "data": {
    "id": "cirr-AHNFkza6-dwMArc",
    "status": "running",
    "user": {
      "id": 0
    },
    "created_at": "2023-06-01T01:40:00.000-07:00",
    "updated_at": "2023-06-01T01:40:00.000-07:00",
    "results": [
      {
        "recipe": {
          "id": 0,
          "name": "string"
        },
        "test_case": {
          "id": "citc-AG48N4xo-g6ccgP",
          "name": "string"
        },
        "job": {
          "id": "j-AHNFpnRa-sMWLYJ"
        },
        "status": "pending"
      }
    ]
  }
}

Get the current state of a test case run request

Get the current state of a test case run request. For completed requests, Workato also returns the test coverage data along with the results.

GET /api/test_cases/run_requests/{id}

URL parameters

NameTypeDescription
idstring requiredThe run request's ID.

Sample request

shell
curl  -X GET https://www.workato.com/api/test_cases/run_requests/{id} \
      -H 'Authorization: Bearer <api_token>'

Sample response

json
{
  "data": {
    "id": "cirr-AHNFkza6-dwMArc",
    "status": "completed",
    "user": {
      "id": 0
    },
    "created_at": "2023-06-01T01:40:00.000-07:00",
    "updated_at": "2023-06-01T01:40:00.000-07:00",
    "coverage": {
      "value": 87.5,
      "total_actions_count": 8,
      "total_visited_actions_count": 7,
      "recipes": [
        {
          "id": 0,
          "version_no": 0,
          "coverage": {
            "value": 87.5,
            "not_visited_actions": [
              {
                "step_number": 4
              }
            ]
          }
        }
      ]
    },
    "results": [
      {
        "recipe": {
          "id": 0,
          "name": "string"
        },
        "test_case": {
          "id": "citc-AG48N4xo-g6ccgP",
          "name": "string"
        },
        "job": {
          "id": "j-AHNFpnRa-sMWLYJ"
        },
        "status": "succeeded"
      }
    ]
  }
}

Get test cases

Returns a collection of test cases belonging to the recipe you specify.

GET  /api/recipes/{recipe_id}/test_cases

URL Parameters

NameTypeDescription
recipe_idinteger requiredThe ID of the recipe you plan to retrieve test case details from.

Sample request

shell
curl  -X GET https://www.workato.com/api/recipes/{recipe_id}/test_cases \
      -H 'Authorization: Bearer <api_token>'

Sample response

json
{
  "data": [
    {
      "id": "citc-AG48N4xo-g6ccgP",
      "created_at": "2023-06-01T01:40:00.000-07:00",
      "updated_at": "2023-06-01T01:40:00.000-07:00",
      "description": "string",
      "name": "string"
    }
  ]
}

Last updated: