qase-javascript-commons 2.0.0 → 2.0.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/changelog.md
CHANGED
|
@@ -1,14 +1,36 @@
|
|
|
1
|
+
# qase-javascript-commons@2.0.2
|
|
2
|
+
|
|
3
|
+
## What's new
|
|
4
|
+
|
|
5
|
+
Add new step status `skipped` to the test result data.
|
|
6
|
+
Before this fix, the reporter didn't support the `skipped` status for test steps.
|
|
7
|
+
|
|
8
|
+
For ApiV1 the `skipped` status will be converted to `blocked` status.
|
|
9
|
+
For ApiV2 the `skipped` status will be converted to `skipped` status.
|
|
10
|
+
|
|
11
|
+
# qase-javascript-commons@2.0.1
|
|
12
|
+
|
|
13
|
+
## What's new
|
|
14
|
+
|
|
15
|
+
Remove ANSI escape codes from the message and stack trace.
|
|
16
|
+
Before this fix, the reporter added ANSI escape codes to the message and stack trace.
|
|
17
|
+
|
|
18
|
+
```diff
|
|
19
|
+
- Error: [2mexpect([22m[31mreceived[39m[2m).[22mtoBe[2m([22m[32mexpected[39m[2m) // Object.is equality[22m
|
|
20
|
+
+ Error: expect(received).toBe(expected) // Object.is equality
|
|
21
|
+
```
|
|
22
|
+
|
|
1
23
|
# qase-javascript-commons@2.0.0
|
|
2
24
|
|
|
3
25
|
## What's new
|
|
4
26
|
|
|
5
27
|
This is the first release version of the Qase JavaScript SDK.
|
|
6
28
|
It is numbered `2.0.0` (and not `1.0.0`) to match the release series of
|
|
7
|
-
test reporters for Playwright, Cypress, Jest and other frameworks.
|
|
29
|
+
test reporters for Playwright, Cypress, Jest, and other frameworks.
|
|
8
30
|
|
|
9
31
|
### Annotating test with field data
|
|
10
32
|
|
|
11
|
-
Tests can now be annotated with data for system and custom fields in Qase.
|
|
33
|
+
Tests can now be annotated with data for the system and custom fields in Qase.
|
|
12
34
|
This feature is already implemented in the Playwright reporter:
|
|
13
35
|
|
|
14
36
|
```js
|
|
@@ -28,7 +50,7 @@ a standalone result, with its own run history.
|
|
|
28
50
|
### Attachments from files and variables
|
|
29
51
|
|
|
30
52
|
Reporters can now upload attachments of various data types to Qase,
|
|
31
|
-
both from files and
|
|
53
|
+
both from files and variables.
|
|
32
54
|
It enables flexible and meticulous logging, such as collecting full HTTP request data,
|
|
33
55
|
including URL, headers, and payload.
|
|
34
56
|
|
|
@@ -42,7 +64,8 @@ It helps bring test results faster and enables acting on them long before the te
|
|
|
42
64
|
Qase JavaScript SDK brings configuration with config files and environment variables
|
|
43
65
|
to a common standard, used with Qase reporters in all languages and frameworks.
|
|
44
66
|
|
|
45
|
-
For details, see the Configuration
|
|
67
|
+
For details, see the [Configuration](https://github.com/qase-tms/qase-javascript/tree/main/qase-javascript-commons#configuration)
|
|
68
|
+
section in the README.
|
|
46
69
|
|
|
47
70
|
### Latest API
|
|
48
71
|
|
|
@@ -32,6 +32,12 @@ class AbstractReporter {
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
33
33
|
async addTestResult(result) {
|
|
34
34
|
this.logger.logDebug(`Adding test result: ${JSON.stringify(result)}`);
|
|
35
|
+
if (result.execution.stacktrace) {
|
|
36
|
+
result.execution.stacktrace = this.removeAnsiEscapeCodes(result.execution.stacktrace);
|
|
37
|
+
}
|
|
38
|
+
if (result.message) {
|
|
39
|
+
result.message = this.removeAnsiEscapeCodes(result.message);
|
|
40
|
+
}
|
|
35
41
|
if (result.testops_id === null || !Array.isArray(result.testops_id)) {
|
|
36
42
|
this.results.push(result);
|
|
37
43
|
return;
|
|
@@ -55,5 +61,11 @@ class AbstractReporter {
|
|
|
55
61
|
setTestResults(results) {
|
|
56
62
|
this.results = results;
|
|
57
63
|
}
|
|
64
|
+
removeAnsiEscapeCodes(str) {
|
|
65
|
+
const ansiEscapeSequences = new RegExp([
|
|
66
|
+
'\x1B[[(?);]{0,2}(;?\\d)*.',
|
|
67
|
+
].join('|'), 'g');
|
|
68
|
+
return str.replace(ansiEscapeSequences, '');
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
exports.AbstractReporter = AbstractReporter;
|
|
@@ -404,6 +404,7 @@ TestOpsReporter.stepStatusMap = {
|
|
|
404
404
|
[models_1.StepStatusEnum.passed]: qaseio_1.ResultStepStatus.PASSED,
|
|
405
405
|
[models_1.StepStatusEnum.failed]: qaseio_1.ResultStepStatus.FAILED,
|
|
406
406
|
[models_1.StepStatusEnum.blocked]: qaseio_1.ResultStepStatus.BLOCKED,
|
|
407
|
+
[models_1.StepStatusEnum.skipped]: qaseio_1.ResultStepStatus.SKIPPED,
|
|
407
408
|
};
|
|
408
409
|
/**
|
|
409
410
|
* @type {Record<StepStatusEnum, ResultStepStatus>}
|
|
@@ -412,4 +413,5 @@ TestOpsReporter.stepStatusMapV1 = {
|
|
|
412
413
|
[models_1.StepStatusEnum.passed]: qaseio_1.TestStepResultCreateStatusEnum.PASSED,
|
|
413
414
|
[models_1.StepStatusEnum.failed]: qaseio_1.TestStepResultCreateStatusEnum.FAILED,
|
|
414
415
|
[models_1.StepStatusEnum.blocked]: qaseio_1.TestStepResultCreateStatusEnum.BLOCKED,
|
|
416
|
+
[models_1.StepStatusEnum.skipped]: qaseio_1.TestStepResultCreateStatusEnum.BLOCKED,
|
|
415
417
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qase-javascript-commons",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Qase JS Reporters",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"test": "jest --passWithNoTests",
|
|
22
22
|
"clean": "rm -rf dist"
|
|
23
23
|
},
|
|
24
|
-
"author": "Qase Team <
|
|
24
|
+
"author": "Qase Team <support@qase.io>",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"ajv": "^8.12.0",
|