Debian Codegraph @

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

raw
1 # Import results - [Results API](../README.md#results-api)
2
3 If enabled, the WMAS Test Runner can import results exported by any arbitrary other instance.
4
5 ## 1. Import session
6
7 Upload results and create a new, finished session
8
9 ### HTTP Request
10
11 ```
12 POST /api/results/import
13 ```
14
15 #### HTTP Response
16
17 If successful, the server responds with the token of the imported session:
18
19 ```json
20 {
21 "token": "String"
22 }
23 ```
24
25 However, if an error occured, the server responds the error message:
26
27 ```json
28 {
29 "error": "String"
30 }
31 ```
32
33 ## 2. Import API results
34
35 Upload a results json file and overwrite results of a specific API.
36
37 ### HTTP Request
38
39 ```
40 POST /api/results/<session_token>/<api_name>/json
41 ```
42
43 ### File structure
44
45 ```json
46 {
47 "results": [
48 {
49 "test": "String",
50 "status": "Enum['OK', 'ERROR', 'TIMEOUT', 'NOT_RUN']",
51 "message": "String",
52 "subtests": [
53 {
54 "name": "String",
55 "status": "Enum['PASS', 'FAIL', 'TIMEOUT', 'NOT_RUN']",
56 "message": "String"
57 }
58 ]
59 }
60 ]
61 }
62 ```
63
64 ### HTTP Response
65
66 If successful, the server responds with status code 200.