API - Test runs

List

Description: Provides a paginated list of all test runs within a given project.

Endpoint: <base_url>/projects/{project_id}/runs.json

Request: GET

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • page - {Integer} of the page (Default: 1)
  • user_id - {Integer} Search for test runs that are associated with the given user id
  • status - {Integer} Search for runs with a given status (Default: Null)
    • Options:
      • null - All
      • 0 - Not started
      • 1 - In progress
      • 2 - Complete
  • order - {Integer} of how to order the list (Default: 0)
    • Options:
      • 0 - Created at
      • 1 - Name

Response

{
  "pagination": { .... },
  "runs": [
    { .... },
    { .... }
  ]
}

Example ruby request

HTTParty.get('https://api.testlodge.com/v1/account/1/projects/1/runs.json', query: { order: 1 })

Example Response

Response code: 200

{
  "pagination": {
    "total_entries":2,
    "total_pages":1,
    "current_page":1,
    "next_page":null,
    "previous_page":null,
    "per_page":20
  },
  "runs":[{
    "id":1,
    "name":"Example run",
"incomplete_number":20,
"passed_number":10,
"skipped_number":0,
"failed_number":1,
"user_id":null,
"project_id":1,
"executed_plan_id":null,
    "created_at":"2014-02-26T14:33:58Z",
    "updated_at":"2014-02-26T14:33:58Z"
  },
  { .... }]
}

 

Show

Description: Get the details for a test run.

Endpoint: <base_url>/projects/{project_id}/runs/{id}.json

Request: GET

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • id - {Integer} The test run ID (Required)

Response

{ .... }

Example ruby request

HTTParty.get('https://api.testlodge.com/v1/account/1/projects/1/runs/1.json')

Example Response

Response code: 200

{
"id":1,
  "name":"Example run",
"incomplete_number":20,
"passed_number":10,
"skipped_number":0,
"failed_number":1,
"user_id":null,
"project_id":1,
"executed_plan_id":null,
  "created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Create

Description: Create a new test run.

Endpoint: <base_url>/projects/{project_id}/runs.json

Request: POST

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • run:
    • name - {String} The test run name (Required)
    • plan_id - {Integer} The test plan that you would like associated with this run
    • user_id - {Integer} The user who you would like to be assigned to the run
    • step_ids - {Array of integers} The test case ids that you would like to be included in the run (step_ids or suite_ids is Required)
    • suite_ids - {Array of integers} The test suite ids that you would like to be included in the run (step_ids or suite_ids is Required)

Response

{ .... }

Example ruby request

HTTParty.post('https://api.testlodge.com/v1/account/1/projects/1/runs.json', body: { 
run: {
  name: 'Example run',
plan_id: 1,
step_ids: [1,2,4,5]
suite_ids: [10]
  }
})

Example Response

Response code: 201

{
"id":1,
  "name":"Example run",
"incomplete_number":20,
"passed_number":0,
"skipped_number":0,
"failed_number":0,
"user_id":null,
"project_id":1,
"executed_plan_id":1,
  "created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Update

Description: Update a new test run.

Endpoint: <base_url>/projects/{project_id}/runs/{id}.json

Request: PATCH

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • id - {Integer} The test run ID (Required)
  • run:
    • name - {String} The test test run
    • plan_id - {Integer} The test plan that you would like associated with this run
    • user_id - {Integer} The user who you would like to be assigned to the run

Response

{ .... }

Example ruby request

HTTParty.patch('https://api.testlodge.com/v1/account/1/projects/1/runs/1.json', body: { 
run: {
  name: 'New name'
  }
})

Example Response

Response code: 200

{
"id":1,
  "name":"New name",
"incomplete_number":20,
"passed_number":0,
"skipped_number":0,
"failed_number":0,
"user_id":null,
"project_id":1,
"executed_plan_id":null,
  "created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Delete

Description: Delete a test run.

Endpoint: <base_url>/projects/{project_id}/runs/{id}.json

Request: DELETE

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • id - {Integer} The test run ID (Required)

Response

empty

Example ruby request

HTTParty.delete('https://api.testlodge.com/v1/account/1/projects/1/runs/1.json')

Example Response

Response code: 204

empty
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.