summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/tools/wave/docs/rest-api/results-api/download.md
blob: 8cfa7e7531c4666b42a4c1038c895ff280370302 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Downloading and viewing results and reports - [Results API](../README.md#results-api)

There are multiple methods to download or view reports generated by the WPT 
Report tool or just the plain json results with the structure as described in 
the [`create`](./create.md) method of the results API.

## 1. `download`

Downloads all results of a session as ZIP, which other instances of the WMAS 
Test Runner can import.

### HTTP Request

`GET /api/results/<session_token>/export`

### Example

`GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/export`

## 2. `download api`

Downloads all results of a single API in one json file.

### HTTP Request

`GET /api/results/<session_token>/<api_name>/json`

### File Structure

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

Results are structured as explained in the [`create`](./create.md) method of the results API.

### Example

`GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/apiOne/json`

## 3. `download all apis`

Downloads all results of all APIs of a session as zip file containing one json file per API.

### HTTP Request

`GET /api/results/<session_token>/json`

### File Structure

There is one json file per API, each structured as described in the [`download api`](#download-api) method.

### Example

`GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/json`

## 4. `view report`

Returns a URL to a report of an API of a session, generated by the WPT Report tool, which is a static HTML page.

### HTTP Request

`GET /api/results/<session_token>/<api_name>/reporturl`

### Example

`GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/apiOne/reporturl`

**Response**

```json
{
    "uri": "/results/8f7f2fdc-62eb-11ea-8615-b8ca3a7b18ad/2dcontext/all.html"
}
```

## 5. `view multi report`

Returns a URL to a report of an API of multiple session, generated by the WPT Report tool, which is a static HTML page.

### HTTP Request

`GET /api/results/<api_name>/reporturl`

### Query Parameters

| Parameter | Description                                                  | Default | Example                          |
| --------- | ------------------------------------------------------------ | ------- | -------------------------------- |
| `tokens`  | Comma separated list of tokens to create a multi report for. | none    | `tokens=token_a,token_b,token_c` |

### Example

`GET /api/results/apiOne/reporturl?tokens=8f7f2fdc-62eb-11ea-8615-b8ca3a7b18ad,990b4734-62eb-11ea-a9a5-b8ca3a7b18ad`

**Response**

```json
{
    "uri": "/results/comparison-8f7f2fdc-990b473401488e04/reporturl/all.html"
}
```

## 6. `download overview`

Downloads a zip file containing an overview for all APIs results of a session as a static HTML page.

### HTTP Request

`GET /api/results/<session_token>/overview`

### Example

`GET /api/results/f63700a0-c35f-11e9-af33-9e0d4c1f1370/overview`