API - Test run case uploads

Note: All image urls which the API generate are time sensitive and are only valid for a short period of time.

Show

Description: Get the details for a test run case upload.

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

Request: GET

Formats supported: JSON

Params:

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

Response

{ 
....
}

Example ruby request

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

Example Response

Response code: 200

{ 
"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"
},
"medium": {
"name":"thumbnail",
"geometry":"525x390>",
"url":"http://s3.amazonaws.com/path/to/image"
}
}
}

 

Create

Description: Create a new test run case upload and attach to associated test run case.

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

Request: POST (Must be a multipart request)

Formats supported: JSON

Params:

  • project_id - {Integer} The associated project ID (Required)
  • run_id - {Integer} The associated run ID (Required)
  • executed_step_id - {Integer} The test run case ID (Required)
  • id - {Integer} The test run case upload ID (Required)
  • executed_step_upload
    • file - {Image} The image file that you would like to upload (Required)

Response

{ 
....
}

Example ruby request

require 'net/http/post/multipart'
    
url = URI.parse("https://example.api.testlodge.com/v1/projects/1/runs/1/executed_steps/1/executed_step_uploads.json")
      
req = Net::HTTP::Post::Multipart.new url.path,
  "executed_step_upload[file]" => UploadIO.new(File.new("/sample_images/image.jpg"), "image/jpeg", "image.jpg")
    
res = Net::HTTP.start(url.host, url.port) do |http|
  http.request(req)
end

Example Response

Response code: 201

{ 
"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"
},
"medium": {
"name":"thumbnail",
"geometry":"525x390>",
"url":"http://s3.amazonaws.com/path/to/image"
}
}
}

 

Delete

Description: Delete a test run case upload.

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

Request: DELETE

Formats supported: JSON

Params:

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

Response

{ }

Example ruby request

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

Example Response

Response code: 204

{ }

 

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.