cucumberjs-qase-reporter 2.4.0 → 2.4.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 +18 -0
- package/dist/modules/eventStorage.d.ts +4 -1
- package/dist/modules/eventStorage.js +7 -0
- package/dist/modules/stepConverter.d.ts +7 -2
- package/dist/modules/stepConverter.js +15 -4
- package/dist/reporter.js +3 -0
- package/dist/storage.d.ts +2 -1
- package/dist/storage.js +4 -1
- package/package.json +4 -4
package/changelog.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# cucumberjs-qase-reporter@2.4.2
|
|
2
|
+
|
|
3
|
+
## Security
|
|
4
|
+
|
|
5
|
+
- Bumped `uuid` from `^9.0.1` to `^11.1.1`, closing the advisory on uuid `v3/v5/v6` missing buffer bounds check that downstream consumers (e.g. Dependabot on user repos) saw via this reporter. Only `v4` is used here, so the advisory was not exploitable through this code path, but the version pin matters for users running `npm audit` on their projects.
|
|
6
|
+
|
|
7
|
+
## Changed
|
|
8
|
+
|
|
9
|
+
- `engines.node` raised from `>=14` to `>=18` to match uuid 11+ requirements; Node 14/16 are EOL.
|
|
10
|
+
- Bumped `qase-javascript-commons` pin from `~2.6.0` to `~2.7.2` so users no longer pull the older registry copy of `commons` that depended on uuid 9.
|
|
11
|
+
|
|
12
|
+
# cucumberjs-qase-reporter@2.4.1
|
|
13
|
+
|
|
14
|
+
## Fixed
|
|
15
|
+
|
|
16
|
+
- Gherkin step `execution.start_time` and `execution.end_time` are now populated from the Cucumber `testStepStarted` / `testStepFinished` envelope timestamps (Unix seconds with fractional ms). Previously both fields were hardcoded to `null`, breaking timeline rendering on the Qase side.
|
|
17
|
+
- Step `execution.duration` now includes the `nanos` part of the Cucumber duration. Previously only `seconds * 1000` was emitted, so any sub-second step was reported as 0 ms.
|
|
18
|
+
|
|
1
19
|
# cucumberjs-qase-reporter@2.4.0
|
|
2
20
|
|
|
3
21
|
## Changed
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Attachment as Attach, GherkinDocument, Pickle, TestCaseStarted, TestStepFinished } from '@cucumber/messages';
|
|
1
|
+
import { Attachment as Attach, GherkinDocument, Pickle, TestCaseStarted, TestStepFinished, TestStepStarted } from '@cucumber/messages';
|
|
2
2
|
import { TestCase } from '@cucumber/messages/dist/esm/src/messages';
|
|
3
3
|
import { Attachment } from 'qase-javascript-commons';
|
|
4
4
|
import { ScenarioData } from '../models';
|
|
5
5
|
export declare class EventStorage {
|
|
6
6
|
private pickles;
|
|
7
7
|
private testCaseStarts;
|
|
8
|
+
private testStepStarted;
|
|
8
9
|
private testStepFinished;
|
|
9
10
|
private testCases;
|
|
10
11
|
private scenarios;
|
|
@@ -14,6 +15,7 @@ export declare class EventStorage {
|
|
|
14
15
|
addAttachment(attachment: Attach): void;
|
|
15
16
|
addTestCase(testCase: TestCase): void;
|
|
16
17
|
addTestCaseStarted(testCaseStarted: TestCaseStarted): void;
|
|
18
|
+
addTestStepStarted(step: TestStepStarted): void;
|
|
17
19
|
addTestStepFinished(step: TestStepFinished): void;
|
|
18
20
|
getPickle(id: string): Pickle | undefined;
|
|
19
21
|
getTestCase(id: string): TestCase | undefined;
|
|
@@ -22,6 +24,7 @@ export declare class EventStorage {
|
|
|
22
24
|
getAttachments(key: string): Attachment[];
|
|
23
25
|
getTestStepFinished(id: string): TestStepFinished | undefined;
|
|
24
26
|
getAllTestStepFinished(): Map<string, TestStepFinished>;
|
|
27
|
+
getAllTestStepStarted(): Map<string, TestStepStarted>;
|
|
25
28
|
private appendAttachment;
|
|
26
29
|
static getFileNameFromMediaType(mediaType: string): string;
|
|
27
30
|
}
|
|
@@ -5,6 +5,7 @@ const uuid_1 = require("uuid");
|
|
|
5
5
|
class EventStorage {
|
|
6
6
|
pickles = {};
|
|
7
7
|
testCaseStarts = {};
|
|
8
|
+
testStepStarted = {};
|
|
8
9
|
testStepFinished = {};
|
|
9
10
|
testCases = {};
|
|
10
11
|
scenarios = {};
|
|
@@ -55,6 +56,9 @@ class EventStorage {
|
|
|
55
56
|
addTestCaseStarted(testCaseStarted) {
|
|
56
57
|
this.testCaseStarts[testCaseStarted.id] = testCaseStarted;
|
|
57
58
|
}
|
|
59
|
+
addTestStepStarted(step) {
|
|
60
|
+
this.testStepStarted[step.testStepId] = step;
|
|
61
|
+
}
|
|
58
62
|
addTestStepFinished(step) {
|
|
59
63
|
this.testStepFinished[step.testStepId] = step;
|
|
60
64
|
}
|
|
@@ -79,6 +83,9 @@ class EventStorage {
|
|
|
79
83
|
getAllTestStepFinished() {
|
|
80
84
|
return new Map(Object.entries(this.testStepFinished));
|
|
81
85
|
}
|
|
86
|
+
getAllTestStepStarted() {
|
|
87
|
+
return new Map(Object.entries(this.testStepStarted));
|
|
88
|
+
}
|
|
82
89
|
appendAttachment(key, attachment) {
|
|
83
90
|
const list = this.attachments[key] ?? [];
|
|
84
91
|
this.attachments[key] = list;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { PickleStep, TestStepFinished } from '@cucumber/messages';
|
|
1
|
+
import { PickleStep, TestStepFinished, TestStepStarted } from '@cucumber/messages';
|
|
2
2
|
import { TestCase } from '@cucumber/messages/dist/esm/src/messages';
|
|
3
3
|
import { Attachment, TestStepType } from 'qase-javascript-commons';
|
|
4
4
|
export declare class StepConverter {
|
|
5
|
-
static convert(pickleSteps: readonly PickleStep[], testCase: TestCase, finishedSteps: Map<string, TestStepFinished>, getAttachments: (stepId: string) => Attachment[]): TestStepType[];
|
|
5
|
+
static convert(pickleSteps: readonly PickleStep[], testCase: TestCase, startedSteps: Map<string, TestStepStarted>, finishedSteps: Map<string, TestStepFinished>, getAttachments: (stepId: string) => Attachment[]): TestStepType[];
|
|
6
|
+
/**
|
|
7
|
+
* Cucumber `Timestamp` is `{ seconds, nanos }`. Convert to a Unix-seconds
|
|
8
|
+
* number with fractional milliseconds.
|
|
9
|
+
*/
|
|
10
|
+
private static toSeconds;
|
|
6
11
|
}
|
|
@@ -4,7 +4,7 @@ exports.StepConverter = void 0;
|
|
|
4
4
|
const qase_javascript_commons_1 = require("qase-javascript-commons");
|
|
5
5
|
const statusMaps_1 = require("./statusMaps");
|
|
6
6
|
class StepConverter {
|
|
7
|
-
static convert(pickleSteps, testCase, finishedSteps, getAttachments) {
|
|
7
|
+
static convert(pickleSteps, testCase, startedSteps, finishedSteps, getAttachments) {
|
|
8
8
|
const results = [];
|
|
9
9
|
for (const s of testCase.testSteps) {
|
|
10
10
|
const finished = finishedSteps.get(s.id);
|
|
@@ -13,6 +13,9 @@ class StepConverter {
|
|
|
13
13
|
const step = pickleSteps.find((ps) => ps.id === s.pickleStepId);
|
|
14
14
|
if (!step)
|
|
15
15
|
continue;
|
|
16
|
+
const started = startedSteps.get(s.id);
|
|
17
|
+
const startTimeSec = started ? StepConverter.toSeconds(started.timestamp) : null;
|
|
18
|
+
const endTimeSec = StepConverter.toSeconds(finished.timestamp);
|
|
16
19
|
results.push({
|
|
17
20
|
id: s.id,
|
|
18
21
|
step_type: qase_javascript_commons_1.StepType.GHERKIN,
|
|
@@ -23,9 +26,10 @@ class StepConverter {
|
|
|
23
26
|
},
|
|
24
27
|
execution: {
|
|
25
28
|
status: statusMaps_1.STEP_STATUS_MAP[finished.testStepResult.status],
|
|
26
|
-
start_time:
|
|
27
|
-
end_time:
|
|
28
|
-
duration: finished.testStepResult.duration.seconds * 1000
|
|
29
|
+
start_time: startTimeSec,
|
|
30
|
+
end_time: endTimeSec,
|
|
31
|
+
duration: finished.testStepResult.duration.seconds * 1000
|
|
32
|
+
+ Math.round(finished.testStepResult.duration.nanos / 1e6),
|
|
29
33
|
},
|
|
30
34
|
attachments: getAttachments(s.id),
|
|
31
35
|
steps: [],
|
|
@@ -34,5 +38,12 @@ class StepConverter {
|
|
|
34
38
|
}
|
|
35
39
|
return results;
|
|
36
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Cucumber `Timestamp` is `{ seconds, nanos }`. Convert to a Unix-seconds
|
|
43
|
+
* number with fractional milliseconds.
|
|
44
|
+
*/
|
|
45
|
+
static toSeconds(ts) {
|
|
46
|
+
return ts.seconds + ts.nanos / 1e9;
|
|
47
|
+
}
|
|
37
48
|
}
|
|
38
49
|
exports.StepConverter = StepConverter;
|
package/dist/reporter.js
CHANGED
|
@@ -78,6 +78,9 @@ class CucumberQaseReporter extends cucumber_1.Formatter {
|
|
|
78
78
|
else if (envelope.testCaseStarted) {
|
|
79
79
|
this.storage.addTestCaseStarted(envelope.testCaseStarted);
|
|
80
80
|
}
|
|
81
|
+
else if (envelope.testStepStarted) {
|
|
82
|
+
this.storage.addTestCaseStepStarted(envelope.testStepStarted);
|
|
83
|
+
}
|
|
81
84
|
else if (envelope.testStepFinished) {
|
|
82
85
|
this.storage.addTestCaseStep(envelope.testStepFinished);
|
|
83
86
|
}
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Attachment as Attach, GherkinDocument, Pickle, TestCaseFinished, TestCaseStarted, TestStepFinished } from '@cucumber/messages';
|
|
1
|
+
import { Attachment as Attach, GherkinDocument, Pickle, TestCaseFinished, TestCaseStarted, TestStepFinished, TestStepStarted } from '@cucumber/messages';
|
|
2
2
|
import { StepStatusEnum, TestResultType, TestStatusEnum } from 'qase-javascript-commons';
|
|
3
3
|
import { NetworkProfiler } from 'qase-javascript-commons/profilers';
|
|
4
4
|
import { TestCase } from '@cucumber/messages/dist/esm/src/messages';
|
|
@@ -16,6 +16,7 @@ export declare class Storage {
|
|
|
16
16
|
addAttachment(attachment: Attach): void;
|
|
17
17
|
addTestCase(testCase: TestCase): void;
|
|
18
18
|
addTestCaseStarted(testCaseStarted: TestCaseStarted): void;
|
|
19
|
+
addTestCaseStepStarted(testCaseStepStarted: TestStepStarted): void;
|
|
19
20
|
addTestCaseStep(testCaseStep: TestStepFinished): void;
|
|
20
21
|
convertTestCase(testCase: TestCaseFinished): undefined | TestResultType;
|
|
21
22
|
}
|
package/dist/storage.js
CHANGED
|
@@ -37,6 +37,9 @@ class Storage {
|
|
|
37
37
|
this.statusTracker.onTestStarted(testCaseStarted.id);
|
|
38
38
|
this.profilerTracker.onTestStart(testCaseStarted.id);
|
|
39
39
|
}
|
|
40
|
+
addTestCaseStepStarted(testCaseStepStarted) {
|
|
41
|
+
this.events.addTestStepStarted(testCaseStepStarted);
|
|
42
|
+
}
|
|
40
43
|
addTestCaseStep(testCaseStep) {
|
|
41
44
|
this.events.addTestStepFinished(testCaseStep);
|
|
42
45
|
this.statusTracker.applyStep(testCaseStep);
|
|
@@ -67,7 +70,7 @@ class Storage {
|
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
|
-
const steps = stepConverter_1.StepConverter.convert(pickle.steps, tc, this.events.getAllTestStepFinished(), (stepId) => this.events.getAttachments(stepId));
|
|
73
|
+
const steps = stepConverter_1.StepConverter.convert(pickle.steps, tc, this.events.getAllTestStepStarted(), this.events.getAllTestStepFinished(), (stepId) => this.events.getAttachments(stepId));
|
|
71
74
|
const profilerSteps = this.profilerTracker.getEvents(testCase.testCaseStartedId);
|
|
72
75
|
this.profilerTracker.reset(testCase.testCaseStartedId);
|
|
73
76
|
return resultBuilder_1.ResultBuilder.build({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cucumberjs-qase-reporter",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Qase TMS CucumberJS Reporter",
|
|
5
5
|
"homepage": "https://github.com/qase-tms/qase-javascript",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"url": "git+https://github.com/qase-tms/qase-javascript.git"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=18"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "npm run clean && tsc --project tsconfig.build.json",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"license": "Apache-2.0",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@cucumber/messages": "^22.0.0",
|
|
43
|
-
"qase-javascript-commons": "~2.
|
|
43
|
+
"qase-javascript-commons": "~2.7.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@cucumber/cucumber": ">=7.0.0"
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"@types/jest": "^29.5.14",
|
|
51
51
|
"jest": "^29.7.0",
|
|
52
52
|
"ts-jest": "^29.4.5",
|
|
53
|
-
"uuid": "^
|
|
53
|
+
"uuid": "^11.1.1"
|
|
54
54
|
}
|
|
55
55
|
}
|