Route Description
GET /test-cases Get list of test cases
GET /test-cases/:testCaseId Get test case details
GET /new-summary Get test case summaries
POST /test-cases Create test case
HEAD /test-cases/:testCaseId Check if test case exists
PUT /test-cases/:testCaseId Update test case
DELETE /test-cases/:testCaseId Delete test case
POST /test-cases/:testCaseId/copy Copy test case

Overview

API routes related to test cases. A test case is a grouping for a related set of configurations, scenarios, gateways, and metric definitions. Think of it like a workspace for grouping related load test configurations and scenarios.

Get list of test cases

Retrieve a list of all test cases to which you have access.

GET /test-cases

Request Parameters

  • down: Whether to include all child objects including scenarios, configurations, gateways, and metric definitions. Defaults to false.
  • deep: Whether to include the child objects of all children (e.g. test executions). Defaults to false.

Sample Response

[
   {
      "id":172,
      "createdAt":"2016-02-18T19:00:04.313Z",
      "updatedAt":"2016-02-18T19:00:04.314Z",
      "name":"Script Demo",
      "active":true
   },
   {
      "id":178,
      "createdAt":"2016-02-29T06:46:59.312Z",
      "updatedAt":"2016-03-09T06:32:41.251Z",
      "name":"DB Test",
      "active":true
   }
]

Get test case details

Retrieve details about a specific test case.

GET /test-cases/:testCaseId

Request Parameters

  • down: Whether to include all child objects including scenarios, configurations, gateways, and metric definitions. Defaults to true.
  • deep: Whether to include the child objects of all children (e.g. test executions). Defaults to true.
  • up: Whether or not to include the parent, the organization details. Defaults to true.
  • includeRunning: Whether or not to include a list of currently running test executions within this test case. Defaults to true.

Sample Response

