summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/wave/docs/rest-api/results-api/read.md
blob: 66894e69ee9c600cfde7deef7accff9a10d49713 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# `read` - [Results API](../README.md#results-api)

The `read` method of the results API returns all available results of a session, grouped by API. It is possible to filter the results to return by test directory or file.

## HTTP Request

`GET /api/results/<session_token>`

## Query Parameters

| Parameter | Description                    | Default | Example                     |
| --------- | ------------------------------ | ------- | --------------------------- |
| `path`    | Path of test directory or file | `/`     | `path=/apiOne/test/sub/dir` |

## Response Payload

```json
{
  "<api_name>": [
    {
      "test": "String",
      "status": "Enum['OK', 'ERROR', 'TIMEOUT', 'NOT_RUN']",
      "message": "String",
      "subtests": [
        {
          "name": "String",
          "status": "Enum['PASS', 'FAIL', 'TIMEOUT', 'NOT_RUN']",
          "message": "String"
        }
      ]
    }
  ]
}
```

Arrays of results grouped by their respective APIs. Structure of results is the same as described in the [`create`](./create.md) method of the results API.

## Example

**Request:**

`GET /api/results/974c84e0-c35d-11e9-8f8d-47bb5bb0037d?path=/apiOne/test/one.html`

**Response:**

```json
{
  "apiOne": [
    {
      "test": "/apiOne/test/one.html",
      "status": "OK",
      "message": null,
      "subtests": [
        {
          "name": "Value should be X",
          "status": "FAIL",
          "message": "Expected value to be X but got Y"
        }
      ]
    }
  ]
}
```