cypress-qase-reporter 1.3.3 → 1.4.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -45
- package/dist/index.d.ts +10 -4
- package/dist/index.js +277 -119
- package/dist/index.js.map +1 -1
- package/dist/mocha.js +3 -0
- package/dist/mocha.js.map +1 -1
- package/dist/reportBulk.js +174 -0
- package/examples/cypress/fixtures/example.json +5 -0
- package/examples/cypress/integration/sample_spec.js +39 -0
- package/examples/cypress/plugins/index.js +21 -0
- package/examples/cypress/support/commands.js +25 -0
- package/examples/cypress/support/index.js +20 -0
- package/examples/cypress.json +20 -0
- package/examples/package-lock.json +4156 -0
- package/examples/package.json +17 -0
- package/examples/screenshots/screenshot.png +0 -0
- package/package.json +6 -5
- package/docs/stdout.png +0 -0
package/README.md
CHANGED
|
@@ -1,50 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
> # Qase TMS Cypress reporter
|
|
2
|
+
>
|
|
3
|
+
> Publish results simple and easy.
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
5
|
+
## How to integrate
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
npm install cypress-qase-reporter
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
Reporter options (* - required):
|
|
14
|
-
|
|
15
|
-
- *`apiToken` - Token for API access, you can find more information
|
|
16
|
-
[here](https://developers.qase.io/#authentication)
|
|
17
|
-
- *`projectCode` - Code of your project (can be extracted from main
|
|
18
|
-
page of your project: `https://app.qase.io/project/DEMOTR` -
|
|
19
|
-
`DEMOTR` is project code here)
|
|
20
|
-
- `runId` - Run ID from Qase TMS (also can be got from run URL)
|
|
21
|
-
- `logging` [true/false] - Enabled debug logging from reporter or not
|
|
22
|
-
|
|
23
|
-
Example cypress.json config:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{
|
|
27
|
-
"reporter": "cypress-qase-reporter",
|
|
28
|
-
"reporterOptions": {
|
|
29
|
-
"apiToken": "578e3b73a34f06e84eafea103cd44dc24253b2c5",
|
|
30
|
-
"projectCode": "PRJCODE",
|
|
31
|
-
"runId": 45,
|
|
32
|
-
"logging": true
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
You can check example configuration with multiple reporters in [demo project](./demo/cypress.json)
|
|
38
|
-
|
|
39
|
-
Supported ENV variables:
|
|
40
|
-
|
|
41
|
-
- `QASE_REPORT` - You **should** pass this ENV if you want to use
|
|
42
|
-
qase reporter
|
|
43
|
-
- `QASE_RUN_ID` - Pass Run ID from ENV and override reporter options
|
|
44
|
-
- `QASE_RUN_NAME` - Set custom Run name, when new run is created
|
|
45
|
-
- `QASE_RUN_DESCRIPTION` - Set custom Run description, when new run is created
|
|
46
|
-
|
|
47
|
-
## Using Reporter
|
|
11
|
+
## Example of usage
|
|
48
12
|
|
|
49
13
|
If you want to decorate come test with Qase Case ID you could use qase function:
|
|
50
14
|
|
|
@@ -74,13 +38,91 @@ describe('My First Test', () => {
|
|
|
74
38
|
);
|
|
75
39
|
});
|
|
76
40
|
|
|
41
|
+
```
|
|
42
|
+
You should also have an active item in the project settings at
|
|
43
|
+
```
|
|
44
|
+
https://app.qase.io/project/QASE_PROJECT_CODE/settings/options
|
|
45
|
+
```
|
|
46
|
+
option in the `Test Runs` block:
|
|
47
|
+
```
|
|
48
|
+
Allow submitting results in bulk
|
|
49
|
+
```
|
|
50
|
+
If you are going to use several specifications for execution and you have in config
|
|
51
|
+
```bash
|
|
52
|
+
"runComplete": true
|
|
53
|
+
```
|
|
54
|
+
then it is necessary to additionally set in the project settings
|
|
55
|
+
```
|
|
56
|
+
Allow to add results for cases in closed runs.
|
|
77
57
|
```
|
|
78
58
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
To start cypress run with qase reporter run it like this:
|
|
59
|
+
To run tests and create a test run, execute the command (for example from folder examples):
|
|
82
60
|
```bash
|
|
83
61
|
QASE_REPORT=1 npx cypress run
|
|
84
62
|
```
|
|
63
|
+
or
|
|
64
|
+
```bash
|
|
65
|
+
npm test
|
|
66
|
+
```
|
|
67
|
+
<p align="center">
|
|
68
|
+
<img width="65%" src="./examples/screenshots/screenshot.png">
|
|
69
|
+
</p>
|
|
70
|
+
|
|
71
|
+
A test run will be performed and available at:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
https://app.qase.io/run/QASE_PROJECT_CODE
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
Reporter options (* - required):
|
|
80
|
+
|
|
81
|
+
- *`apiToken` - Token for API access, you can find more information
|
|
82
|
+
[here](https://developers.qase.io/#authentication)
|
|
83
|
+
- *`projectCode` - Code of your project (can be extracted from main
|
|
84
|
+
page of your project: `https://app.qase.io/project/DEMOTR` -
|
|
85
|
+
`DEMOTR` is project code here)
|
|
86
|
+
- `runId` - Run ID from Qase TMS (also can be got from run URL)
|
|
87
|
+
- `logging` [true/false] - Enabled debug logging from reporter or not
|
|
88
|
+
- `environmentId` - To execute with the sending of the envinroment information
|
|
89
|
+
- `basePath` - URL Qase.io
|
|
90
|
+
- `screenshotFolder` - Folder for save screenshot cypress,
|
|
91
|
+
- `sendScreenshot` [true/false] - Permission to send screenshots to Qase TMS
|
|
92
|
+
- `runComplete` [true/false] - Permission for automatic completion of the test run
|
|
93
|
+
|
|
94
|
+
Example `cypress.json` config:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"reporter": "cypress-qase-reporter",
|
|
99
|
+
"reporterOptions": {
|
|
100
|
+
"apiToken": "api_key",
|
|
101
|
+
"projectCode": "project_code",
|
|
102
|
+
"runId": 45,
|
|
103
|
+
"logging": true,
|
|
104
|
+
"basePath": "https://api.qase.io/v1"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
You can check example configuration with multiple reporters in [demo project](./demo/cypress.json).
|
|
110
|
+
|
|
111
|
+
Supported ENV variables:
|
|
112
|
+
|
|
113
|
+
- `QASE_REPORT` - You **should** pass this ENV if you want to use
|
|
114
|
+
qase reporter
|
|
115
|
+
- `QASE_RUN_ID` - Pass Run ID from ENV and override reporter options
|
|
116
|
+
- `QASE_RUN_NAME` - Set custom Run name, when new run is created
|
|
117
|
+
- `QASE_RUN_DESCRIPTION` - Set custom Run description, when new run is created
|
|
118
|
+
- `QASE_API_TOKEN` - Token for API access, you can find more information
|
|
119
|
+
[here](https://developers.qase.io/#authentication)
|
|
120
|
+
- `QASE_API_BASE_URL` - URL Qase.io, default value `https://api.qase.io/v1`
|
|
121
|
+
- `QASE_ENVIRONMENT_ID` - To execute with the sending of the envinroment information
|
|
122
|
+
- `QASE_SCREENSHOT_FOLDER` - Folder for save screenshot cypress
|
|
123
|
+
- `QASE_SCREENSHOT_SENDING` - Permission to send screenshots to Qase TMS
|
|
124
|
+
- `QASE_RUN_COMPLETE` - Permission for automatic completion of the test run
|
|
125
|
+
|
|
126
|
+
<!-- references -->
|
|
85
127
|
|
|
86
|
-
|
|
128
|
+
[auth]: https://developers.qase.io/#authentication
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { MochaOptions, Runner, reporters } from 'mocha';
|
|
2
2
|
declare class CypressQaseReporter extends reporters.Base {
|
|
3
|
+
testCasesForPublishingCount: number;
|
|
3
4
|
private api;
|
|
4
5
|
private pending;
|
|
5
|
-
private results;
|
|
6
6
|
private shouldPublish;
|
|
7
|
+
private results;
|
|
7
8
|
private options;
|
|
8
9
|
private runId?;
|
|
10
|
+
private isDisabled;
|
|
11
|
+
private resultsForPublishing;
|
|
9
12
|
constructor(runner: Runner, options: MochaOptions);
|
|
13
|
+
private static getEnv;
|
|
14
|
+
private static getCaseId;
|
|
15
|
+
private static createRunObject;
|
|
16
|
+
private static createHeaders;
|
|
17
|
+
private static getPackageVersion;
|
|
10
18
|
private log;
|
|
11
19
|
private addRunnerListeners;
|
|
12
20
|
private checkProject;
|
|
13
21
|
private createRun;
|
|
14
22
|
private checkRun;
|
|
15
|
-
private getEnv;
|
|
16
23
|
private saveRunId;
|
|
17
|
-
private getCaseId;
|
|
18
24
|
private logTestItem;
|
|
19
|
-
private
|
|
25
|
+
private transformCaseResultToBulkObject;
|
|
20
26
|
}
|
|
21
27
|
export = CypressQaseReporter;
|