API - Test run cases

Additional information

Custom fields

If you have custom fields setup for test run cases within the given project, the custom field data is exposed here. It is recommend that you take a look at the custom field resource documentation which will explain the format and how to match the values to the field names / ID's.

List

Description: Provides a paginated list of all test run cases within a given test run

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

Request: GET

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • run_id - {Integer} The associated run ID (Required)
  • page - {Integer} of the page (Default: 1)

Response

{
  "pagination": { .... },
  "executed_steps": [
    {
....,
"stored_custom_fields": [
{ .... },
{ .... }
],
"custom_fields": [
{ .... },
{ .... }
]
},
{
....,
"stored_custom_fields": [
{ .... },
{ .... }
],
"custom_fields": [
{ .... },
{ .... }
]
}
]
}

Example ruby request

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

Example Response

Response code: 200

{
  "pagination": {
    "total_entries":2,
    "total_pages":1,
    "current_page":1,
    "next_page":null,
    "previous_page":null,
    "per_page":20
  },
  "executed_steps":[{
    "id":1,
"step_number":"TC01",
    "title":"step title",
"description":"Sample body content",
"test_steps":"1: step one. 2: step two",
"expected_result":"Does something",
"stored_custom_fields": [{
"name":"Platform",
"value":"OSX"
}],
"actual_result":"not shown",
"passed":0,
"issue_tracker_ticket_number":"1678",
"position":1,
"run_id":1,
"run_section_id":1,
"last_saved_by_id":2,
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
    "created_at":"2014-02-26T14:33:58Z",
    "updated_at":"2014-02-26T14:33:58Z"
  },
  { .... }]
}

 

Show

Description: Get the details for a test run case.

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

Request: GET

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • run_id - {Integer} The associated run ID (Required)
  • id - {Integer} The test run case ID (Required)
  • include - {Array of Strings} The additional options to include in the response
    • Options:
      • step_uploads - Any files that have been uploaded and associated with the test case (The URL's are time limited and will only be valid for a short amount of time. (roughly 30 seconds))
      • executed_step_uploads - Any files that have been uploaded and associated with the test run case (The URL's are time limited and will only be valid for a short amount of time. (roughly 30 seconds))
      • executed_requirements - Any requirements that have been associated with the given test run case

Response

{ 
....,
"last_saved_by": { .... },
"stored_custom_fields": [
{ .... },
{ .... }
],
"custom_fields": [
{ .... },
{ .... }
],
"step_uploads": [
{ .... },
{ .... }
],
"executed_step_uploads": [
{ .... },
{ .... }
],
"executed_requirements": [
{ .... },
{ .... }
]
}

Example ruby request

HTTParty.get('https://example.api.testlodge.com/v1/projects/1/runs/1/executed_steps/1.json', query: { include: ['step_uploads'] })

Example Response

Response code: 200

{
  "id":1,
"step_number":"TC01",
  "title":"step title",
"description":"Sample body content",
"test_steps":"1: step one. 2: step two",
"expected_result":"Does something",
"stored_custom_fields": [{
"name":"Platform",
"value":"OSX"
}],
"actual_result":"not shown",
"passed":0,
"issue_tracker_ticket_number":"1678",
"position":1,
"run_id":1,
"run_section_id":1,
"last_saved_by_id":2,
"last_saved_by": {
"id":2,
"firstname":"Jon",
"lastname":"Cole",
"email":"jon@example.com",
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
},
"step_uploads": [{
"id":1,
"file_name":"image.jpg",
"content_type": "image/jpeg",
"paths": {
"original": {
"name":"original",
"geometry": null,
"url":"http://s3.amazonaws.com/path/to/image"
},
"thumbnail": {
"name":"thumbnail",
"geometry":"100x100#",
"url":"http://s3.amazonaws.com/path/to/image"
}
}
}],
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
"created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}

 

Update

Description: Update a test run case.

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

Request: PATCH

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • run_id - {Integer} The associated run ID (Required)
  • id - {Integer} The test run case ID (Required)
  • executed_step:
    • actual_result - {Text} Details of what the actual result was
    • passed - {Integer} The result of the test
      • options:
        • 0 - Failed
        • 1 - Passed
        • 2 - Skipped
    • create_issue_tracker_ticket - {Integer} If there is a issue tracker integrated with the project, should a ticket be created if the test has failed
      • options:
        • 0 - No
        • 1 - Yes
    • custom_fields:

Response

{ 
....,
"stored_custom_fields": [
{ .... },
{ .... }
],
"last_saved_by": { .... },
"custom_fields": [
{ .... },
{ .... }
]
}

Example ruby request

HTTParty.patch('https://example.api.testlodge.com/v1/projects/1/runs/1/executed_steps/1.json', body: { 
executed_step: {
  actual_result: 'Does not show',
passed: 0,
create_issue_tracker_ticket: 1,
    custom_fields: {
      field_1: 'Some further details that should be included'
    }

  }
})

Example Response

Response code: 200

{
  "id":1,
"step_number":"TC01",
  "title":"step title",
"description":"Sample body content",
"test_steps":"1: step one. 2: step two",
"expected_result":"Does something",
"stored_custom_fields": [{
"name":"Platform",
"value":"OSX"
}],
"actual_result":"Does not show",
"passed":0,
"issue_tracker_ticket_number":"1678",
"position":1,
"run_id":1,
"run_section_id":1,
"last_saved_by_id":2,
"last_saved_by": {
"id":2,
"firstname":"Jon",
"lastname":"Cole",
"email":"jon@example.com",
"created_at":"2014-02-26T14:33:58Z",
"updated_at":"2014-02-26T14:33:58Z"
},
"custom_fields": [{
"id":1,
"name":"Further details",
"value":"Some further details that should be included"
}],
"created_at":"2014-02-26T14:33:58Z",
  "updated_at":"2014-02-26T14:33:58Z"
}
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.