Test Resources

Create and view the details for tests within a bucket.


Test List

A list of all the tests for this bucket.

Request

GET/buckets/<bucket_key>/tests

Filter Parameters
count integer Maximum number of tests to return. Defaults to 10 if not specified.
offset integer Number of tests to skip when retrieving tests.

Response

Returns a list of tests. The list resource does not contain environments or schedule details. Use the Test Detail resource for full details.

Sample Response Data
{
    "data": [
        {
            "created_at": 1438828991,
            "created_by": {
                "email": "grace@example.com",
                "name": "Grace Hopper",
                "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
            },
            "default_environment_id": "1eeb3695-5d0f-467c-9d51-8b773dce29ba",
            "description": "An internal API!",
            "name": "My Service",
            "id": "9b47981a-98fd-4dac-8f32-c05aa60b8caf"
        }
    ],
    "error": null,
    "meta": {
        "status": "success"
    }
}

Creating Tests

Create one or more tests in this bucket.

Request

POST/buckets/<bucket_key>/tests

POST Body

The POST body must be a JSON object, or an array of JSON objects, with the following parameters.

Data Attributes
name string required Name of this test.
description string optional Human-readable description of the new test.
Sample POST Data for a Single Test
{ 
    "name": "Sample Name",
    "description": "My test description"
}
Sample POST Data for Multiple Tests
[
    { 
        "name": "Sample Name #1",
        "description": "My test description #1"
    },
    {
        "name": "Sample Name #2",
        "description": "My test description #2"
    }
]

Response

Returns test details for the new test with a 201 CREATED status if the test is successfully created. See the Test Detail response.


Test Detail

Retrieve the details of a given test by ID.

Request

GET/buckets/<bucket_key>/tests/<test_id>

Response

Returns a single test resource.

Data Attributes
id The unique identifier for the test.
name The name of the test.
description Long-form description of the test.
default_environment_id The default environment for the test.
steps An ordered list of the steps for the test.
environments A list of environments for the test.
schedules A list of schedules for the test.
Sample Response Data
{
    "data": {
        "created_at": 1438832081,
        "created_by": {
            "email": "grace@example.com",
            "name": "Grace Hopper",
            "id": "4ee15ecc-7fe1-43cb-aa12-ef50420f2cf9"
        },
        "default_environment_id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
        "description": null,
        "environments": [
            {
                "emails": {
                    "notify_all": false,
                    "notify_on": "all",
                    "notify_threshold": 1,
                    "recipients": []
                },
                "initial_variables": {
                    "base_url": "https://api.example.com"
                },
                "integrations": [
                    {
                        "description": "Pagerduty Account",
                        "integration_type": "pagerduty",
                        "id": "53776d9a-4f34-4f1f-9gff-c155dfb6692e"
                    }
                ],
                "name": "Test Settings",
                "parent_environment_id": null,
                "preserve_cookies": false,
                "regions": [
                    "us1"
                ],
                "remote_agents": [],
                "script": "",
                "test_id": "626a024c-f75e-4f57-82d4-104fe443c0f3",
                "id": "a50b63cc-c377-4823-9a95-8b91f12326f2",
                "verify_ssl": true,
                "webhooks": null
            }
        ],
        "last_run": null,
        "name": "Sample Name",
        "schedules": [],
        "steps": [
            {
                "assertions": [
                    {
                        "comparison": "is_equal",
                        "source": "response_status",
                        "value": 200
                    }
                ],
                "auth": {},
                "body": "",
                "form": {},
                "headers": {},
                "method": "GET",
                "note": "",
                "step_type": "request",
                "url": "https://yourapihere.com/",
                "id": "53f8e1fd-0989-491a-9f15-cc055f27d097",
                "variables": []
            }
        ],
        "trigger_url": "http://api.runscope.com/radar/b96ecee2-cce6-4d80-8f07-33ac22a22ebd/trigger",
        "id": "626a024c-f75e-4f57-82d4-104fe443c0f3"
    },
    "error": null,
    "meta": {
        "status": "success"
    }
}

Starting a Test Run

To programmatically initiate a test run, use a Trigger URL.


Modifying Tests

Modify a test's name, description, default environment and its steps. To modify other individual properties of a test, make requests to the steps, environments, and schedules subresources of the test.

Request

PUT/buckets/<bucket_key>/tests/<test_id>

The PUT body for the request must be a JSON-encoded object with following parameters, parameters omitted will not be modified.

name The name of the test.
description Long-form description of the test.
default_environment_id The default environment for the test.
steps An ordered list of the steps for the test.

Response

Returns 201 and the updated test's JSON description if the test is successfully updated.


Deleting Tests

Delete a test, including all steps, schedules, test-specific environments and results.

Request

DELETE/buckets/<bucket_key>/tests/<test_id>

Response

Returns 204 NO CONTENT if the test is successfully deleted.