{
   "id":172,
   "createdAt":"2016-02-18T19:00:04.313Z",
   "updatedAt":"2016-02-18T19:00:04.314Z",
   "name":"Script Demo",
   "active":true,
   "organization":{
      "id":3,
      "createdAt":"2015-08-11T17:40:13.081Z",
      "updatedAt":"2015-11-07T08:44:35.717Z",
      "name":"astramer@gmail.com",
      "email":"astramer@gmail.com",
      "stripeCustomerId":"cus_7HHV0iygStjopu",
      "stripeSubscriptionId":"sub_7HQov05cc5E8sr",
      "public":false,
      "active":true,
      "plan":{
         "id":3,
         "createdAt":"2015-11-05T20:37:49.775Z",
         "updatedAt":"2015-11-05T20:37:49.775Z",
         "name":"Pro",
         "price":399,
         "stripeId":"pro",
         "isPublic":true,
         "description":"[\"2,000 Concurrent Clients Per Test\",\n\"25GB Bandwidth Per Test\",\n\"Unlimited Requests Per Test\",\n\"Unlimited Test Duration\",\n\"Unlimited Results Retention\",\n\"25GB Storage\",\n\"Gold Email Support\"]"
      }
   },
   "gateways":[
      {
         "id":172,
         "createdAt":"2016-02-18T19:00:05.656Z",
         "updatedAt":"2016-02-18T19:00:05.656Z",
         "name":"Default",
         "gatewayType":"Http",
         "active":false,
         "testCase":{
            "id":172,
            "createdAt":"2016-02-18T19:00:04.313Z",
            "updatedAt":"2016-02-18T19:00:04.314Z",
            "name":"Script Demo",
            "active":true
         },
         "keys":[
            {
               "id":317,
               "createdAt":"2016-02-18T19:00:05.658Z",
               "updatedAt":"2016-02-18T19:00:05.658Z",
               "key":"tmcvoecs",
               "url":"http://sample.testable.io",
               "isPrimary":true
            }
         ]
      }
   ],
   "configurations":[
      {
         "id":173,
         "createdAt":"2016-02-18T19:11:51.672Z",
         "updatedAt":"2016-02-18T19:11:51.681Z",
         "name":"5 Users",
         "numRegions":1,
         "regions":[
            {
               "id":1,
               "createdAt":"2015-08-11T17:03:34.761Z",
               "updatedAt":"2015-08-11T17:03:34.761Z",
               "name":"aws-us-east-1",
               "public":true,
               "latitude":39.0436,
               "longitude":-77.4878,
               "description":"AWS N. Virginia",
               "active":true
            }
         ],
         "iterations":20,
         "iterationSleepSecs":10,
         "rampupSecs":0,
         "concurrentClients":5,
         "scriptParams":"{}",
         "isTryItOut":false,
         "active":true,
         "executions":[
            {
               "id":725,
               "createdAt":"2016-03-10T18:57:35.760Z",
               "updatedAt":"2016-03-10T19:00:56.830Z",
               "running":false,
               "allocated":true,
               "startedAt":"2016-03-10T18:57:36.879Z",
               "finishedAt":"2016-03-10T19:00:55.832Z",
               "cancelledByUser":false,
               "completed":true,
               "summaryCalculated":true,
               "limitBreached":false,
               "iterations":20,
               "iterationSleepSecs":10,
               "rampupSecs":0,
               "regions":[
                  {
                     "id":760,
                     "createdAt":"2016-03-10T18:57:35.764Z",
                     "updatedAt":"2016-03-10T19:00:55.817Z",
                     "running":false,
                     "startedAt":"2016-03-10T18:57:37.110Z",
                     "finishedAt":"2016-03-10T19:00:55.817Z",
                     "completed":true,
                     "concurrentClients":5,
                     "actualConcurrentClients":5,
                     "expectedResultCount":100,
                     "region":{
                        "id":1,
                        "createdAt":"2015-08-11T17:03:34.761Z",
                        "updatedAt":"2015-08-11T17:03:34.761Z",
                        "name":"aws-us-east-1",
                        "public":true,
                        "latitude":39.0436,
                        "longitude":-77.4878,
                        "description":"AWS N. Virginia",
                        "active":true
                     },
                     "summary":{
                        "id":258041,
                        "createdAt":"2016-03-10T19:00:56.508Z",
                        "updatedAt":"2016-03-10T19:00:56.508Z",
                        "executionId":725,
                        "executionRegionId":760,
                        "intervalStart":0,
                        "iterationsExecuted":100,
                        "count":200,
                        "concurrentClients":5,
                        "actualConcurrentClients":5,
                        "maxConcurrentClients":5,
                        "metrics":[
                           {
                              "metricDef":"httpResponseCode",
                              "metricType":"Histogram",
                              "metricValueMap":{
                                 "200":100
                              }
                           },
                           {
                              "metricDef":"httpMethod",
                              "metricType":"Histogram",
                              "metricValueMap":{
                                 "GET":100
                              }
                           },
                           {
                              "metricDef":"connectionOpenMs",
                              "metricType":"Timing",
                              "metricValueMap":{
                                 "count":100,
                                 "mean":3,
                                 "min":1,
                                 "p95":17,
                                 "max":33,
                                 "p99":28,
                                 "sd":5,
                                 "p50":2,
                                 "sum":311,
                                 "var":27
                              },
                              "metricUnits":"ms"
                           },
                           {
                              "metricDef":"bandwidth",
                              "metricType":"Counter",
                              "metricValue":17264,
                              "metricUnits":"bytes"
                           },
                           {
                              "metricDef":"success",
                              "metricType":"Counter",
                              "metricValue":200,
                              "metricUnits":"requests"
                           },
                           {
                              "metricDef":"dataPacketsSent",
                              "metricType":"Counter",
                              "metricValue":100,
                              "metricUnits":"packets"
                           },
                           {
                              "metricDef":"connectionCloseMs",
                              "metricType":"Timing",
                              "metricValueMap":{
                                 "count":100,
                                 "mean":6,
                                 "min":3,
                                 "p95":19,
                                 "max":41,
                                 "p99":32,
                                 "sd":5,
                                 "p50":6,
                                 "sum":689,
                                 "var":31
                              },
                              "metricUnits":"ms"
                           },
                           {
                              "metricDef":"tickLatencyMs",
                              "metricType":"Timing",
                              "metricValueMap":{
                                 "count":100,
                                 "mean":123,
                                 "min":123,
                                 "p95":123,
                                 "max":123,
                                 "p99":123,
                                 "sd":0,
                                 "p50":123,
                                 "sum":12300,
                                 "var":0
                              },
                              "metricUnits":"ms"
                           },
                           {
                              "metricDef":"bytesReceived",
                              "metricType":"Counter",
                              "metricValue":9964,
                              "metricUnits":"bytes"
                           },
                           {
                              "metricDef":"dataPacketsReceived",
                              "metricType":"Counter",
                              "metricValue":200,
                              "metricUnits":"packets"
                           },
                           {
                              "metricDef":"firstReceivedMs",
                              "metricType":"Timing",
                              "metricValueMap":{
                                 "count":100,
                                 "mean":6,
                                 "min":3,
                                 "p95":19,
                                 "max":38,
                                 "p99":31,
                                 "sd":5,
                                 "p50":5,
                                 "sum":646,
                                 "var":29
                              },
                              "metricUnits":"ms"
                           },
                           {
                              "metricDef":"bytesSent",
                              "metricType":"Counter",
                              "metricValue":7300,
                              "metricUnits":"bytes"
                           },
                           {
                              "metricDef":"dnsLookupMs",
                              "metricType":"Timing",
                              "metricValueMap":{
                                 "count":100,
                                 "mean":1,
                                 "min":0,
                                 "p95":16,
                                 "max":31,
                                 "p99":27,
                                 "sd":5,
                                 "p50":1,
                                 "sum":193,
                                 "var":27
                              },
                              "metricUnits":"ms"
                           }
                        ]
                     },
                     "chunks":[
                        {
                           "id":725,
                           "executionType":"Main",
                           "agent":"a6e2c1c5-99ad-4dcd-bf82-8ff03a6e5aa0",
                           "createdAt":"2016-03-10T18:57:37.117Z",
                           "updatedAt":"2016-03-10T19:00:55.805Z",
                           "running":false,
                           "startedAt":"2016-03-10T18:57:37.141Z",
                           "finishedAt":"2016-03-10T19:00:55.805Z",
                           "completed":true,
                           "iterations":20,
                           "iterationSleepSecs":10,
                           "rampupSecs":0,
                           "concurrentClients":5,
                           "actualConcurrentClients":5,
                           "completedDurationSecs":0,
                           "completedIterations":0
                        }
                     ]
                  }
               ],
               "concurrentClients":5,
               "actualConcurrentClients":5,
               "expectedResultCount":100,
               "scriptParams":"{}",
               "summary":{
                  "id":257937,
                  "createdAt":"2016-03-10T19:00:56.015Z",
                  "updatedAt":"2016-03-10T19:00:56.015Z",
                  "executionId":725,
                  "intervalStart":0,
                  "iterationsExecuted":100,
                  "count":200,
                  "concurrentClients":5,
                  "actualConcurrentClients":5,
                  "maxConcurrentClients":5,
                  "metrics":[
                     {
                        "metricDef":"httpResponseCode",
                        "metricType":"Histogram",
                        "metricValueMap":{
                           "200":100
                        }
                     },
                     {
                        "metricDef":"httpMethod",
                        "metricType":"Histogram",
                        "metricValueMap":{
                           "GET":100
                        }
                     },
                     {
                        "metricDef":"connectionOpenMs",
                        "metricType":"Timing",
                        "metricValueMap":{
                           "count":100,
                           "mean":3,
                           "min":1,
                           "p95":17,
                           "max":33,
                           "p99":28,
                           "sd":5,
                           "p50":2,
                           "sum":311,
                           "var":27
                        },
                        "metricUnits":"ms"
                     },
                     {
                        "metricDef":"bandwidth",
                        "metricType":"Counter",
                        "metricValue":17264,
                        "metricUnits":"bytes"
                     },
                     {
                        "metricDef":"success",
                        "metricType":"Counter",
                        "metricValue":200,
                        "metricUnits":"requests"
                     },
                     {
                        "metricDef":"dataPacketsSent",
                        "metricType":"Counter",
                        "metricValue":100,
                        "metricUnits":"packets"
                     },
                     {
                        "metricDef":"connectionCloseMs",
                        "metricType":"Timing",
                        "metricValueMap":{
                           "count":100,
                           "mean":6,
                           "min":3,
                           "p95":19,
                           "max":41,
                           "p99":32,
                           "sd":5,
                           "p50":6,
                           "sum":689,
                           "var":31
                        },
                        "metricUnits":"ms"
                     },
                     {
                        "metricDef":"tickLatencyMs",
                        "metricType":"Timing",
                        "metricValueMap":{
                           "count":100,
                           "mean":123,
                           "min":123,
                           "p95":123,
                           "max":123,
                           "p99":123,
                           "sd":0,
                           "p50":123,
                           "sum":12300,
                           "var":0
                        },
                        "metricUnits":"ms"
                     },
                     {
                        "metricDef":"bytesReceived",
                        "metricType":"Counter",
                        "metricValue":9964,
                        "metricUnits":"bytes"
                     },
                     {
                        "metricDef":"dataPacketsReceived",
                        "metricType":"Counter",
                        "metricValue":200,
                        "metricUnits":"packets"
                     },
                     {
                        "metricDef":"firstReceivedMs",
                        "metricType":"Timing",
                        "metricValueMap":{
                           "count":100,
                           "mean":6,
                           "min":3,
                           "p95":19,
                           "max":38,
                           "p99":31,
                           "sd":5,
                           "p50":5,
                           "sum":646,
                           "var":29
                        },
                        "metricUnits":"ms"
                     },
                     {
                        "metricDef":"bytesSent",
                        "metricType":"Counter",
                        "metricValue":7300,
                        "metricUnits":"bytes"
                     },
                     {
                        "metricDef":"dnsLookupMs",
                        "metricType":"Timing",
                        "metricValueMap":{
                           "count":100,
                           "mean":1,
                           "min":0,
                           "p95":16,
                           "max":31,
                           "p99":27,
                           "sd":5,
                           "p50":1,
                           "sum":193,
                           "var":27
                        },
                        "metricUnits":"ms"
                     }
                  ]
               }
            }
         ],
         "script":{
            "id":273,
            "createdAt":"2016-02-18T19:00:46.862Z",
            "updatedAt":"2016-03-09T08:10:44.945Z",
            "name":"Default Scenario",
            "length":97,
            "hasInit":false,
            "hasTeardown":false,
            "scriptType":"Code"
         }
      }
   ],
   "scenarios":[
      {
         "id":273,
         "createdAt":"2016-02-18T19:00:46.862Z",
         "updatedAt":"2016-03-09T08:10:44.945Z",
         "name":"Default Scenario",
         "length":97,
         "hasInit":false,
         "hasTeardown":false,
         "scriptType":"Code"
      }
   ],
   "dataStores":[
      {
         "id":122,
         "createdAt":"2016-03-10T07:18:37.629Z",
         "updatedAt":"2016-03-10T07:18:37.630Z",
         "name":"test.jmx",
         "type":"application/octet-stream",
         "charset":"UTF-8",
         "size":3767,
         "numRows":0,
         "url":"https://dev.testable.io:8000/api/orgs/3/apps/172/data-stores/122/download",
         "thumbnailUrl":"https://dev.testable.io:8000/api/orgs/3/apps/172/data-stores/122/thumbnail",
         "deleteUrl":"https://dev.testable.io:8000/api/orgs/3/apps/172/data-stores/122",
         "deleteType":"DELETE",
         "testCase":{
            "id":172,
            "createdAt":"2016-02-18T19:00:04.313Z",
            "updatedAt":"2016-02-18T19:00:04.314Z",
            "name":"Script Demo",
            "active":true
         }
      }
   ],
   "metricDefs":[
      {
         "id":1723,
         "createdAt":"2016-02-18T19:12:09.685Z",
         "updatedAt":"2016-02-18T19:12:09.685Z",
         "name":"bandwidth",
         "metricType":"Counter",
         "metricUnits":"bytes"
      }
   ]
}

