You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an example repository that showcases using [Currents.dev](https://currents.dev) for sending test results via Currents Generic API.
4
4
@@ -12,18 +12,59 @@ This is an example repository that showcases using [Currents.dev](https://curren
12
12
13
13
14
14
## Key points:
15
-
- The report directory for this project is `postman-tests-example`
16
15
- You have all scripts required to test the Generic API example in the `package.json` file
16
+
- All the examples must have the `instances` folder within their respective example folders. Eg: `postman-tests-example/instances`
17
+
- All the examples must have their respective `config.json` file with the following structure:
18
+
```
19
+
{
20
+
"framework": "junit", // This is mandatory
21
+
"frameworkVersion": "11.10.0", // Your framework's version
22
+
"cliArgs": {
23
+
"options": {
24
+
"jUnitFile": "postman-tests-example/tests.xml" // This is mandatory and must point to the JUnit XML file with the tests results
25
+
},
26
+
"args": []
27
+
},
28
+
"frameworkConfig": {
29
+
"originFramework": "postman", // This is your framework's name
30
+
"originFrameworkVersion": "11.10.0" // This is your framework's version
31
+
}
32
+
}
33
+
```
34
+
- Recognized `originFramework` values in the dashboard are: `postman` for Postman, `vitest` for Vitest and `wdio` for WebDriver.io
35
+
- You can run the `<framework>:full` command for each example to execute all the related commands to the specific example or execute each one of the commands in order to understand what is the purpose of each one.
17
36
18
-
## Scripts:
19
-
-`parse-postman-test`: Transforms `postman-tests-example/tests.json` file into JUnit `postman-tests-example/tests.xml` file
20
-
-`generate-instance-files`: Reads the JUnit XML file in `postman-tests-example/tests.xml` to generate instance JSON files in `postman-tests-example/instances` path.
21
-
-`report-results`: Executes the `currents upload` command to report the test results in the report directory (`postman-tests-example`) to Currents platform.
22
37
23
38
## How to try it?
24
-
1. Get your Record key and Project ID from Currents dashboard.
25
-
2. Execute `node run parse-postman-test`
26
-
3. Execute `node run generate-instance-files`
27
-
4. Replace in the `package.json` file the script called `report-results` with your record key and project ID.
28
-
5. Set a unique CI Build ID in the script from the previous step.
29
-
6. Execute `node run report-results`
39
+
1. Execute `npm run initial-setup` for setting up the needed folders for all the examples.
40
+
2. Get your Record key and Project ID from Currents dashboard.
41
+
3. Put the Record key, Project ID and a unique CI build ID in a `.env` file like this:
42
+
```
43
+
CURRENTS_KEY=your-record-key
44
+
CURRENTS_PROJECT_ID=your-project-id
45
+
CURRENTS_CI_BUILD_ID=unique-id
46
+
```
47
+
48
+
### Postman
49
+
Postman example is in `postman-tests-example` folder.
50
+
The Postman example has the following commands:
51
+
-`parse-postman-test`: Parses the JSON file exported from the Postman collection and turns it into a JUnit XML file. It uses `newman` to transform the file.
52
+
-`gen-instance-postman`: Generates the instance files into `postman-tests-example/instances` folder from the JUnit XML file.
53
+
-`report-results-postman`: Uploads the results to Currents platform.
54
+
-`postman:full`: Executes all the postman example related commands consecutively in the right order.
55
+
56
+
### Vitest
57
+
Vitest example is in `vitest-example` folder.
58
+
The Vitest example has the following commands:
59
+
-`test-vitest`: Executes the vitest tests and outputs the result into a JUnit XML file.
60
+
-`gen-instance-vitest`: Generates the instance files into `vistes-example/instances` folder from the JUnit XML file.
61
+
-`report-results-vitest`: Uploads the results to Currents platform.
62
+
-`vitest:full`: Executes all the vitest example related commands consecutively in the right order.
63
+
64
+
### WebDriver.io
65
+
WebDriver.io example is in `wdio-example` folder.
66
+
The WebDriver.io example has the following commands:
67
+
-`test-wdio`: Executes the WebDriver.io tests and outputs the result into a JUnit XML file.
68
+
-`gen-instance-wdio`: Generates the instance files into `wdio-example/instances` folder from the JUnit XML file.
69
+
-`report-results-wdio`: Uploads the results to Currents platform.
70
+
-`wdio:full`: Executes all the WebDriver.io example related commands consecutively in the right order.
0 commit comments