qase-javascript-commons 2.2.0 → 2.2.1
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 +7 -7
- package/changelog.md +31 -21
- package/dist/reporters/testops-reporter.js +7 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,10 +34,10 @@ All configuration options are listed in the table below:
|
|
|
34
34
|
| Description | Config file | Environment variable | Default value | Required | Possible values |
|
|
35
35
|
|----------------------------------------------------------------------------------------------------------------------------|----------------------------|---------------------------------|-----------------------------------------|----------|----------------------------|
|
|
36
36
|
| **Common** | | | | | |
|
|
37
|
-
| Mode of reporter | `mode` | `QASE_MODE` | `
|
|
37
|
+
| Mode of reporter | `mode` | `QASE_MODE` | `off` | No | `testops`, `report`, `off` |
|
|
38
38
|
| Fallback mode of reporter | `fallback` | `QASE_FALLBACK` | `off` | No | `testops`, `report`, `off` |
|
|
39
|
-
| Environment | `environment` | `QASE_ENVIRONMENT` |
|
|
40
|
-
| Root suite | `rootSuite` | `QASE_ROOT_SUITE` |
|
|
39
|
+
| Environment | `environment` | `QASE_ENVIRONMENT` | undefined | No | Any string |
|
|
40
|
+
| Root suite | `rootSuite` | `QASE_ROOT_SUITE` | undefined | No | Any string |
|
|
41
41
|
| Enable debug logs | `debug` | `QASE_DEBUG` | `False` | No | `True`, `False` |
|
|
42
42
|
| Enable capture logs from `stdout` and `stderr` | `testops.defect` | `QASE_CAPTURE_LOGS` | `False` | No | `True`, `False` |
|
|
43
43
|
| **Qase Report configuration** | | | | | |
|
|
@@ -45,15 +45,15 @@ All configuration options are listed in the table below:
|
|
|
45
45
|
| Path to save the report | `report.connection.path` | `QASE_REPORT_CONNECTION_PATH` | `./build/qase-report` | | |
|
|
46
46
|
| Local report format | `report.connection.format` | `QASE_REPORT_CONNECTION_FORMAT` | `json` | | `json`, `jsonp` |
|
|
47
47
|
| **Qase TestOps configuration** | | | | | |
|
|
48
|
-
| Token for [API access](https://developers.qase.io/#authentication) | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` |
|
|
48
|
+
| Token for [API access](https://developers.qase.io/#authentication) | `testops.api.token` | `QASE_TESTOPS_API_TOKEN` | undefined | Yes | Any string |
|
|
49
49
|
| Qase API host. For enterprise users, specify full address: `api-example.qase.io` | `testops.api.host` | `QASE_TESTOPS_API_HOST` | `qase.io` | No | Any string |
|
|
50
50
|
| Qase enterprise environment | `testops.api.enterprise` | `QASE_TESTOPS_API_ENTERPRISE` | `False` | No | `True`, `False` |
|
|
51
|
-
| Code of your project, which you can take from the URL: `https://app.qase.io/project/DEMOTR` - `DEMOTR` is the project code | `testops.project` | `QASE_TESTOPS_PROJECT` |
|
|
52
|
-
| Qase test run ID | `testops.run.id` | `QASE_TESTOPS_RUN_ID` |
|
|
51
|
+
| Code of your project, which you can take from the URL: `https://app.qase.io/project/DEMOTR` - `DEMOTR` is the project code | `testops.project` | `QASE_TESTOPS_PROJECT` | undefined | Yes | Any string |
|
|
52
|
+
| Qase test run ID | `testops.run.id` | `QASE_TESTOPS_RUN_ID` | undefined | No | Any integer |
|
|
53
53
|
| Qase test run title | `testops.run.title` | `QASE_TESTOPS_RUN_TITLE` | `Automated run <Current date and time>` | No | Any string |
|
|
54
54
|
| Qase test run description | `testops.run.description` | `QASE_TESTOPS_RUN_DESCRIPTION` | `<Framework name> automated run` | No | Any string |
|
|
55
55
|
| Qase test run complete | `testops.run.complete` | `QASE_TESTOPS_RUN_COMPLETE` | `True` | | `True`, `False` |
|
|
56
|
-
| Qase test plan ID | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` |
|
|
56
|
+
| Qase test plan ID | `testops.plan.id` | `QASE_TESTOPS_PLAN_ID` | undefined | No | Any integer |
|
|
57
57
|
| Size of batch for sending test results | `testops.batch.size` | `QASE_TESTOPS_BATCH_SIZE` | `200` | No | Any integer |
|
|
58
58
|
| Enable defects for failed test cases | `testops.defect` | `QASE_TESTOPS_DEFECT` | `False` | No | `True`, `False` |
|
|
59
59
|
|
package/changelog.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
# qase-javascript-commons@2.2.1
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Support `author` field in the test result data.
|
|
6
|
+
You can specify author name or email in fields.
|
|
7
|
+
|
|
1
8
|
# qase-javascript-commons@2.1.3
|
|
2
9
|
|
|
3
10
|
## What's new
|
|
4
11
|
|
|
5
12
|
Reporters will send all data on the results of the autotests. Including the data of the title, the description, etc.
|
|
6
13
|
|
|
7
|
-
|
|
8
14
|
# qase-javascript-commons@2.1.1
|
|
9
15
|
|
|
10
16
|
## What's new
|
|
@@ -21,8 +27,10 @@ Minor release of the commons package
|
|
|
21
27
|
|
|
22
28
|
## What's new
|
|
23
29
|
|
|
24
|
-
- update a `InternalReporterInterface`. Added a new methods `sendResults` and `complete` to send the results and
|
|
25
|
-
|
|
30
|
+
- update a `InternalReporterInterface`. Added a new methods `sendResults` and `complete` to send the results and
|
|
31
|
+
complete the test run.
|
|
32
|
+
- add `StateManager` class to manage and share the state of the reporter between the different instances of the
|
|
33
|
+
reporter.
|
|
26
34
|
|
|
27
35
|
# qase-javascript-commons@2.0.13
|
|
28
36
|
|
|
@@ -37,7 +45,6 @@ Minor release of the commons package
|
|
|
37
45
|
|
|
38
46
|
Support qaseio package version 2.2.0
|
|
39
47
|
|
|
40
|
-
|
|
41
48
|
# qase-javascript-commons@2.0.11
|
|
42
49
|
|
|
43
50
|
## What's new
|
|
@@ -60,7 +67,6 @@ Now the reporter will send the test results only once.
|
|
|
60
67
|
The Cypress calls the `publish` method multiple times for the same test results because of the Cypress architecture.
|
|
61
68
|
It calls the `publish` method for each test file.
|
|
62
69
|
|
|
63
|
-
|
|
64
70
|
# qase-javascript-commons@2.0.9
|
|
65
71
|
|
|
66
72
|
## What's new
|
|
@@ -82,13 +88,15 @@ This option is available in the config file and the `QASE_ROOT_SUITE` env variab
|
|
|
82
88
|
|
|
83
89
|
## What's new
|
|
84
90
|
|
|
85
|
-
Fixed an issue with creating a test run with environment when the reporter ignored the `environment` parameter in the
|
|
91
|
+
Fixed an issue with creating a test run with environment when the reporter ignored the `environment` parameter in the
|
|
92
|
+
configuration.
|
|
86
93
|
|
|
87
94
|
# qase-javascript-commons@2.0.7
|
|
88
95
|
|
|
89
96
|
## What's new
|
|
90
97
|
|
|
91
|
-
Fixed an issue with creating a defect for failed tests when the reporter ignored the `defect` parameter in the
|
|
98
|
+
Fixed an issue with creating a defect for failed tests when the reporter ignored the `defect` parameter in the
|
|
99
|
+
configuration.
|
|
92
100
|
|
|
93
101
|
# qase-javascript-commons@2.0.6
|
|
94
102
|
|
|
@@ -143,7 +151,7 @@ Before this fix, the reporter added ANSI escape codes to the message and stack t
|
|
|
143
151
|
## What's new
|
|
144
152
|
|
|
145
153
|
This is the first release version of the Qase JavaScript SDK.
|
|
146
|
-
It is numbered `2.0.0` (and not `1.0.0`) to match the release series of
|
|
154
|
+
It is numbered `2.0.0` (and not `1.0.0`) to match the release series of
|
|
147
155
|
test reporters for Playwright, Cypress, Jest, and other frameworks.
|
|
148
156
|
|
|
149
157
|
### Annotating test with field data
|
|
@@ -153,9 +161,9 @@ This feature is already implemented in the Playwright reporter:
|
|
|
153
161
|
|
|
154
162
|
```js
|
|
155
163
|
test('Test with annotated fields', () => {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
164
|
+
qase.id(1);
|
|
165
|
+
qase.fields({ 'severity': 'high', 'priority': 'medium' })
|
|
166
|
+
// ...
|
|
159
167
|
});
|
|
160
168
|
```
|
|
161
169
|
|
|
@@ -182,7 +190,8 @@ It helps bring test results faster and enables acting on them long before the te
|
|
|
182
190
|
Qase JavaScript SDK brings configuration with config files and environment variables
|
|
183
191
|
to a common standard, used with Qase reporters in all languages and frameworks.
|
|
184
192
|
|
|
185
|
-
For details, see
|
|
193
|
+
For details, see
|
|
194
|
+
the [Configuration](https://github.com/qase-tms/qase-javascript/tree/main/qase-javascript-commons#configuration)
|
|
186
195
|
section in the README.
|
|
187
196
|
|
|
188
197
|
### Latest API
|
|
@@ -221,17 +230,17 @@ Fixed an issue when the results published before the test run creation.
|
|
|
221
230
|
|
|
222
231
|
Improved debug logging for better testing and reporting errors.
|
|
223
232
|
|
|
224
|
-
-
|
|
225
|
-
-
|
|
233
|
+
- Separate `logger` class for use in reporters, supporting logging to console and files.
|
|
234
|
+
- Extra debug logs in both reporter modes: TestOps and Local.
|
|
226
235
|
|
|
227
236
|
Fixed an issue with duplicate test runs created when the testing framework
|
|
228
237
|
(such as Cypress) uses more than one instance of the Qase reporter.
|
|
229
238
|
Now reporter handles Qase test runs in the following way:
|
|
230
239
|
|
|
231
|
-
1.
|
|
232
|
-
|
|
233
|
-
2.
|
|
234
|
-
|
|
240
|
+
1. The first instance of the reporter creates a Qase test run and stores the run ID
|
|
241
|
+
in the ENV variable `QASE_TESTOPS_RUN_ID`.
|
|
242
|
+
2. Other instances of the reporter read this variable and report test results
|
|
243
|
+
to the existing test run.
|
|
235
244
|
|
|
236
245
|
Nothing has changed in cases when there is a single instance of a reporter or
|
|
237
246
|
when it is using a test run, created with other tools, such as with an API request
|
|
@@ -303,7 +312,7 @@ This commit introduces a way to select the API version to use.
|
|
|
303
312
|
It enables using all new features of v2 JS reporters with the stable v1 API,
|
|
304
313
|
and elso experimenting with the new v2 API.
|
|
305
314
|
|
|
306
|
-
**Warning**: v2 API is still in beta.
|
|
315
|
+
**Warning**: v2 API is still in beta.
|
|
307
316
|
If you want to try the v2 JS reporters, you don't have to enable the new API.
|
|
308
317
|
|
|
309
318
|
To enable using API v2, set an environment variable before running the tests:
|
|
@@ -319,16 +328,17 @@ Such description can be collected from test's location and attributes
|
|
|
319
328
|
or explicitly declared in the test.
|
|
320
329
|
|
|
321
330
|
Add new data models:
|
|
331
|
+
|
|
322
332
|
- Relation
|
|
323
333
|
- Suite
|
|
324
334
|
- SuiteData
|
|
325
335
|
|
|
326
|
-
|
|
327
336
|
# qase-javascript-commons@2.0.0-beta.5
|
|
328
337
|
|
|
329
338
|
## What's new
|
|
330
339
|
|
|
331
|
-
* Update the config of reporters. Added `captureLogs` field. If it is set to `true`, the reporter will capture logs from
|
|
340
|
+
* Update the config of reporters. Added `captureLogs` field. If it is set to `true`, the reporter will capture logs from
|
|
341
|
+
the test framework.
|
|
332
342
|
* Added `getMimeType` function to the commons package. It returns the MIME type of the file by its extension.
|
|
333
343
|
|
|
334
344
|
# qase-javascript-commons@2.0.0-beta.4
|
|
@@ -274,6 +274,13 @@ class TestOpsReporter extends abstract_reporter_1.AbstractReporter {
|
|
|
274
274
|
if (result.fields['layer']) {
|
|
275
275
|
resultCreate.case.layer = result.fields['layer'];
|
|
276
276
|
}
|
|
277
|
+
if (result.fields['author']) {
|
|
278
|
+
const resp = await this.api.authors.getAuthors(result.fields['author']);
|
|
279
|
+
if (resp.data.result?.entities && resp.data.result.entities.length > 0) {
|
|
280
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
281
|
+
resultCreate.author_id = resp.data.result.entities[0]?.author_id ?? null;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
277
284
|
this.logger.logDebug(`Transformed result: ${JSON.stringify(resultCreate)}`);
|
|
278
285
|
return resultCreate;
|
|
279
286
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qase-javascript-commons",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Qase JS Reporters",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"lodash.merge": "^4.6.2",
|
|
34
34
|
"lodash.mergewith": "^4.6.2",
|
|
35
35
|
"mime-types": "^2.1.33",
|
|
36
|
-
"qaseio": "~2.3.
|
|
36
|
+
"qaseio": "~2.3.1",
|
|
37
37
|
"strip-ansi": "^6.0.1",
|
|
38
38
|
"uuid": "^9.0.0"
|
|
39
39
|
},
|