Debian Codegraph @

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

raw
1 # Downloading and viewing results and reports - [Results API](../README.md#results-api)
2
3 There are multiple methods to download or view reports generated by the WPT
4 Report tool or just the plain json results with the structure as described in
5 the [`create`](./create.md) method of the results API.
6
7 ## 1. `download`
8
9 Downloads all results of a session as ZIP, which other instances of the WMAS
10 Test Runner can import.
11
12 ### HTTP Request
13
14 `GET /api/results/<session_token>/export`
15
16 ### Example
17
18 `GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/export`
19
20 ## 2. `download api`
21
22 Downloads all results of a single API in one json file.
23
24 ### HTTP Request
25
26 `GET /api/results/<session_token>/<api_name>/json`
27
28 ### File Structure
29
30 ```json
31 {
32 "results": [
33 {
34 "test": "String",
35 "status": "Enum['OK', 'ERROR', 'TIMEOUT', 'NOT_RUN']",
36 "message": "String",
37 "subtests": [
38 {
39 "name": "String",
40 "status": "Enum['PASS', 'FAIL', 'TIMEOUT', 'NOT_RUN']",
41 "message": "String"
42 }
43 ]
44 }
45 ]
46 }
47 ```
48
49 Results are structured as explained in the [`create`](./create.md) method of the results API.
50
51 ### Example
52
53 `GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/apiOne/json`
54
55 ## 3. `download all apis`
56
57 Downloads all results of all APIs of a session as zip file containing one json file per API.
58
59 ### HTTP Request
60
61 `GET /api/results/<session_token>/json`
62
63 ### File Structure
64
65 There is one json file per API, each structured as described in the [`download api`](#download-api) method.
66
67 ### Example
68
69 `GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/json`
70
71 ## 4. `view report`
72
73 Returns a URL to a report of an API of a session, generated by the WPT Report tool, which is a static HTML page.
74
75 ### HTTP Request
76
77 `GET /api/results/<session_token>/<api_name>/reporturl`
78
79 ### Example
80
81 `GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/apiOne/reporturl`
82
83 **Response**
84
85 ```json
86 {
87 "uri": "/results/8f7f2fdc-62eb-11ea-8615-b8ca3a7b18ad/2dcontext/all.html"
88 }
89 ```
90
91 ## 5. `view multi report`
92
93 Returns a URL to a report of an API of multiple session, generated by the WPT Report tool, which is a static HTML page.
94
95 ### HTTP Request
96
97 `GET /api/results/<api_name>/reporturl`
98
99 ### Query Parameters
100
101 | Parameter | Description | Default | Example |
102 | --------- | ------------------------------------------------------------ | ------- | -------------------------------- |
103 | `tokens` | Comma separated list of tokens to create a multi report for. | none | `tokens=token_a,token_b,token_c` |
104
105 ### Example
106
107 `GET /api/results/apiOne/reporturl?tokens=8f7f2fdc-62eb-11ea-8615-b8ca3a7b18ad,990b4734-62eb-11ea-a9a5-b8ca3a7b18ad`
108
109 **Response**
110
111 ```json
112 {
113 "uri": "/results/comparison-8f7f2fdc-990b473401488e04/reporturl/all.html"
114 }
115 ```
116
117 ## 6. `download overview`
118
119 Downloads a zip file containing an overview for all APIs results of a session as a static HTML page.
120
121 ### HTTP Request
122
123 `GET /api/results/<session_token>/overview`
124
125 ### Example
126
127 `GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/overview`