Get test case summaries

Get a summary of all test cases including the latest execution. Includes details of any currently running tests and any tests that are scheduled to run later.

GET /new-summary

Request Parameters

  • includeLatestExecution: Whether or not to include the latest execution. Defaults to true.

Response

{ 
   "testCases": [
      {
         "id":172,
         "createdAt":"2016-02-18T19:00:04.313Z",
         "updatedAt":"2016-02-18T19:00:04.314Z",
         "name":"Script Demo",
         "active":true,
         "firstGatewayKey":{
            "id":317,
            "createdAt":"2016-02-18T19:00:05.658Z",
            "updatedAt":"2016-02-18T19:00:05.658Z",
            "key":"tmcvoecs",
            "url":"http://sample.testable.io",
            "isPrimary":true,
            "gateway":{
               "id":172,
               "createdAt":"2016-02-18T19:00:05.656Z",
               "updatedAt":"2016-02-18T19:00:05.656Z",
               "name":"Default",
               "gatewayType":"Http",
               "active":false
            }
         }
      }
   ],
   "running": [],
   "scheduled": []
}

Create test case

Creates a new test case. Must specify your organization ID which can be found using the GET /orgs/:name route. If a test case with the same name already exists it will update and return the existing test case.

POST /test-cases

Request Body

{
	"name": "New Test Case",
	"org": 3,
   "description": "Optional description with **markdown** support"
}

