Debian Codegraph @

testing/web-platform/tests/tools/wave/docs/rest-api/results-api/read.md

raw
1 # `read` - [Results API](../README.md#results-api)
2
3 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.
4
5 ## HTTP Request
6
7 `GET /api/results/<session_token>`
8
9 ## Query Parameters
10
11 | Parameter | Description | Default | Example |
12 | --------- | ------------------------------ | ------- | --------------------------- |
13 | `path` | Path of test directory or file | `/` | `path=/apiOne/test/sub/dir` |
14
15 ## Response Payload
16
17 ```json
18 {
19 "<api_name>": [
20 {
21 "test": "String",
22 "status": "Enum['OK', 'ERROR', 'TIMEOUT', 'NOT_RUN']",
23 "message": "String",
24 "subtests": [
25 {
26 "name": "String",
27 "status": "Enum['PASS', 'FAIL', 'TIMEOUT', 'NOT_RUN']",
28 "message": "String"
29 }
30 ]
31 }
32 ]
33 }
34 ```
35
36 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.
37
38 ## Example
39
40 **Request:**
41
42 `GET /api/results/974c84e0-c35d-11e9-8f8d-47bb5bb0037d?path=/apiOne/test/one.html`
43
44 **Response:**
45
46 ```json
47 {
48 "apiOne": [
49 {
50 "test": "/apiOne/test/one.html",
51 "status": "OK",
52 "message": null,
53 "subtests": [
54 {
55 "name": "Value should be X",
56 "status": "FAIL",
57 "message": "Expected value to be X but got Y"
58 }
59 ]
60 }
61 ]
62 }
63 ```