Tests API
The Tests resources allow you view the test history associated with the authorized AppHarbor account.
Contents
List Tests
Returns a list of test history items for the specified build
ordered and grouped by id
.
Request
GET /applications/:slug/builds/:build/tests
Response
The item properties are the same as the detail with the addition of the URL for the item detail.
Status: 200 OK
[{
"id": "1",
"name": "FooTest",
"status": "Failed",
"kind": "Group",
"duration": "00:00:03.3852434",
"tests":
[{
"id": "1.1",
"name": "CanCreateFoo",
"status": "Failed",
"kind": "Test",
"duration": "00:00:00.0156002",
"tests": []
},
{
"id": "1.2",
"name": "CanDeleteFoo",
"status": "Passed",
"kind": "Test",
"duration": "00:00:00.0468006",
"tests": []
}]
},
{
"id": "2",
"name": "BarTest",
"status": "Passed",
"kind": "Group",
"duration": "00:00:04.1028526",
"tests": [
{
"id": "2.1",
"name": "CanCreateBar",
"status": "Passed",
"kind": "Test",
"duration": "00:00:00.1248016",
"tests": []
},
{
"id": "2.2",
"name": "CanDeleteBar",
"status": "Skipped",
"kind": "Test",
"duration": "00:00:00.0936012",
"tests": []
}
]
}]
Get Test Detail
Retrieve the test detail for the specified build and test ID.
Note: Test detail items are represented by a tree structure. The
tests
property for items of kind Group
may contain either groups or tests. Items of type Test
will have an empty list for the tests
property as they
cannot contain children.
Request
GET /applications/:slug/builds/:build/tests/:id
Response
Status: 200 OK
{
"id": "3.1",
"name": "ShouldReturnFooWhenBarIsCalled",
"status": "Passed",
"kind": "Test",
"duration": "00:00:00.0312004",
"tests": []
}
Response Properties
id | Unique identifier for the test based on its position in the heirarchy. |
name | Name of the test extracted from the test method. |
status | The test's completion status. Possible values are Passed, Failed, or Skipped. |
kind | The item's type within the heirarchy. Possible values are 'Group' and 'Test'. |
duration | Length of execution time for the test, represented as a TimeSpan. |
tests | If the item is a Group, the child items for the group. |