Response

{
  "id":111,
  "createdAt":"2016-02-18T19:00:04.313Z",
  "updatedAt":"2016-02-18T19:00:04.314Z",
  "name":"New Test Case",
  "active":true,
  "organization":{
      "id":3,
      "createdAt":"2015-08-11T17:40:13.081Z",
      "updatedAt":"2015-11-07T08:44:35.717Z",
      "name":"astramer@gmail.com",
      "email":"astramer@gmail.com",
      "stripeCustomerId":"cus_7HHV0iygStjopu",
      "stripeSubscriptionId":"sub_7HQov05cc5E8sr",
      "public":false,
      "active":true,
      "plan":{
         "id":3,
         "createdAt":"2015-11-05T20:37:49.775Z",
         "updatedAt":"2015-11-05T20:37:49.775Z",
         "name":"Pro",
         "price":399,
         "stripeId":"pro",
         "isPublic":true,
         "description":"[\"2,000 Concurrent Clients Per Test\",\n\"25GB Bandwidth Per Test\",\n\"Unlimited Requests Per Test\",\n\"Unlimited Test Duration\",\n\"Unlimited Results Retention\",\n\"25GB Storage\",\n\"Gold Email Support\"]"
      }
   }
}

Check if test case exists

HEAD /test-cases/:testCaseId

Response

HTTP Status: 200 OK or 404 NOT FOUND

Update test case

Update the test case name. The name must be unique within your account.

PUT /test-cases/:testCaseId

Request Body

{
	"name": "New Name"
}

Response

{
  "id":172,
  "createdAt":"2016-02-18T19:00:04.313Z",
  "updatedAt":"2016-02-18T19:00:04.314Z",
  "name":"New Name",
  "active":true
}

Delete test case

DELETE /test-cases/:testCaseId

Response

The deleted test case

{
  "id":172,
  "createdAt":"2016-02-18T19:00:04.313Z",
  "updatedAt":"2016-02-18T19:00:04.314Z",
  "name":"New Name",
  "active":true
}

Copy test case

Copy a test case including all artifacts it contains (scenarios, confs, recordings, etc).

POST /test-cases/:testCaseId/copy

Parameters

  • name: Required. The name of the new test case.
  • targetOrg: The organization to copy this test case to. Defaults to the current organization of the source test case.

Response

{
  "id":1111,
  "createdAt":"2016-02-18T19:00:04.313Z",
  "updatedAt":"2016-02-18T19:00:04.314Z",
  "name":"New Test Case"
}