allure-codeceptjs 3.0.0-beta.3 → 3.0.0-beta.5
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/dist/cjs/helpers.js +1 -1
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/reporter.js +83 -67
- package/dist/cjs/reporter.js.map +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/reporter.js +83 -67
- package/dist/esm/reporter.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/model.d.ts +0 -5
- package/dist/types/reporter.d.ts +11 -6
- package/package.json +8 -4
package/dist/cjs/helpers.js
CHANGED
package/dist/cjs/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["_allureJsCommons","require","_wrapRegExp","e","r","BabelRegExp","RegExp","prototype","WeakMap","t","p","o","set","get","_setPrototypeOf","buildGroups","Object","keys","reduce","i","length","create","_inherits","exec","call","groups","indices","Symbol","replace","Array","isArray","join","arguments","slice","push","apply","TypeError","constructor","value","writable","configurable","defineProperty","setPrototypeOf","bind","__proto__","allureIdRegexp","id","allureLabelRegexp","name","extractMeta","test","labels","tags","map","tag","_idMatch$groups","idMatch","match","idValue","LabelName","ALLURE_ID","labelMatch","TAG","exports"],"sources":["../../src/helpers.ts"],"sourcesContent":["import type { Label } from \"allure-js-commons\";\nimport { LabelName } from \"allure-js-commons\";\nimport type { CodeceptTest } from \"./model.js\";\n\nconst allureIdRegexp = /@?allure.id[:=](?<id>[^\\s]+)/;\nconst allureLabelRegexp = /@?allure.label.(?<name>[^\\s]+?)[:=](?<value>[^\\s]+)/;\n\nexport const extractMeta = (test: CodeceptTest & { tags: string[] }) => {\n const labels: Label[] = test.tags.map((tag) => {\n const idMatch = tag.match(allureIdRegexp);\n const idValue = idMatch?.groups?.id;\n\n if (idValue) {\n return { name: LabelName.ALLURE_ID, value: idValue };\n }\n\n const labelMatch = tag.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n return { name, value };\n }\n\n return { name: LabelName.TAG, value: tag };\n });\n\n return { labels };\n};\n"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAA8C,SAAAC,YAAA,IAAAA,WAAA,YAAAA,YAAAC,CAAA,EAAAC,CAAA,eAAAC,WAAA,CAAAF,CAAA,UAAAC,CAAA,UAAAD,CAAA,GAAAG,MAAA,CAAAC,SAAA,EAAAH,CAAA,OAAAI,OAAA,aAAAH,YAAAF,CAAA,EAAAM,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAL,MAAA,CAAAH,CAAA,EAAAM,CAAA,UAAAL,CAAA,CAAAQ,GAAA,CAAAD,CAAA,EAAAD,CAAA,IAAAN,CAAA,CAAAS,GAAA,CAAAV,CAAA,IAAAW,eAAA,CAAAH,CAAA,EAAAN,WAAA,CAAAE,SAAA,cAAAQ,YAAAZ,CAAA,EAAAM,CAAA,QAAAC,CAAA,GAAAN,CAAA,CAAAS,GAAA,CAAAJ,CAAA,UAAAO,MAAA,CAAAC,IAAA,CAAAP,CAAA,EAAAQ,MAAA,WAAAd,CAAA,EAAAK,CAAA,QAAAE,CAAA,GAAAD,CAAA,CAAAD,CAAA,0BAAAE,CAAA,EAAAP,CAAA,CAAAK,CAAA,IAAAN,CAAA,CAAAQ,CAAA,kBAAAQ,CAAA,iBAAAhB,CAAA,CAAAQ,CAAA,CAAAQ,CAAA,MAAAA,CAAA,OAAAR,CAAA,CAAAS,MAAA,GAAAD,CAAA,IAAAf,CAAA,CAAAK,CAAA,IAAAN,CAAA,CAAAQ,CAAA,CAAAQ,CAAA,aAAAf,CAAA,KAAAY,MAAA,CAAAK,MAAA,kBAAAC,SAAA,CAAAjB,WAAA,EAAA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AAEV;IAAM,CAAC,GAAG,CAAAuB,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEpC,MAAM,KAAI,CAAC,CAAC;IAEhD,IAAIuB,IAAI,IAAIV,KAAK,EAAE;MACjB,OAAO;QAAEU,IAAI;QAAEV;MAAM,CAAC;IACxB;IAEA,OAAO;MAAEU,IAAI,EAAEW,0BAAS,CAACG,GAAG;MAAExB,KAAK,EAAEgB;IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["_allureJsCommons","require","_wrapRegExp","e","r","BabelRegExp","RegExp","prototype","WeakMap","t","p","o","set","get","_setPrototypeOf","buildGroups","Object","keys","reduce","i","length","create","_inherits","exec","call","groups","indices","Symbol","replace","Array","isArray","join","arguments","slice","push","apply","TypeError","constructor","value","writable","configurable","defineProperty","setPrototypeOf","bind","__proto__","allureIdRegexp","id","allureLabelRegexp","name","extractMeta","test","labels","tags","map","tag","_idMatch$groups","idMatch","match","idValue","LabelName","ALLURE_ID","labelMatch","TAG","startsWith","substring","exports"],"sources":["../../src/helpers.ts"],"sourcesContent":["import type { Label } from \"allure-js-commons\";\nimport { LabelName } from \"allure-js-commons\";\nimport type { CodeceptTest } from \"./model.js\";\n\nconst allureIdRegexp = /@?allure.id[:=](?<id>[^\\s]+)/;\nconst allureLabelRegexp = /@?allure.label.(?<name>[^\\s]+?)[:=](?<value>[^\\s]+)/;\n\nexport const extractMeta = (test: CodeceptTest & { tags: string[] }) => {\n const labels: Label[] = test.tags.map((tag) => {\n const idMatch = tag.match(allureIdRegexp);\n const idValue = idMatch?.groups?.id;\n\n if (idValue) {\n return { name: LabelName.ALLURE_ID, value: idValue };\n }\n\n const labelMatch = tag.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n return { name, value };\n }\n\n return { name: LabelName.TAG, value: tag.startsWith(\"@\") ? tag.substring(1) : tag };\n });\n\n return { labels };\n};\n"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAA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UAAU,CAAC,GAAG,CAAC,GAAGT,GAAG,CAACU,SAAS,CAAC,CAAC,CAAC,GAAGV;IAAI,CAAC;EACrF,CAAC,CAAC;EAEF,OAAO;IAAEH;EAAO,CAAC;AACnB,CAAC;AAACc,OAAA,CAAAhB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_runtime","require","_legacy","_reporter","_runtime2","allurePlugin","config","reporter","AllureCodeceptJsReporter","testRuntime","AllureCodeceptJsTestRuntime","setGlobalTestRuntime","allureCodeceptJsLegacyApi","_default","exports","default","module"],"sources":["../../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","names":["_runtime","require","_legacy","_reporter","_runtime2","allurePlugin","config","reporter","AllureCodeceptJsReporter","testRuntime","AllureCodeceptJsTestRuntime","setGlobalTestRuntime","allureCodeceptJsLegacyApi","_default","exports","default","module"],"sources":["../../src/index.ts"],"sourcesContent":["import type { Config } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { allureCodeceptJsLegacyApi } from \"./legacy.js\";\nimport { AllureCodeceptJsReporter } from \"./reporter.js\";\nimport { AllureCodeceptJsTestRuntime } from \"./runtime.js\";\n\nconst allurePlugin = (config: Config) => {\n const reporter = new AllureCodeceptJsReporter(config);\n const testRuntime = new AllureCodeceptJsTestRuntime(reporter);\n\n // @ts-ignore\n setGlobalTestRuntime(testRuntime);\n\n return allureCodeceptJsLegacyApi;\n};\n\nexport default allurePlugin;\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAEA,IAAMI,YAAY,GAAIC,MAAc,IAAK;EACvC,IAAMC,QAAQ,GAAG,IAAIC,kCAAwB,CAACF,MAAM,CAAC;EACrD,IAAMG,WAAW,GAAG,IAAIC,qCAA2B,CAACH,QAAQ,CAAC;;EAE7D;EACA,IAAAI,6BAAoB,EAACF,WAAW,CAAC;EAEjC,OAAOG,iCAAyB;AAClC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaV,YAAY;AAAAW,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
|
package/dist/cjs/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["export interface CodeceptError {\n params: any;\n template: string;\n showDiff: boolean;\n actual: string;\n expected: string;\n cliMessage: () => string;\n message: string;\n inspect: () => string;\n}\n\nexport interface CodeceptStep {\n actor: string;\n name: string;\n helperMethod: string;\n suffix: string;\n prefix: string;\n comment: string;\n args: string[];\n status: string;\n metaStep: CodeceptStep;\n toString: () => string;\n}\n\nexport type CodeceptHook = Mocha.Hook;\n\nexport type CodeceptTest = Mocha.Runnable;\n"],"mappings":"","ignoreList":[]}
|
package/dist/cjs/reporter.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.AllureCodeceptJsReporter = void 0;
|
|
7
7
|
var _codeceptjs = require("codeceptjs");
|
|
8
8
|
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
9
|
+
var _nodeProcess = require("node:process");
|
|
9
10
|
var _allureJsCommons = require("allure-js-commons");
|
|
10
11
|
var _sdk = require("allure-js-commons/sdk");
|
|
11
12
|
var _reporter = require("allure-js-commons/sdk/reporter");
|
|
@@ -22,22 +23,24 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
22
23
|
class AllureCodeceptJsReporter {
|
|
23
24
|
constructor(config) {
|
|
24
25
|
_defineProperty(this, "allureRuntime", void 0);
|
|
25
|
-
_defineProperty(this, "
|
|
26
|
+
_defineProperty(this, "currentTestUuid", void 0);
|
|
27
|
+
_defineProperty(this, "currentFixtureUuid", void 0);
|
|
28
|
+
_defineProperty(this, "scopeUuids", []);
|
|
26
29
|
_defineProperty(this, "currentTest", null);
|
|
27
30
|
_defineProperty(this, "config", void 0);
|
|
28
31
|
this.registerEvents();
|
|
29
32
|
this.config = config || {};
|
|
30
33
|
this.allureRuntime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, config), {}, {
|
|
31
|
-
writer:
|
|
34
|
+
writer: _nodeProcess.env.ALLURE_TEST_MODE ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({
|
|
32
35
|
resultsDir: config.resultsDir || "./allure-results"
|
|
33
36
|
})
|
|
34
37
|
}));
|
|
35
38
|
}
|
|
36
39
|
closeCurrentAllureTest(test) {
|
|
37
|
-
if (!this.
|
|
40
|
+
if (!this.currentTestUuid) {
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
|
-
this.allureRuntime.updateTest(result => {
|
|
43
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
41
44
|
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
42
45
|
|
|
43
46
|
// @ts-ignore
|
|
@@ -50,12 +53,10 @@ class AllureCodeceptJsReporter {
|
|
|
50
53
|
name: "Repetition",
|
|
51
54
|
value: "".concat(test.retryNum + 1)
|
|
52
55
|
});
|
|
53
|
-
}, this.currentAllureResultUuid);
|
|
54
|
-
this.allureRuntime.stopTest({
|
|
55
|
-
uuid: this.currentAllureResultUuid
|
|
56
56
|
});
|
|
57
|
-
this.allureRuntime.
|
|
58
|
-
this.
|
|
57
|
+
this.allureRuntime.stopTest(this.currentTestUuid);
|
|
58
|
+
this.allureRuntime.writeTest(this.currentTestUuid);
|
|
59
|
+
this.currentTestUuid = undefined;
|
|
59
60
|
}
|
|
60
61
|
startAllureTest(test) {
|
|
61
62
|
var relativeFile = _nodePath.default.relative(codecept_dir, test.file).split(_nodePath.default.sep).join("/");
|
|
@@ -65,12 +66,12 @@ class AllureCodeceptJsReporter {
|
|
|
65
66
|
var {
|
|
66
67
|
labels
|
|
67
68
|
} = (0, _helpers.extractMeta)(test);
|
|
68
|
-
this.
|
|
69
|
+
this.currentTestUuid = this.allureRuntime.startTest({
|
|
69
70
|
name: titleMetadata.cleanTitle,
|
|
70
71
|
fullName,
|
|
71
72
|
testCaseId: (0, _reporter.md5)(fullName)
|
|
72
|
-
});
|
|
73
|
-
this.allureRuntime.updateTest(result => {
|
|
73
|
+
}, this.scopeUuids);
|
|
74
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
74
75
|
var _test$parent;
|
|
75
76
|
result.labels.push(...labels);
|
|
76
77
|
result.labels.push(...titleMetadata.labels);
|
|
@@ -88,42 +89,37 @@ class AllureCodeceptJsReporter {
|
|
|
88
89
|
value: test.parent.title
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
|
-
}, this.currentAllureResultUuid);
|
|
92
|
-
}
|
|
93
|
-
closeCurrentAllureStep() {
|
|
94
|
-
if (!this.currentAllureResultUuid) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.allureRuntime.updateStep(result => {
|
|
98
|
-
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
99
|
-
}, this.currentAllureResultUuid);
|
|
100
|
-
this.allureRuntime.stopStep({
|
|
101
|
-
uuid: this.currentAllureResultUuid
|
|
102
92
|
});
|
|
103
93
|
}
|
|
104
94
|
registerEvents() {
|
|
105
95
|
// Hooks
|
|
106
|
-
_codeceptjs.event.dispatcher.
|
|
107
|
-
_codeceptjs.event.dispatcher.
|
|
96
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.hook.started, this.hookStarted.bind(this));
|
|
97
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.hook.passed, this.hookPassed.bind(this));
|
|
108
98
|
// Suite
|
|
109
|
-
_codeceptjs.event.dispatcher.
|
|
110
|
-
_codeceptjs.event.dispatcher.
|
|
99
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.suite.before, this.suiteBefore.bind(this));
|
|
100
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.suite.after, this.suiteAfter.bind(this));
|
|
111
101
|
// Test
|
|
112
|
-
_codeceptjs.event.dispatcher.
|
|
113
|
-
_codeceptjs.event.dispatcher.
|
|
114
|
-
_codeceptjs.event.dispatcher.
|
|
115
|
-
_codeceptjs.event.dispatcher.
|
|
102
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.started, this.testStarted.bind(this));
|
|
103
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.skipped, this.testSkipped.bind(this));
|
|
104
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.passed, this.testPassed.bind(this));
|
|
105
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.test.failed, this.testFailed.bind(this));
|
|
116
106
|
// Step
|
|
117
|
-
_codeceptjs.event.dispatcher.
|
|
118
|
-
_codeceptjs.event.dispatcher.
|
|
119
|
-
_codeceptjs.event.dispatcher.
|
|
120
|
-
_codeceptjs.event.dispatcher.
|
|
107
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.step.started, this.stepStarted.bind(this));
|
|
108
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.step.passed, this.stepPassed.bind(this));
|
|
109
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.step.failed, this.stepFailed.bind(this));
|
|
110
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.step.comment, this.stepComment.bind(this));
|
|
111
|
+
// run
|
|
112
|
+
_codeceptjs.event.dispatcher.on(_codeceptjs.event.all.after, this.afterAll.bind(this));
|
|
121
113
|
}
|
|
122
114
|
suiteBefore() {
|
|
123
|
-
this.allureRuntime.startScope();
|
|
115
|
+
var scopeUuid = this.allureRuntime.startScope();
|
|
116
|
+
this.scopeUuids.push(scopeUuid);
|
|
124
117
|
}
|
|
125
118
|
suiteAfter() {
|
|
126
|
-
this.
|
|
119
|
+
var suiteUuid = this.scopeUuids.pop();
|
|
120
|
+
if (suiteUuid) {
|
|
121
|
+
this.allureRuntime.writeScope(suiteUuid);
|
|
122
|
+
}
|
|
127
123
|
}
|
|
128
124
|
hookStarted(hook) {
|
|
129
125
|
var _hook$ctx;
|
|
@@ -132,85 +128,104 @@ class AllureCodeceptJsReporter {
|
|
|
132
128
|
hookType: 1
|
|
133
129
|
})).groups.hookType;
|
|
134
130
|
var fixtureType = /before/.test(hookType) ? "before" : "after";
|
|
135
|
-
this.
|
|
131
|
+
var scopeUuid = this.scopeUuids.length > 0 ? this.scopeUuids[this.scopeUuids.length - 1] : undefined;
|
|
132
|
+
if (!scopeUuid) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.currentFixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {
|
|
136
136
|
name: currentRunnable.title,
|
|
137
137
|
stage: _allureJsCommons.Stage.RUNNING,
|
|
138
138
|
start: Date.now()
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
hookPassed() {
|
|
142
|
-
this.
|
|
142
|
+
if (!this.currentFixtureUuid) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.allureRuntime.updateFixture(this.currentFixtureUuid, result => {
|
|
143
146
|
result.status = _allureJsCommons.Status.PASSED;
|
|
144
147
|
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
145
148
|
});
|
|
146
|
-
|
|
147
|
-
stop: Date.now()
|
|
148
|
-
});
|
|
149
|
-
this.allureRuntime.writeFixture(fixtureUuid);
|
|
149
|
+
this.allureRuntime.stopFixture(this.currentFixtureUuid);
|
|
150
150
|
}
|
|
151
151
|
testStarted(test) {
|
|
152
152
|
// test has been already started
|
|
153
|
-
if (this.
|
|
153
|
+
if (this.currentTestUuid) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
this.startAllureTest(test);
|
|
157
157
|
}
|
|
158
158
|
testFailed(test, err) {
|
|
159
|
-
if (!this.
|
|
159
|
+
if (!this.currentTestUuid) {
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
this.allureRuntime.updateTest(result => {
|
|
162
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
163
163
|
result.status = _allureJsCommons.Status.FAILED;
|
|
164
164
|
// @ts-ignore
|
|
165
165
|
result.statusDetails = (0, _sdk.getMessageAndTraceFromError)(err);
|
|
166
|
-
}
|
|
166
|
+
});
|
|
167
167
|
this.closeCurrentAllureTest(test);
|
|
168
168
|
}
|
|
169
169
|
testPassed(test) {
|
|
170
|
-
if (!this.
|
|
170
|
+
if (!this.currentTestUuid) {
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
this.allureRuntime.updateTest(result => {
|
|
173
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
174
174
|
result.status = _allureJsCommons.Status.PASSED;
|
|
175
|
-
}
|
|
175
|
+
});
|
|
176
176
|
this.closeCurrentAllureTest(test);
|
|
177
177
|
}
|
|
178
178
|
testSkipped(test) {
|
|
179
|
-
if (!this.
|
|
179
|
+
if (!this.currentTestUuid) {
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
this.allureRuntime.updateTest(result => {
|
|
182
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
183
183
|
result.status = _allureJsCommons.Status.SKIPPED;
|
|
184
184
|
if (test.opts.skipInfo) {
|
|
185
185
|
result.statusDetails = {
|
|
186
186
|
message: test.opts.skipInfo.message
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
}
|
|
189
|
+
});
|
|
190
190
|
this.closeCurrentAllureTest(test);
|
|
191
191
|
}
|
|
192
192
|
stepStarted(step) {
|
|
193
|
-
this.
|
|
193
|
+
if (!this.currentTestUuid) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
this.allureRuntime.startStep(this.currentTestUuid, undefined, {
|
|
194
197
|
name: "".concat(step.actor, " ").concat(step.name)
|
|
195
|
-
}
|
|
198
|
+
});
|
|
196
199
|
}
|
|
197
200
|
stepFailed() {
|
|
198
|
-
this.
|
|
201
|
+
this.stopCurrentStep(result => {
|
|
199
202
|
result.status = _allureJsCommons.Status.FAILED;
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
204
|
+
});
|
|
202
205
|
}
|
|
203
206
|
stepComment() {
|
|
204
|
-
this.
|
|
207
|
+
this.stopCurrentStep(result => {
|
|
205
208
|
result.status = _allureJsCommons.Status.PASSED;
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
210
|
+
});
|
|
208
211
|
}
|
|
209
212
|
stepPassed() {
|
|
210
|
-
this.
|
|
213
|
+
this.stopCurrentStep(result => {
|
|
211
214
|
result.status = _allureJsCommons.Status.PASSED;
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
stopCurrentStep(updateFunc) {
|
|
219
|
+
var currentStep = this.currentTestUuid ? this.allureRuntime.currentStep(this.currentTestUuid) : undefined;
|
|
220
|
+
if (!currentStep) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
this.allureRuntime.updateStep(currentStep, updateFunc);
|
|
224
|
+
this.allureRuntime.stopStep(currentStep);
|
|
225
|
+
}
|
|
226
|
+
afterAll() {
|
|
227
|
+
this.allureRuntime.writeEnvironmentInfo();
|
|
228
|
+
this.allureRuntime.writeCategoriesDefinitions();
|
|
214
229
|
}
|
|
215
230
|
|
|
216
231
|
// TODO: not implemented in the new version at all
|
|
@@ -225,9 +240,10 @@ class AllureCodeceptJsReporter {
|
|
|
225
240
|
// }
|
|
226
241
|
|
|
227
242
|
handleRuntimeMessage(message) {
|
|
228
|
-
this.
|
|
229
|
-
|
|
230
|
-
}
|
|
243
|
+
if (!this.currentTestUuid) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this.allureRuntime.applyRuntimeMessages(this.currentTestUuid, [message]);
|
|
231
247
|
}
|
|
232
248
|
}
|
|
233
249
|
exports.AllureCodeceptJsReporter = AllureCodeceptJsReporter;
|
package/dist/cjs/reporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","names":["_codeceptjs","require","_nodePath","_interopRequireDefault","_allureJsCommons","_sdk","_reporter","_helpers","e","__esModule","default","_wrapRegExp","r","BabelRegExp","RegExp","prototype","WeakMap","t","p","o","set","get","_setPrototypeOf","buildGroups","Object","keys","reduce","i","length","create","_inherits","exec","call","groups","indices","Symbol","replace","Array","isArray","join","arguments","slice","push","apply","TypeError","constructor","value","writable","configurable","defineProperty","setPrototypeOf","bind","__proto__","ownKeys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","_toPrimitive","toPrimitive","String","Number","AllureCodeceptJsReporter","config","registerEvents","allureRuntime","ReporterRuntime","writer","testMode","MessageWriter","FileSystemWriter","resultsDir","closeCurrentAllureTest","test","currentAllureResultUuid","updateTest","result","stage","Stage","FINISHED","_retries","parameters","name","concat","retryNum","stopTest","uuid","writeTest","undefined","startAllureTest","relativeFile","path","relative","codecept_dir","file","split","sep","fullName","title","titleMetadata","extractMetadataFromString","labels","extractMeta","startTest","cleanTitle","testCaseId","md5","_test$parent","LabelName","LANGUAGE","FRAMEWORK","parent","SUITE","closeCurrentAllureStep","updateStep","stopStep","event","dispatcher","addListener","hook","started","hookStarted","passed","hookPassed","suite","before","suiteBefore","after","suiteAfter","testStarted","skipped","testSkipped","testPassed","failed","testFailed","step","stepStarted","stepPassed","stepFailed","comment","stepComment","startScope","writeScope","_hook$ctx","currentRunnable","ctx","hookType","match","fixtureType","startFixture","RUNNING","start","Date","now","updateFixture","status","Status","PASSED","fixtureUuid","stopFixture","stop","writeFixture","err","FAILED","statusDetails","getMessageAndTraceFromError","SKIPPED","opts","skipInfo","message","startStep","actor","handleRuntimeMessage","applyRuntimeMessages","testUuid","exports"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event } from \"codeceptjs\";\nimport path from \"node:path\";\nimport { LabelName, Stage, Status } from \"allure-js-commons\";\nimport { type RuntimeMessage, extractMetadataFromString, getMessageAndTraceFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, md5 } from \"allure-js-commons/sdk/reporter\";\nimport { extractMeta } from \"./helpers.js\";\nimport type { AllureCodeceptJsConfig, CodeceptError, CodeceptHook, CodeceptStep, CodeceptTest } from \"./model.js\";\n\nexport class AllureCodeceptJsReporter {\n allureRuntime?: ReporterRuntime;\n currentAllureResultUuid?: string;\n currentTest: CodeceptTest | null = null;\n config!: AllureCodeceptJsConfig;\n\n constructor(config: AllureCodeceptJsConfig) {\n this.registerEvents();\n this.config = config || {};\n this.allureRuntime = new ReporterRuntime({\n ...config,\n writer: config.testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n }),\n });\n }\n\n private closeCurrentAllureTest(test: CodeceptTest) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.stage = Stage.FINISHED;\n\n // @ts-ignore\n if (test._retries <= 0) {\n return;\n }\n\n // @ts-ignore\n result.parameters!.push({ name: \"Repetition\", value: `${test.retryNum + 1}` });\n }, this.currentAllureResultUuid);\n\n this.allureRuntime!.stopTest({ uuid: this.currentAllureResultUuid });\n this.allureRuntime!.writeTest(this.currentAllureResultUuid);\n this.currentAllureResultUuid = undefined;\n }\n\n private startAllureTest(test: CodeceptTest) {\n const relativeFile = path.relative(codecept_dir, test.file!).split(path.sep).join(\"/\");\n const fullName = `${relativeFile}#${test.title}`;\n const titleMetadata = extractMetadataFromString(test.title);\n // @ts-ignore\n const { labels } = extractMeta(test);\n\n this.currentAllureResultUuid = this.allureRuntime!.startTest({\n name: titleMetadata.cleanTitle,\n fullName,\n testCaseId: md5(fullName),\n });\n\n this.allureRuntime!.updateTest((result) => {\n result.labels.push(...labels);\n result.labels.push(...titleMetadata.labels);\n result.labels.push({ name: LabelName.LANGUAGE, value: \"javascript\" });\n result.labels.push({ name: LabelName.FRAMEWORK, value: \"codeceptjs\" });\n\n if (test?.parent?.title) {\n result.labels.push({\n name: LabelName.SUITE,\n value: test.parent.title,\n });\n }\n }, this.currentAllureResultUuid);\n }\n\n private closeCurrentAllureStep() {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateStep((result) => {\n result.stage = Stage.FINISHED;\n }, this.currentAllureResultUuid);\n this.allureRuntime!.stopStep({ uuid: this.currentAllureResultUuid });\n }\n\n registerEvents() {\n // Hooks\n event.dispatcher.addListener(event.hook.started, this.hookStarted.bind(this));\n event.dispatcher.addListener(event.hook.passed, this.hookPassed.bind(this));\n // Suite\n event.dispatcher.addListener(event.suite.before, this.suiteBefore.bind(this));\n event.dispatcher.addListener(event.suite.after, this.suiteAfter.bind(this));\n // Test\n event.dispatcher.addListener(event.test.started, this.testStarted.bind(this));\n event.dispatcher.addListener(event.test.skipped, this.testSkipped.bind(this));\n event.dispatcher.addListener(event.test.passed, this.testPassed.bind(this));\n event.dispatcher.addListener(event.test.failed, this.testFailed.bind(this));\n // Step\n event.dispatcher.addListener(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.addListener(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.addListener(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.addListener(event.step.comment, this.stepComment.bind(this));\n }\n\n suiteBefore() {\n this.allureRuntime!.startScope();\n }\n\n suiteAfter() {\n this.allureRuntime!.writeScope();\n }\n\n hookStarted(hook: CodeceptHook) {\n const currentRunnable = hook?.ctx?.test;\n const hookType = currentRunnable!.title.match(/^\"(?<hookType>.+)\" hook/)!.groups!.hookType;\n const fixtureType = /before/.test(hookType) ? \"before\" : \"after\";\n\n this.allureRuntime!.startFixture(fixtureType, {\n name: currentRunnable!.title,\n stage: Stage.RUNNING,\n start: Date.now(),\n });\n }\n\n hookPassed() {\n this.allureRuntime!.updateFixture((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n\n const fixtureUuid = this.allureRuntime!.stopFixture({ stop: Date.now() });\n\n this.allureRuntime!.writeFixture(fixtureUuid);\n }\n\n testStarted(test: CodeceptTest & { tags: string[] }) {\n // test has been already started\n if (this.currentAllureResultUuid) {\n return;\n }\n\n this.startAllureTest(test);\n }\n\n testFailed(test: CodeceptTest, err: CodeceptError) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.status = Status.FAILED;\n // @ts-ignore\n result.statusDetails = getMessageAndTraceFromError(err);\n }, this.currentAllureResultUuid);\n this.closeCurrentAllureTest(test);\n }\n\n testPassed(test: CodeceptTest) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.status = Status.PASSED;\n }, this.currentAllureResultUuid);\n this.closeCurrentAllureTest(test);\n }\n\n testSkipped(\n test: CodeceptTest & {\n opts: {\n skipInfo: {\n message: string;\n isFastSkipped: boolean;\n };\n };\n },\n ) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.status = Status.SKIPPED;\n\n if (test.opts.skipInfo) {\n result.statusDetails = { message: test.opts.skipInfo.message };\n }\n }, this.currentAllureResultUuid);\n this.closeCurrentAllureTest(test);\n }\n\n stepStarted(step: CodeceptStep) {\n this.allureRuntime!.startStep(\n {\n name: `${step.actor} ${step.name}`,\n },\n this.currentAllureResultUuid!,\n );\n }\n\n stepFailed() {\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.FAILED;\n }, this.currentAllureResultUuid!);\n this.closeCurrentAllureStep();\n }\n\n stepComment() {\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.PASSED;\n }, this.currentAllureResultUuid!);\n this.closeCurrentAllureStep();\n }\n\n stepPassed() {\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.PASSED;\n }, this.currentAllureResultUuid!);\n this.closeCurrentAllureStep();\n }\n\n // TODO: not implemented in the new version at all\n // addScreenDiff(name: string, expectedImg: string, actualImg: string, diffImg: string) {\n // const screenDiff = {\n // name,\n // expected: `data:image/png;base64,${expectedImg}`,\n // actual: `data:image/png;base64,${actualImg}`,\n // diff: `data:image/png;base64,${diffImg}`,\n // };\n // this.addAttachment(name, JSON.stringify(screenDiff), \"application/vnd.allure.image.diff\");\n // }\n\n handleRuntimeMessage(message: RuntimeMessage) {\n this.allureRuntime!.applyRuntimeMessages([message], { testUuid: this.currentAllureResultUuid! });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAA2C,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,YAAA,IAAAA,WAAA,YAAAA,YAAAH,CAAA,EAAAI,CAAA,eAAAC,WAAA,CAAAL,CAAA,UAAAI,CAAA,UAAAJ,CAAA,GAAAM,MAAA,CAAAC,SAAA,EAAAH,CAAA,OAAAI,OAAA,aAAAH,YAAAL,CAAA,EAAAS,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAL,MAAA,CAAAN,CAAA,EAAAS,CAAA,UAAAL,CAAA,CAAAQ,GAAA,CAAAD,CAAA,EAAAD,CAAA,IAAAN,CAAA,CAAAS,GAAA,CAAAb,CAAA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,CAAC;EAC/B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA2D,oBAAoBA,CAACH,OAAuB,EAAE;IAC5C,IAAI,CAACxG,aAAa,CAAE4G,oBAAoB,CAAC,CAACJ,OAAO,CAAC,EAAE;MAAEK,QAAQ,EAAE,IAAI,CAACpG;IAAyB,CAAC,CAAC;EAClG;AACF;AAACqG,OAAA,CAAAjH,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"reporter.js","names":["_codeceptjs","require","_nodePath","_interopRequireDefault","_nodeProcess","_allureJsCommons","_sdk","_reporter","_helpers","e","__esModule","default","_wrapRegExp","r","BabelRegExp","RegExp","prototype","WeakMap","t","p","o","set","get","_setPrototypeOf","buildGroups","Object","keys","reduce","i","length","create","_inherits","exec","call","groups","indices","Symbol","replace","Array","isArray","join","arguments","slice","push","apply","TypeError","constructor","value","writable","configurable","defineProperty","setPrototypeOf","bind","__proto__","ownKeys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","_toPrimitive","toPrimitive","String","Number","AllureCodeceptJsReporter","config","registerEvents","allureRuntime","ReporterRuntime","writer","env","ALLURE_TEST_MODE","MessageWriter","FileSystemWriter","resultsDir","closeCurrentAllureTest","test","currentTestUuid","updateTest","result","stage","Stage","FINISHED","_retries","parameters","name","concat","retryNum","stopTest","writeTest","undefined","startAllureTest","relativeFile","path","relative","codecept_dir","file","split","sep","fullName","title","titleMetadata","extractMetadataFromString","labels","extractMeta","startTest","cleanTitle","testCaseId","md5","scopeUuids","_test$parent","LabelName","LANGUAGE","FRAMEWORK","parent","SUITE","event","dispatcher","on","hook","started","hookStarted","passed","hookPassed","suite","before","suiteBefore","after","suiteAfter","testStarted","skipped","testSkipped","testPassed","failed","testFailed","step","stepStarted","stepPassed","stepFailed","comment","stepComment","all","afterAll","scopeUuid","startScope","suiteUuid","pop","writeScope","_hook$ctx","currentRunnable","ctx","hookType","match","fixtureType","currentFixtureUuid","startFixture","RUNNING","start","Date","now","updateFixture","status","Status","PASSED","stopFixture","err","FAILED","statusDetails","getMessageAndTraceFromError","SKIPPED","opts","skipInfo","message","startStep","actor","stopCurrentStep","updateFunc","currentStep","updateStep","stopStep","writeEnvironmentInfo","writeCategoriesDefinitions","handleRuntimeMessage","applyRuntimeMessages","exports"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event } from \"codeceptjs\";\nimport path from \"node:path\";\nimport { env } from \"node:process\";\nimport { LabelName, Stage, Status, type StepResult } from \"allure-js-commons\";\nimport { type RuntimeMessage, extractMetadataFromString, getMessageAndTraceFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, md5 } from \"allure-js-commons/sdk/reporter\";\nimport type { Config } from \"allure-js-commons/sdk/reporter\";\nimport { extractMeta } from \"./helpers.js\";\nimport type { CodeceptError, CodeceptHook, CodeceptStep, CodeceptTest } from \"./model.js\";\n\nexport class AllureCodeceptJsReporter {\n allureRuntime: ReporterRuntime;\n currentTestUuid?: string;\n currentFixtureUuid?: string;\n scopeUuids: string[] = [];\n currentTest: CodeceptTest | null = null;\n config!: Config;\n\n constructor(config: Config) {\n this.registerEvents();\n this.config = config || ({} as Config);\n this.allureRuntime = new ReporterRuntime({\n ...config,\n writer: env.ALLURE_TEST_MODE\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n }),\n });\n }\n\n private closeCurrentAllureTest(test: CodeceptTest) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.stage = Stage.FINISHED;\n\n // @ts-ignore\n if (test._retries <= 0) {\n return;\n }\n\n // @ts-ignore\n result.parameters.push({ name: \"Repetition\", value: `${test.retryNum + 1}` });\n });\n\n this.allureRuntime.stopTest(this.currentTestUuid);\n this.allureRuntime.writeTest(this.currentTestUuid);\n this.currentTestUuid = undefined;\n }\n\n private startAllureTest(test: CodeceptTest) {\n const relativeFile = path.relative(codecept_dir, test.file!).split(path.sep).join(\"/\");\n const fullName = `${relativeFile}#${test.title}`;\n const titleMetadata = extractMetadataFromString(test.title);\n // @ts-ignore\n const { labels } = extractMeta(test);\n\n this.currentTestUuid = this.allureRuntime.startTest(\n {\n name: titleMetadata.cleanTitle,\n fullName,\n testCaseId: md5(fullName),\n },\n this.scopeUuids,\n );\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.labels.push(...labels);\n result.labels.push(...titleMetadata.labels);\n result.labels.push({ name: LabelName.LANGUAGE, value: \"javascript\" });\n result.labels.push({ name: LabelName.FRAMEWORK, value: \"codeceptjs\" });\n\n if (test?.parent?.title) {\n result.labels.push({\n name: LabelName.SUITE,\n value: test.parent.title,\n });\n }\n });\n }\n\n registerEvents() {\n // Hooks\n event.dispatcher.on(event.hook.started, this.hookStarted.bind(this));\n event.dispatcher.on(event.hook.passed, this.hookPassed.bind(this));\n // Suite\n event.dispatcher.on(event.suite.before, this.suiteBefore.bind(this));\n event.dispatcher.on(event.suite.after, this.suiteAfter.bind(this));\n // Test\n event.dispatcher.on(event.test.started, this.testStarted.bind(this));\n event.dispatcher.on(event.test.skipped, this.testSkipped.bind(this));\n event.dispatcher.on(event.test.passed, this.testPassed.bind(this));\n event.dispatcher.on(event.test.failed, this.testFailed.bind(this));\n // Step\n event.dispatcher.on(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.on(event.step.comment, this.stepComment.bind(this));\n // run\n event.dispatcher.on(event.all.after, this.afterAll.bind(this));\n }\n\n suiteBefore() {\n const scopeUuid = this.allureRuntime.startScope();\n this.scopeUuids.push(scopeUuid);\n }\n\n suiteAfter() {\n const suiteUuid = this.scopeUuids.pop();\n if (suiteUuid) {\n this.allureRuntime.writeScope(suiteUuid);\n }\n }\n\n hookStarted(hook: CodeceptHook) {\n const currentRunnable = hook?.ctx?.test;\n const hookType = currentRunnable!.title.match(/^\"(?<hookType>.+)\" hook/)!.groups!.hookType;\n const fixtureType = /before/.test(hookType) ? \"before\" : \"after\";\n\n const scopeUuid = this.scopeUuids.length > 0 ? this.scopeUuids[this.scopeUuids.length - 1] : undefined;\n if (!scopeUuid) {\n return;\n }\n\n this.currentFixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: currentRunnable!.title,\n stage: Stage.RUNNING,\n start: Date.now(),\n });\n }\n\n hookPassed() {\n if (!this.currentFixtureUuid) {\n return;\n }\n this.allureRuntime.updateFixture(this.currentFixtureUuid, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n\n this.allureRuntime.stopFixture(this.currentFixtureUuid);\n }\n\n testStarted(test: CodeceptTest & { tags: string[] }) {\n // test has been already started\n if (this.currentTestUuid) {\n return;\n }\n\n this.startAllureTest(test);\n }\n\n testFailed(test: CodeceptTest, err: CodeceptError) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.status = Status.FAILED;\n // @ts-ignore\n result.statusDetails = getMessageAndTraceFromError(err);\n });\n this.closeCurrentAllureTest(test);\n }\n\n testPassed(test: CodeceptTest) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.status = Status.PASSED;\n });\n this.closeCurrentAllureTest(test);\n }\n\n testSkipped(\n test: CodeceptTest & {\n opts: {\n skipInfo: {\n message: string;\n isFastSkipped: boolean;\n };\n };\n },\n ) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.status = Status.SKIPPED;\n\n if (test.opts.skipInfo) {\n result.statusDetails = { message: test.opts.skipInfo.message };\n }\n });\n this.closeCurrentAllureTest(test);\n }\n\n stepStarted(step: CodeceptStep) {\n if (!this.currentTestUuid) {\n return;\n }\n this.allureRuntime.startStep(this.currentTestUuid, undefined, {\n name: `${step.actor} ${step.name}`,\n });\n }\n\n stepFailed() {\n this.stopCurrentStep((result) => {\n result.status = Status.FAILED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stopCurrentStep(updateFunc: (result: StepResult) => void) {\n const currentStep = this.currentTestUuid ? this.allureRuntime.currentStep(this.currentTestUuid) : undefined;\n\n if (!currentStep) {\n return;\n }\n this.allureRuntime.updateStep(currentStep, updateFunc);\n this.allureRuntime.stopStep(currentStep);\n }\n\n afterAll() {\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n }\n\n // TODO: not implemented in the new version at all\n // addScreenDiff(name: string, expectedImg: string, actualImg: string, diffImg: string) {\n // const screenDiff = {\n // name,\n // expected: `data:image/png;base64,${expectedImg}`,\n // actual: `data:image/png;base64,${actualImg}`,\n // diff: `data:image/png;base64,${diffImg}`,\n // };\n // this.addAttachment(name, JSON.stringify(screenDiff), \"application/vnd.allure.image.diff\");\n // }\n\n handleRuntimeMessage(message: RuntimeMessage) {\n if (!this.currentTestUuid) {\n return;\n }\n this.allureRuntime.applyRuntimeMessages(this.currentTestUuid, [message]);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AAA2C,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA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oBAAoB,CAAC,IAAI,CAAC1G,eAAe,EAAE,CAAC+F,OAAO,CAAC,CAAC;EAC1E;AACF;AAACY,OAAA,CAAAxH,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
package/dist/esm/helpers.js
CHANGED
package/dist/esm/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":["LabelName","allureIdRegexp","_wrapRegExp","id","allureLabelRegexp","name","value","extractMeta","test","labels","tags","map","tag","_idMatch$groups","idMatch","match","idValue","groups","ALLURE_ID","labelMatch","TAG"],"sources":["../../src/helpers.ts"],"sourcesContent":["import type { Label } from \"allure-js-commons\";\nimport { LabelName } from \"allure-js-commons\";\nimport type { CodeceptTest } from \"./model.js\";\n\nconst allureIdRegexp = /@?allure.id[:=](?<id>[^\\s]+)/;\nconst allureLabelRegexp = /@?allure.label.(?<name>[^\\s]+?)[:=](?<value>[^\\s]+)/;\n\nexport const extractMeta = (test: CodeceptTest & { tags: string[] }) => {\n const labels: Label[] = test.tags.map((tag) => {\n const idMatch = tag.match(allureIdRegexp);\n const idValue = idMatch?.groups?.id;\n\n if (idValue) {\n return { name: LabelName.ALLURE_ID, value: idValue };\n }\n\n const labelMatch = tag.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n return { name, value };\n }\n\n return { name: LabelName.TAG, value: tag };\n });\n\n return { labels };\n};\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,mBAAmB;AAG7C,IAAMC,cAAc,gBAAAC,WAAA,CAAG,yBAA8B;EAAAC,EAAA;AAAA;AACrD,IAAMC,iBAAiB,gBAAAF,WAAA,CAAG,sCAAqD;EAAAG,IAAA;EAAAC,KAAA;AAAA;AAE/E,OAAO,IAAMC,WAAW,GAAIC,IAAuC,IAAK;EACtE,IAAMC,MAAe,GAAGD,IAAI,CAACE,IAAI,CAACC,GAAG,CAAEC,GAAG,IAAK;IAAA,IAAAC,eAAA;IAC7C,IAAMC,OAAO,GAAGF,GAAG,CAACG,KAAK,CAACd,cAAc,CAAC;IACzC,IAAMe,OAAO,GAAGF,OAAO,aAAPA,OAAO,gBAAAD,eAAA,GAAPC,OAAO,CAAEG,MAAM,cAAAJ,eAAA,uBAAfA,eAAA,CAAiBV,EAAE;IAEnC,IAAIa,OAAO,EAAE;MACX,OAAO;QAAEX,IAAI,EAAEL,SAAS,CAACkB,SAAS;QAAEZ,KAAK,EAAEU;MAAQ,CAAC;IACtD;IAEA,IAAMG,UAAU,GAAGP,GAAG,CAACG,KAAK,CAACX,iBAAiB,CAAC;IAC/C,IAAM;MAAEC,IAAI;MAAEC;IAAM,CAAC,GAAG,CAAAa,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEF,MAAM,KAAI,CAAC,CAAC;IAEhD,IAAIZ,IAAI,IAAIC,KAAK,EAAE;MACjB,OAAO;QAAED,IAAI;QAAEC;MAAM,CAAC;IACxB;IAEA,OAAO;MAAED,IAAI,EAAEL,SAAS,CAACoB,GAAG;MAAEd,KAAK,EAAEM;IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["LabelName","allureIdRegexp","_wrapRegExp","id","allureLabelRegexp","name","value","extractMeta","test","labels","tags","map","tag","_idMatch$groups","idMatch","match","idValue","groups","ALLURE_ID","labelMatch","TAG","startsWith","substring"],"sources":["../../src/helpers.ts"],"sourcesContent":["import type { Label } from \"allure-js-commons\";\nimport { LabelName } from \"allure-js-commons\";\nimport type { CodeceptTest } from \"./model.js\";\n\nconst allureIdRegexp = /@?allure.id[:=](?<id>[^\\s]+)/;\nconst allureLabelRegexp = /@?allure.label.(?<name>[^\\s]+?)[:=](?<value>[^\\s]+)/;\n\nexport const extractMeta = (test: CodeceptTest & { tags: string[] }) => {\n const labels: Label[] = test.tags.map((tag) => {\n const idMatch = tag.match(allureIdRegexp);\n const idValue = idMatch?.groups?.id;\n\n if (idValue) {\n return { name: LabelName.ALLURE_ID, value: idValue };\n }\n\n const labelMatch = tag.match(allureLabelRegexp);\n const { name, value } = labelMatch?.groups || {};\n\n if (name && value) {\n return { name, value };\n }\n\n return { name: LabelName.TAG, value: tag.startsWith(\"@\") ? tag.substring(1) : tag };\n });\n\n return { labels };\n};\n"],"mappings":";;;AACA,SAASA,SAAS,QAAQ,mBAAmB;AAG7C,IAAMC,cAAc,gBAAAC,WAAA,CAAG,yBAA8B;EAAAC,EAAA;AAAA;AACrD,IAAMC,iBAAiB,gBAAAF,WAAA,CAAG,sCAAqD;EAAAG,IAAA;EAAAC,KAAA;AAAA;AAE/E,OAAO,IAAMC,WAAW,GAAIC,IAAuC,IAAK;EACtE,IAAMC,MAAe,GAAGD,IAAI,CAACE,IAAI,CAACC,GAAG,CAAEC,GAAG,IAAK;IAAA,IAAAC,eAAA;IAC7C,IAAMC,OAAO,GAAGF,GAAG,CAACG,KAAK,CAACd,cAAc,CAAC;IACzC,IAAMe,OAAO,GAAGF,OAAO,aAAPA,OAAO,gBAAAD,eAAA,GAAPC,OAAO,CAAEG,MAAM,cAAAJ,eAAA,uBAAfA,eAAA,CAAiBV,EAAE;IAEnC,IAAIa,OAAO,EAAE;MACX,OAAO;QAAEX,IAAI,EAAEL,SAAS,CAACkB,SAAS;QAAEZ,KAAK,EAAEU;MAAQ,CAAC;IACtD;IAEA,IAAMG,UAAU,GAAGP,GAAG,CAACG,KAAK,CAACX,iBAAiB,CAAC;IAC/C,IAAM;MAAEC,IAAI;MAAEC;IAAM,CAAC,GAAG,CAAAa,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEF,MAAM,KAAI,CAAC,CAAC;IAEhD,IAAIZ,IAAI,IAAIC,KAAK,EAAE;MACjB,OAAO;QAAED,IAAI;QAAEC;MAAM,CAAC;IACxB;IAEA,OAAO;MAAED,IAAI,EAAEL,SAAS,CAACoB,GAAG;MAAEd,KAAK,EAAEM,GAAG,CAACS,UAAU,CAAC,GAAG,CAAC,GAAGT,GAAG,CAACU,SAAS,CAAC,CAAC,CAAC,GAAGV;IAAI,CAAC;EACrF,CAAC,CAAC;EAEF,OAAO;IAAEH;EAAO,CAAC;AACnB,CAAC","ignoreList":[]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["setGlobalTestRuntime","allureCodeceptJsLegacyApi","AllureCodeceptJsReporter","AllureCodeceptJsTestRuntime","allurePlugin","config","reporter","testRuntime"],"sources":["../../src/index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","names":["setGlobalTestRuntime","allureCodeceptJsLegacyApi","AllureCodeceptJsReporter","AllureCodeceptJsTestRuntime","allurePlugin","config","reporter","testRuntime"],"sources":["../../src/index.ts"],"sourcesContent":["import type { Config } from \"allure-js-commons/sdk/reporter\";\nimport { setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { allureCodeceptJsLegacyApi } from \"./legacy.js\";\nimport { AllureCodeceptJsReporter } from \"./reporter.js\";\nimport { AllureCodeceptJsTestRuntime } from \"./runtime.js\";\n\nconst allurePlugin = (config: Config) => {\n const reporter = new AllureCodeceptJsReporter(config);\n const testRuntime = new AllureCodeceptJsTestRuntime(reporter);\n\n // @ts-ignore\n setGlobalTestRuntime(testRuntime);\n\n return allureCodeceptJsLegacyApi;\n};\n\nexport default allurePlugin;\n"],"mappings":"AACA,SAASA,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,yBAAyB,QAAQ,aAAa;AACvD,SAASC,wBAAwB,QAAQ,eAAe;AACxD,SAASC,2BAA2B,QAAQ,cAAc;AAE1D,IAAMC,YAAY,GAAIC,MAAc,IAAK;EACvC,IAAMC,QAAQ,GAAG,IAAIJ,wBAAwB,CAACG,MAAM,CAAC;EACrD,IAAME,WAAW,GAAG,IAAIJ,2BAA2B,CAACG,QAAQ,CAAC;;EAE7D;EACAN,oBAAoB,CAACO,WAAW,CAAC;EAEjC,OAAON,yBAAyB;AAClC,CAAC;AAED,eAAeG,YAAY","ignoreList":[]}
|
package/dist/esm/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/model.ts"],"sourcesContent":["export interface CodeceptError {\n params: any;\n template: string;\n showDiff: boolean;\n actual: string;\n expected: string;\n cliMessage: () => string;\n message: string;\n inspect: () => string;\n}\n\nexport interface CodeceptStep {\n actor: string;\n name: string;\n helperMethod: string;\n suffix: string;\n prefix: string;\n comment: string;\n args: string[];\n status: string;\n metaStep: CodeceptStep;\n toString: () => string;\n}\n\nexport type CodeceptHook = Mocha.Hook;\n\nexport type CodeceptTest = Mocha.Runnable;\n"],"mappings":"","ignoreList":[]}
|
package/dist/esm/reporter.js
CHANGED
|
@@ -8,6 +8,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
8
8
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
9
|
import { event } from "codeceptjs";
|
|
10
10
|
import path from "node:path";
|
|
11
|
+
import { env } from "node:process";
|
|
11
12
|
import { LabelName, Stage, Status } from "allure-js-commons";
|
|
12
13
|
import { extractMetadataFromString, getMessageAndTraceFromError } from "allure-js-commons/sdk";
|
|
13
14
|
import { FileSystemWriter, MessageWriter, ReporterRuntime, md5 } from "allure-js-commons/sdk/reporter";
|
|
@@ -15,22 +16,24 @@ import { extractMeta } from "./helpers.js";
|
|
|
15
16
|
export class AllureCodeceptJsReporter {
|
|
16
17
|
constructor(config) {
|
|
17
18
|
_defineProperty(this, "allureRuntime", void 0);
|
|
18
|
-
_defineProperty(this, "
|
|
19
|
+
_defineProperty(this, "currentTestUuid", void 0);
|
|
20
|
+
_defineProperty(this, "currentFixtureUuid", void 0);
|
|
21
|
+
_defineProperty(this, "scopeUuids", []);
|
|
19
22
|
_defineProperty(this, "currentTest", null);
|
|
20
23
|
_defineProperty(this, "config", void 0);
|
|
21
24
|
this.registerEvents();
|
|
22
25
|
this.config = config || {};
|
|
23
26
|
this.allureRuntime = new ReporterRuntime(_objectSpread(_objectSpread({}, config), {}, {
|
|
24
|
-
writer:
|
|
27
|
+
writer: env.ALLURE_TEST_MODE ? new MessageWriter() : new FileSystemWriter({
|
|
25
28
|
resultsDir: config.resultsDir || "./allure-results"
|
|
26
29
|
})
|
|
27
30
|
}));
|
|
28
31
|
}
|
|
29
32
|
closeCurrentAllureTest(test) {
|
|
30
|
-
if (!this.
|
|
33
|
+
if (!this.currentTestUuid) {
|
|
31
34
|
return;
|
|
32
35
|
}
|
|
33
|
-
this.allureRuntime.updateTest(result => {
|
|
36
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
34
37
|
result.stage = Stage.FINISHED;
|
|
35
38
|
|
|
36
39
|
// @ts-ignore
|
|
@@ -43,12 +46,10 @@ export class AllureCodeceptJsReporter {
|
|
|
43
46
|
name: "Repetition",
|
|
44
47
|
value: "".concat(test.retryNum + 1)
|
|
45
48
|
});
|
|
46
|
-
}, this.currentAllureResultUuid);
|
|
47
|
-
this.allureRuntime.stopTest({
|
|
48
|
-
uuid: this.currentAllureResultUuid
|
|
49
49
|
});
|
|
50
|
-
this.allureRuntime.
|
|
51
|
-
this.
|
|
50
|
+
this.allureRuntime.stopTest(this.currentTestUuid);
|
|
51
|
+
this.allureRuntime.writeTest(this.currentTestUuid);
|
|
52
|
+
this.currentTestUuid = undefined;
|
|
52
53
|
}
|
|
53
54
|
startAllureTest(test) {
|
|
54
55
|
var relativeFile = path.relative(codecept_dir, test.file).split(path.sep).join("/");
|
|
@@ -58,12 +59,12 @@ export class AllureCodeceptJsReporter {
|
|
|
58
59
|
var {
|
|
59
60
|
labels
|
|
60
61
|
} = extractMeta(test);
|
|
61
|
-
this.
|
|
62
|
+
this.currentTestUuid = this.allureRuntime.startTest({
|
|
62
63
|
name: titleMetadata.cleanTitle,
|
|
63
64
|
fullName,
|
|
64
65
|
testCaseId: md5(fullName)
|
|
65
|
-
});
|
|
66
|
-
this.allureRuntime.updateTest(result => {
|
|
66
|
+
}, this.scopeUuids);
|
|
67
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
67
68
|
var _test$parent;
|
|
68
69
|
result.labels.push(...labels);
|
|
69
70
|
result.labels.push(...titleMetadata.labels);
|
|
@@ -81,42 +82,37 @@ export class AllureCodeceptJsReporter {
|
|
|
81
82
|
value: test.parent.title
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
|
-
}, this.currentAllureResultUuid);
|
|
85
|
-
}
|
|
86
|
-
closeCurrentAllureStep() {
|
|
87
|
-
if (!this.currentAllureResultUuid) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
this.allureRuntime.updateStep(result => {
|
|
91
|
-
result.stage = Stage.FINISHED;
|
|
92
|
-
}, this.currentAllureResultUuid);
|
|
93
|
-
this.allureRuntime.stopStep({
|
|
94
|
-
uuid: this.currentAllureResultUuid
|
|
95
85
|
});
|
|
96
86
|
}
|
|
97
87
|
registerEvents() {
|
|
98
88
|
// Hooks
|
|
99
|
-
event.dispatcher.
|
|
100
|
-
event.dispatcher.
|
|
89
|
+
event.dispatcher.on(event.hook.started, this.hookStarted.bind(this));
|
|
90
|
+
event.dispatcher.on(event.hook.passed, this.hookPassed.bind(this));
|
|
101
91
|
// Suite
|
|
102
|
-
event.dispatcher.
|
|
103
|
-
event.dispatcher.
|
|
92
|
+
event.dispatcher.on(event.suite.before, this.suiteBefore.bind(this));
|
|
93
|
+
event.dispatcher.on(event.suite.after, this.suiteAfter.bind(this));
|
|
104
94
|
// Test
|
|
105
|
-
event.dispatcher.
|
|
106
|
-
event.dispatcher.
|
|
107
|
-
event.dispatcher.
|
|
108
|
-
event.dispatcher.
|
|
95
|
+
event.dispatcher.on(event.test.started, this.testStarted.bind(this));
|
|
96
|
+
event.dispatcher.on(event.test.skipped, this.testSkipped.bind(this));
|
|
97
|
+
event.dispatcher.on(event.test.passed, this.testPassed.bind(this));
|
|
98
|
+
event.dispatcher.on(event.test.failed, this.testFailed.bind(this));
|
|
109
99
|
// Step
|
|
110
|
-
event.dispatcher.
|
|
111
|
-
event.dispatcher.
|
|
112
|
-
event.dispatcher.
|
|
113
|
-
event.dispatcher.
|
|
100
|
+
event.dispatcher.on(event.step.started, this.stepStarted.bind(this));
|
|
101
|
+
event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));
|
|
102
|
+
event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));
|
|
103
|
+
event.dispatcher.on(event.step.comment, this.stepComment.bind(this));
|
|
104
|
+
// run
|
|
105
|
+
event.dispatcher.on(event.all.after, this.afterAll.bind(this));
|
|
114
106
|
}
|
|
115
107
|
suiteBefore() {
|
|
116
|
-
this.allureRuntime.startScope();
|
|
108
|
+
var scopeUuid = this.allureRuntime.startScope();
|
|
109
|
+
this.scopeUuids.push(scopeUuid);
|
|
117
110
|
}
|
|
118
111
|
suiteAfter() {
|
|
119
|
-
this.
|
|
112
|
+
var suiteUuid = this.scopeUuids.pop();
|
|
113
|
+
if (suiteUuid) {
|
|
114
|
+
this.allureRuntime.writeScope(suiteUuid);
|
|
115
|
+
}
|
|
120
116
|
}
|
|
121
117
|
hookStarted(hook) {
|
|
122
118
|
var _hook$ctx;
|
|
@@ -125,85 +121,104 @@ export class AllureCodeceptJsReporter {
|
|
|
125
121
|
hookType: 1
|
|
126
122
|
})).groups.hookType;
|
|
127
123
|
var fixtureType = /before/.test(hookType) ? "before" : "after";
|
|
128
|
-
this.
|
|
124
|
+
var scopeUuid = this.scopeUuids.length > 0 ? this.scopeUuids[this.scopeUuids.length - 1] : undefined;
|
|
125
|
+
if (!scopeUuid) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.currentFixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {
|
|
129
129
|
name: currentRunnable.title,
|
|
130
130
|
stage: Stage.RUNNING,
|
|
131
131
|
start: Date.now()
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
hookPassed() {
|
|
135
|
-
this.
|
|
135
|
+
if (!this.currentFixtureUuid) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.allureRuntime.updateFixture(this.currentFixtureUuid, result => {
|
|
136
139
|
result.status = Status.PASSED;
|
|
137
140
|
result.stage = Stage.FINISHED;
|
|
138
141
|
});
|
|
139
|
-
|
|
140
|
-
stop: Date.now()
|
|
141
|
-
});
|
|
142
|
-
this.allureRuntime.writeFixture(fixtureUuid);
|
|
142
|
+
this.allureRuntime.stopFixture(this.currentFixtureUuid);
|
|
143
143
|
}
|
|
144
144
|
testStarted(test) {
|
|
145
145
|
// test has been already started
|
|
146
|
-
if (this.
|
|
146
|
+
if (this.currentTestUuid) {
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
this.startAllureTest(test);
|
|
150
150
|
}
|
|
151
151
|
testFailed(test, err) {
|
|
152
|
-
if (!this.
|
|
152
|
+
if (!this.currentTestUuid) {
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
this.allureRuntime.updateTest(result => {
|
|
155
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
156
156
|
result.status = Status.FAILED;
|
|
157
157
|
// @ts-ignore
|
|
158
158
|
result.statusDetails = getMessageAndTraceFromError(err);
|
|
159
|
-
}
|
|
159
|
+
});
|
|
160
160
|
this.closeCurrentAllureTest(test);
|
|
161
161
|
}
|
|
162
162
|
testPassed(test) {
|
|
163
|
-
if (!this.
|
|
163
|
+
if (!this.currentTestUuid) {
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
this.allureRuntime.updateTest(result => {
|
|
166
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
167
167
|
result.status = Status.PASSED;
|
|
168
|
-
}
|
|
168
|
+
});
|
|
169
169
|
this.closeCurrentAllureTest(test);
|
|
170
170
|
}
|
|
171
171
|
testSkipped(test) {
|
|
172
|
-
if (!this.
|
|
172
|
+
if (!this.currentTestUuid) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
this.allureRuntime.updateTest(result => {
|
|
175
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
176
176
|
result.status = Status.SKIPPED;
|
|
177
177
|
if (test.opts.skipInfo) {
|
|
178
178
|
result.statusDetails = {
|
|
179
179
|
message: test.opts.skipInfo.message
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
}
|
|
182
|
+
});
|
|
183
183
|
this.closeCurrentAllureTest(test);
|
|
184
184
|
}
|
|
185
185
|
stepStarted(step) {
|
|
186
|
-
this.
|
|
186
|
+
if (!this.currentTestUuid) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
this.allureRuntime.startStep(this.currentTestUuid, undefined, {
|
|
187
190
|
name: "".concat(step.actor, " ").concat(step.name)
|
|
188
|
-
}
|
|
191
|
+
});
|
|
189
192
|
}
|
|
190
193
|
stepFailed() {
|
|
191
|
-
this.
|
|
194
|
+
this.stopCurrentStep(result => {
|
|
192
195
|
result.status = Status.FAILED;
|
|
193
|
-
|
|
194
|
-
|
|
196
|
+
result.stage = Stage.FINISHED;
|
|
197
|
+
});
|
|
195
198
|
}
|
|
196
199
|
stepComment() {
|
|
197
|
-
this.
|
|
200
|
+
this.stopCurrentStep(result => {
|
|
198
201
|
result.status = Status.PASSED;
|
|
199
|
-
|
|
200
|
-
|
|
202
|
+
result.stage = Stage.FINISHED;
|
|
203
|
+
});
|
|
201
204
|
}
|
|
202
205
|
stepPassed() {
|
|
203
|
-
this.
|
|
206
|
+
this.stopCurrentStep(result => {
|
|
204
207
|
result.status = Status.PASSED;
|
|
205
|
-
|
|
206
|
-
|
|
208
|
+
result.stage = Stage.FINISHED;
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
stopCurrentStep(updateFunc) {
|
|
212
|
+
var currentStep = this.currentTestUuid ? this.allureRuntime.currentStep(this.currentTestUuid) : undefined;
|
|
213
|
+
if (!currentStep) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.allureRuntime.updateStep(currentStep, updateFunc);
|
|
217
|
+
this.allureRuntime.stopStep(currentStep);
|
|
218
|
+
}
|
|
219
|
+
afterAll() {
|
|
220
|
+
this.allureRuntime.writeEnvironmentInfo();
|
|
221
|
+
this.allureRuntime.writeCategoriesDefinitions();
|
|
207
222
|
}
|
|
208
223
|
|
|
209
224
|
// TODO: not implemented in the new version at all
|
|
@@ -218,9 +233,10 @@ export class AllureCodeceptJsReporter {
|
|
|
218
233
|
// }
|
|
219
234
|
|
|
220
235
|
handleRuntimeMessage(message) {
|
|
221
|
-
this.
|
|
222
|
-
|
|
223
|
-
}
|
|
236
|
+
if (!this.currentTestUuid) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.allureRuntime.applyRuntimeMessages(this.currentTestUuid, [message]);
|
|
224
240
|
}
|
|
225
241
|
}
|
|
226
242
|
//# sourceMappingURL=reporter.js.map
|
package/dist/esm/reporter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","names":["event","path","LabelName","Stage","Status","extractMetadataFromString","getMessageAndTraceFromError","FileSystemWriter","MessageWriter","ReporterRuntime","md5","extractMeta","AllureCodeceptJsReporter","constructor","config","_defineProperty","registerEvents","allureRuntime","_objectSpread","writer","testMode","resultsDir","closeCurrentAllureTest","test","currentAllureResultUuid","updateTest","result","stage","FINISHED","_retries","parameters","push","name","value","concat","retryNum","stopTest","uuid","writeTest","undefined","startAllureTest","relativeFile","relative","codecept_dir","file","split","sep","join","fullName","title","titleMetadata","labels","startTest","cleanTitle","testCaseId","_test$parent","LANGUAGE","FRAMEWORK","parent","SUITE","closeCurrentAllureStep","updateStep","stopStep","dispatcher","addListener","hook","started","hookStarted","bind","passed","hookPassed","suite","before","suiteBefore","after","suiteAfter","testStarted","skipped","testSkipped","testPassed","failed","testFailed","step","stepStarted","stepPassed","stepFailed","comment","stepComment","startScope","writeScope","_hook$ctx","currentRunnable","ctx","hookType","match","_wrapRegExp","groups","fixtureType","startFixture","RUNNING","start","Date","now","updateFixture","status","PASSED","fixtureUuid","stopFixture","stop","writeFixture","err","FAILED","statusDetails","SKIPPED","opts","skipInfo","message","startStep","actor","handleRuntimeMessage","applyRuntimeMessages","testUuid"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event } from \"codeceptjs\";\nimport path from \"node:path\";\nimport { LabelName, Stage, Status } from \"allure-js-commons\";\nimport { type RuntimeMessage, extractMetadataFromString, getMessageAndTraceFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, md5 } from \"allure-js-commons/sdk/reporter\";\nimport { extractMeta } from \"./helpers.js\";\nimport type { AllureCodeceptJsConfig, CodeceptError, CodeceptHook, CodeceptStep, CodeceptTest } from \"./model.js\";\n\nexport class AllureCodeceptJsReporter {\n allureRuntime?: ReporterRuntime;\n currentAllureResultUuid?: string;\n currentTest: CodeceptTest | null = null;\n config!: AllureCodeceptJsConfig;\n\n constructor(config: AllureCodeceptJsConfig) {\n this.registerEvents();\n this.config = config || {};\n this.allureRuntime = new ReporterRuntime({\n ...config,\n writer: config.testMode\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n }),\n });\n }\n\n private closeCurrentAllureTest(test: CodeceptTest) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.stage = Stage.FINISHED;\n\n // @ts-ignore\n if (test._retries <= 0) {\n return;\n }\n\n // @ts-ignore\n result.parameters!.push({ name: \"Repetition\", value: `${test.retryNum + 1}` });\n }, this.currentAllureResultUuid);\n\n this.allureRuntime!.stopTest({ uuid: this.currentAllureResultUuid });\n this.allureRuntime!.writeTest(this.currentAllureResultUuid);\n this.currentAllureResultUuid = undefined;\n }\n\n private startAllureTest(test: CodeceptTest) {\n const relativeFile = path.relative(codecept_dir, test.file!).split(path.sep).join(\"/\");\n const fullName = `${relativeFile}#${test.title}`;\n const titleMetadata = extractMetadataFromString(test.title);\n // @ts-ignore\n const { labels } = extractMeta(test);\n\n this.currentAllureResultUuid = this.allureRuntime!.startTest({\n name: titleMetadata.cleanTitle,\n fullName,\n testCaseId: md5(fullName),\n });\n\n this.allureRuntime!.updateTest((result) => {\n result.labels.push(...labels);\n result.labels.push(...titleMetadata.labels);\n result.labels.push({ name: LabelName.LANGUAGE, value: \"javascript\" });\n result.labels.push({ name: LabelName.FRAMEWORK, value: \"codeceptjs\" });\n\n if (test?.parent?.title) {\n result.labels.push({\n name: LabelName.SUITE,\n value: test.parent.title,\n });\n }\n }, this.currentAllureResultUuid);\n }\n\n private closeCurrentAllureStep() {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateStep((result) => {\n result.stage = Stage.FINISHED;\n }, this.currentAllureResultUuid);\n this.allureRuntime!.stopStep({ uuid: this.currentAllureResultUuid });\n }\n\n registerEvents() {\n // Hooks\n event.dispatcher.addListener(event.hook.started, this.hookStarted.bind(this));\n event.dispatcher.addListener(event.hook.passed, this.hookPassed.bind(this));\n // Suite\n event.dispatcher.addListener(event.suite.before, this.suiteBefore.bind(this));\n event.dispatcher.addListener(event.suite.after, this.suiteAfter.bind(this));\n // Test\n event.dispatcher.addListener(event.test.started, this.testStarted.bind(this));\n event.dispatcher.addListener(event.test.skipped, this.testSkipped.bind(this));\n event.dispatcher.addListener(event.test.passed, this.testPassed.bind(this));\n event.dispatcher.addListener(event.test.failed, this.testFailed.bind(this));\n // Step\n event.dispatcher.addListener(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.addListener(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.addListener(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.addListener(event.step.comment, this.stepComment.bind(this));\n }\n\n suiteBefore() {\n this.allureRuntime!.startScope();\n }\n\n suiteAfter() {\n this.allureRuntime!.writeScope();\n }\n\n hookStarted(hook: CodeceptHook) {\n const currentRunnable = hook?.ctx?.test;\n const hookType = currentRunnable!.title.match(/^\"(?<hookType>.+)\" hook/)!.groups!.hookType;\n const fixtureType = /before/.test(hookType) ? \"before\" : \"after\";\n\n this.allureRuntime!.startFixture(fixtureType, {\n name: currentRunnable!.title,\n stage: Stage.RUNNING,\n start: Date.now(),\n });\n }\n\n hookPassed() {\n this.allureRuntime!.updateFixture((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n\n const fixtureUuid = this.allureRuntime!.stopFixture({ stop: Date.now() });\n\n this.allureRuntime!.writeFixture(fixtureUuid);\n }\n\n testStarted(test: CodeceptTest & { tags: string[] }) {\n // test has been already started\n if (this.currentAllureResultUuid) {\n return;\n }\n\n this.startAllureTest(test);\n }\n\n testFailed(test: CodeceptTest, err: CodeceptError) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.status = Status.FAILED;\n // @ts-ignore\n result.statusDetails = getMessageAndTraceFromError(err);\n }, this.currentAllureResultUuid);\n this.closeCurrentAllureTest(test);\n }\n\n testPassed(test: CodeceptTest) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.status = Status.PASSED;\n }, this.currentAllureResultUuid);\n this.closeCurrentAllureTest(test);\n }\n\n testSkipped(\n test: CodeceptTest & {\n opts: {\n skipInfo: {\n message: string;\n isFastSkipped: boolean;\n };\n };\n },\n ) {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateTest((result) => {\n result.status = Status.SKIPPED;\n\n if (test.opts.skipInfo) {\n result.statusDetails = { message: test.opts.skipInfo.message };\n }\n }, this.currentAllureResultUuid);\n this.closeCurrentAllureTest(test);\n }\n\n stepStarted(step: CodeceptStep) {\n this.allureRuntime!.startStep(\n {\n name: `${step.actor} ${step.name}`,\n },\n this.currentAllureResultUuid!,\n );\n }\n\n stepFailed() {\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.FAILED;\n }, this.currentAllureResultUuid!);\n this.closeCurrentAllureStep();\n }\n\n stepComment() {\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.PASSED;\n }, this.currentAllureResultUuid!);\n this.closeCurrentAllureStep();\n }\n\n stepPassed() {\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.PASSED;\n }, this.currentAllureResultUuid!);\n this.closeCurrentAllureStep();\n }\n\n // TODO: not implemented in the new version at all\n // addScreenDiff(name: string, expectedImg: string, actualImg: string, diffImg: string) {\n // const screenDiff = {\n // name,\n // expected: `data:image/png;base64,${expectedImg}`,\n // actual: `data:image/png;base64,${actualImg}`,\n // diff: `data:image/png;base64,${diffImg}`,\n // };\n // this.addAttachment(name, JSON.stringify(screenDiff), \"application/vnd.allure.image.diff\");\n // }\n\n handleRuntimeMessage(message: RuntimeMessage) {\n this.allureRuntime!.applyRuntimeMessages([message], { testUuid: this.currentAllureResultUuid! });\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAASA,KAAK,QAAQ,YAAY;AAClC,OAAOC,IAAI,MAAM,WAAW;AAC5B,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAQ,mBAAmB;AAC5D,SAA8BC,yBAAyB,EAAEC,2BAA2B,QAAQ,uBAAuB;AACnH,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,eAAe,EAAEC,GAAG,QAAQ,gCAAgC;AACtG,SAASC,WAAW,QAAQ,cAAc;AAG1C,OAAO,MAAMC,wBAAwB,CAAC;EAMpCC,WAAWA,CAACC,MAA8B,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAHT,IAAI;IAAAA,eAAA;IAIrC,IAAI,CAACC,cAAc,CAAC,CAAC;IACrB,IAAI,CAACF,MAAM,GAAGA,MAAM,IAAI,CAAC,CAAC;IAC1B,IAAI,CAACG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,IAAI,CAACvF,uBAAwB,CAAC;IACjC,IAAI,CAACoC,sBAAsB,CAAC,CAAC;EAC/B;EAEA2B,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACtE,aAAa,CAAE4C,UAAU,CAAEnC,MAAM,IAAK;MACzCA,MAAM,CAAC8E,MAAM,GAAGpG,MAAM,CAACqG,MAAM;IAC/B,CAAC,EAAE,IAAI,CAACjF,uBAAwB,CAAC;IACjC,IAAI,CAACoC,sBAAsB,CAAC,CAAC;EAC/B;EAEAwB,UAAUA,CAAA,EAAG;IACX,IAAI,CAACnE,aAAa,CAAE4C,UAAU,CAAEnC,MAAM,IAAK;MACzCA,MAAM,CAAC8E,MAAM,GAAGpG,MAAM,CAACqG,MAAM;IAC/B,CAAC,EAAE,IAAI,CAACjF,uBAAwB,CAAC;IACjC,IAAI,CAACoC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA2D,oBAAoBA,CAACH,OAAuB,EAAE;IAC5C,IAAI,CAACnG,aAAa,CAAEuG,oBAAoB,CAAC,CAACJ,OAAO,CAAC,EAAE;MAAEK,QAAQ,EAAE,IAAI,CAACjG;IAAyB,CAAC,CAAC;EAClG;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"reporter.js","names":["event","path","env","LabelName","Stage","Status","extractMetadataFromString","getMessageAndTraceFromError","FileSystemWriter","MessageWriter","ReporterRuntime","md5","extractMeta","AllureCodeceptJsReporter","constructor","config","_defineProperty","registerEvents","allureRuntime","_objectSpread","writer","ALLURE_TEST_MODE","resultsDir","closeCurrentAllureTest","test","currentTestUuid","updateTest","result","stage","FINISHED","_retries","parameters","push","name","value","concat","retryNum","stopTest","writeTest","undefined","startAllureTest","relativeFile","relative","codecept_dir","file","split","sep","join","fullName","title","titleMetadata","labels","startTest","cleanTitle","testCaseId","scopeUuids","_test$parent","LANGUAGE","FRAMEWORK","parent","SUITE","dispatcher","on","hook","started","hookStarted","bind","passed","hookPassed","suite","before","suiteBefore","after","suiteAfter","testStarted","skipped","testSkipped","testPassed","failed","testFailed","step","stepStarted","stepPassed","stepFailed","comment","stepComment","all","afterAll","scopeUuid","startScope","suiteUuid","pop","writeScope","_hook$ctx","currentRunnable","ctx","hookType","match","_wrapRegExp","groups","fixtureType","length","currentFixtureUuid","startFixture","RUNNING","start","Date","now","updateFixture","status","PASSED","stopFixture","err","FAILED","statusDetails","SKIPPED","opts","skipInfo","message","startStep","actor","stopCurrentStep","updateFunc","currentStep","updateStep","stopStep","writeEnvironmentInfo","writeCategoriesDefinitions","handleRuntimeMessage","applyRuntimeMessages"],"sources":["../../src/reporter.ts"],"sourcesContent":["import { event } from \"codeceptjs\";\nimport path from \"node:path\";\nimport { env } from \"node:process\";\nimport { LabelName, Stage, Status, type StepResult } from \"allure-js-commons\";\nimport { type RuntimeMessage, extractMetadataFromString, getMessageAndTraceFromError } from \"allure-js-commons/sdk\";\nimport { FileSystemWriter, MessageWriter, ReporterRuntime, md5 } from \"allure-js-commons/sdk/reporter\";\nimport type { Config } from \"allure-js-commons/sdk/reporter\";\nimport { extractMeta } from \"./helpers.js\";\nimport type { CodeceptError, CodeceptHook, CodeceptStep, CodeceptTest } from \"./model.js\";\n\nexport class AllureCodeceptJsReporter {\n allureRuntime: ReporterRuntime;\n currentTestUuid?: string;\n currentFixtureUuid?: string;\n scopeUuids: string[] = [];\n currentTest: CodeceptTest | null = null;\n config!: Config;\n\n constructor(config: Config) {\n this.registerEvents();\n this.config = config || ({} as Config);\n this.allureRuntime = new ReporterRuntime({\n ...config,\n writer: env.ALLURE_TEST_MODE\n ? new MessageWriter()\n : new FileSystemWriter({\n resultsDir: config.resultsDir || \"./allure-results\",\n }),\n });\n }\n\n private closeCurrentAllureTest(test: CodeceptTest) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.stage = Stage.FINISHED;\n\n // @ts-ignore\n if (test._retries <= 0) {\n return;\n }\n\n // @ts-ignore\n result.parameters.push({ name: \"Repetition\", value: `${test.retryNum + 1}` });\n });\n\n this.allureRuntime.stopTest(this.currentTestUuid);\n this.allureRuntime.writeTest(this.currentTestUuid);\n this.currentTestUuid = undefined;\n }\n\n private startAllureTest(test: CodeceptTest) {\n const relativeFile = path.relative(codecept_dir, test.file!).split(path.sep).join(\"/\");\n const fullName = `${relativeFile}#${test.title}`;\n const titleMetadata = extractMetadataFromString(test.title);\n // @ts-ignore\n const { labels } = extractMeta(test);\n\n this.currentTestUuid = this.allureRuntime.startTest(\n {\n name: titleMetadata.cleanTitle,\n fullName,\n testCaseId: md5(fullName),\n },\n this.scopeUuids,\n );\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.labels.push(...labels);\n result.labels.push(...titleMetadata.labels);\n result.labels.push({ name: LabelName.LANGUAGE, value: \"javascript\" });\n result.labels.push({ name: LabelName.FRAMEWORK, value: \"codeceptjs\" });\n\n if (test?.parent?.title) {\n result.labels.push({\n name: LabelName.SUITE,\n value: test.parent.title,\n });\n }\n });\n }\n\n registerEvents() {\n // Hooks\n event.dispatcher.on(event.hook.started, this.hookStarted.bind(this));\n event.dispatcher.on(event.hook.passed, this.hookPassed.bind(this));\n // Suite\n event.dispatcher.on(event.suite.before, this.suiteBefore.bind(this));\n event.dispatcher.on(event.suite.after, this.suiteAfter.bind(this));\n // Test\n event.dispatcher.on(event.test.started, this.testStarted.bind(this));\n event.dispatcher.on(event.test.skipped, this.testSkipped.bind(this));\n event.dispatcher.on(event.test.passed, this.testPassed.bind(this));\n event.dispatcher.on(event.test.failed, this.testFailed.bind(this));\n // Step\n event.dispatcher.on(event.step.started, this.stepStarted.bind(this));\n event.dispatcher.on(event.step.passed, this.stepPassed.bind(this));\n event.dispatcher.on(event.step.failed, this.stepFailed.bind(this));\n event.dispatcher.on(event.step.comment, this.stepComment.bind(this));\n // run\n event.dispatcher.on(event.all.after, this.afterAll.bind(this));\n }\n\n suiteBefore() {\n const scopeUuid = this.allureRuntime.startScope();\n this.scopeUuids.push(scopeUuid);\n }\n\n suiteAfter() {\n const suiteUuid = this.scopeUuids.pop();\n if (suiteUuid) {\n this.allureRuntime.writeScope(suiteUuid);\n }\n }\n\n hookStarted(hook: CodeceptHook) {\n const currentRunnable = hook?.ctx?.test;\n const hookType = currentRunnable!.title.match(/^\"(?<hookType>.+)\" hook/)!.groups!.hookType;\n const fixtureType = /before/.test(hookType) ? \"before\" : \"after\";\n\n const scopeUuid = this.scopeUuids.length > 0 ? this.scopeUuids[this.scopeUuids.length - 1] : undefined;\n if (!scopeUuid) {\n return;\n }\n\n this.currentFixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {\n name: currentRunnable!.title,\n stage: Stage.RUNNING,\n start: Date.now(),\n });\n }\n\n hookPassed() {\n if (!this.currentFixtureUuid) {\n return;\n }\n this.allureRuntime.updateFixture(this.currentFixtureUuid, (result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n\n this.allureRuntime.stopFixture(this.currentFixtureUuid);\n }\n\n testStarted(test: CodeceptTest & { tags: string[] }) {\n // test has been already started\n if (this.currentTestUuid) {\n return;\n }\n\n this.startAllureTest(test);\n }\n\n testFailed(test: CodeceptTest, err: CodeceptError) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.status = Status.FAILED;\n // @ts-ignore\n result.statusDetails = getMessageAndTraceFromError(err);\n });\n this.closeCurrentAllureTest(test);\n }\n\n testPassed(test: CodeceptTest) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.status = Status.PASSED;\n });\n this.closeCurrentAllureTest(test);\n }\n\n testSkipped(\n test: CodeceptTest & {\n opts: {\n skipInfo: {\n message: string;\n isFastSkipped: boolean;\n };\n };\n },\n ) {\n if (!this.currentTestUuid) {\n return;\n }\n\n this.allureRuntime.updateTest(this.currentTestUuid, (result) => {\n result.status = Status.SKIPPED;\n\n if (test.opts.skipInfo) {\n result.statusDetails = { message: test.opts.skipInfo.message };\n }\n });\n this.closeCurrentAllureTest(test);\n }\n\n stepStarted(step: CodeceptStep) {\n if (!this.currentTestUuid) {\n return;\n }\n this.allureRuntime.startStep(this.currentTestUuid, undefined, {\n name: `${step.actor} ${step.name}`,\n });\n }\n\n stepFailed() {\n this.stopCurrentStep((result) => {\n result.status = Status.FAILED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepComment() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stepPassed() {\n this.stopCurrentStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n });\n }\n\n stopCurrentStep(updateFunc: (result: StepResult) => void) {\n const currentStep = this.currentTestUuid ? this.allureRuntime.currentStep(this.currentTestUuid) : undefined;\n\n if (!currentStep) {\n return;\n }\n this.allureRuntime.updateStep(currentStep, updateFunc);\n this.allureRuntime.stopStep(currentStep);\n }\n\n afterAll() {\n this.allureRuntime.writeEnvironmentInfo();\n this.allureRuntime.writeCategoriesDefinitions();\n }\n\n // TODO: not implemented in the new version at all\n // addScreenDiff(name: string, expectedImg: string, actualImg: string, diffImg: string) {\n // const screenDiff = {\n // name,\n // expected: `data:image/png;base64,${expectedImg}`,\n // actual: `data:image/png;base64,${actualImg}`,\n // diff: `data:image/png;base64,${diffImg}`,\n // };\n // this.addAttachment(name, JSON.stringify(screenDiff), \"application/vnd.allure.image.diff\");\n // }\n\n handleRuntimeMessage(message: RuntimeMessage) {\n if (!this.currentTestUuid) {\n return;\n }\n this.allureRuntime.applyRuntimeMessages(this.currentTestUuid, [message]);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAASA,KAAK,QAAQ,YAAY;AAClC,OAAOC,IAAI,MAAM,WAAW;AAC5B,SAASC,GAAG,QAAQ,cAAc;AAClC,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAyB,mBAAmB;AA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C,IAAI,CAAClG,eAAe,CAAC,GAAGc,SAAS;IAE3G,IAAI,CAACoF,WAAW,EAAE;MAChB;IACF;IACA,IAAI,CAACzG,aAAa,CAAC0G,UAAU,CAACD,WAAW,EAAED,UAAU,CAAC;IACtD,IAAI,CAACxG,aAAa,CAAC2G,QAAQ,CAACF,WAAW,CAAC;EAC1C;EAEApC,QAAQA,CAAA,EAAG;IACT,IAAI,CAACrE,aAAa,CAAC4G,oBAAoB,CAAC,CAAC;IACzC,IAAI,CAAC5G,aAAa,CAAC6G,0BAA0B,CAAC,CAAC;EACjD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEAC,oBAAoBA,CAACV,OAAuB,EAAE;IAC5C,IAAI,CAAC,IAAI,CAAC7F,eAAe,EAAE;MACzB;IACF;IACA,IAAI,CAACP,aAAa,CAAC+G,oBAAoB,CAAC,IAAI,CAACxG,eAAe,EAAE,CAAC6F,OAAO,CAAC,CAAC;EAC1E;AACF","ignoreList":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const allurePlugin: (config:
|
|
1
|
+
import type { Config } from "allure-js-commons/sdk/reporter";
|
|
2
|
+
declare const allurePlugin: (config: Config) => import("./legacy.js").AllureCodeceptJsLegacyApi;
|
|
3
3
|
export default allurePlugin;
|
package/dist/types/model.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Config } from "allure-js-commons/sdk/reporter";
|
|
2
1
|
export interface CodeceptError {
|
|
3
2
|
params: any;
|
|
4
3
|
template: string;
|
|
@@ -21,9 +20,5 @@ export interface CodeceptStep {
|
|
|
21
20
|
metaStep: CodeceptStep;
|
|
22
21
|
toString: () => string;
|
|
23
22
|
}
|
|
24
|
-
export type CodeceptSuite = Mocha.Suite;
|
|
25
23
|
export type CodeceptHook = Mocha.Hook;
|
|
26
24
|
export type CodeceptTest = Mocha.Runnable;
|
|
27
|
-
export interface AllureCodeceptJsConfig extends Config {
|
|
28
|
-
testMode?: boolean;
|
|
29
|
-
}
|
package/dist/types/reporter.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { type StepResult } from "allure-js-commons";
|
|
1
2
|
import { type RuntimeMessage } from "allure-js-commons/sdk";
|
|
2
3
|
import { ReporterRuntime } from "allure-js-commons/sdk/reporter";
|
|
3
|
-
import type {
|
|
4
|
+
import type { Config } from "allure-js-commons/sdk/reporter";
|
|
5
|
+
import type { CodeceptError, CodeceptHook, CodeceptStep, CodeceptTest } from "./model.js";
|
|
4
6
|
export declare class AllureCodeceptJsReporter {
|
|
5
|
-
allureRuntime
|
|
6
|
-
|
|
7
|
+
allureRuntime: ReporterRuntime;
|
|
8
|
+
currentTestUuid?: string;
|
|
9
|
+
currentFixtureUuid?: string;
|
|
10
|
+
scopeUuids: string[];
|
|
7
11
|
currentTest: CodeceptTest | null;
|
|
8
|
-
config:
|
|
9
|
-
constructor(config:
|
|
12
|
+
config: Config;
|
|
13
|
+
constructor(config: Config);
|
|
10
14
|
private closeCurrentAllureTest;
|
|
11
15
|
private startAllureTest;
|
|
12
|
-
private closeCurrentAllureStep;
|
|
13
16
|
registerEvents(): void;
|
|
14
17
|
suiteBefore(): void;
|
|
15
18
|
suiteAfter(): void;
|
|
@@ -32,5 +35,7 @@ export declare class AllureCodeceptJsReporter {
|
|
|
32
35
|
stepFailed(): void;
|
|
33
36
|
stepComment(): void;
|
|
34
37
|
stepPassed(): void;
|
|
38
|
+
stopCurrentStep(updateFunc: (result: StepResult) => void): void;
|
|
39
|
+
afterAll(): void;
|
|
35
40
|
handleRuntimeMessage(message: RuntimeMessage): void;
|
|
36
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure-codeceptjs",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
4
4
|
"description": "Allure codeceptjs integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codeceptjs",
|
|
@@ -27,18 +27,20 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
+
"allure-report": "allure serve ./out/allure-results",
|
|
30
31
|
"clean": "rimraf ./dist ./out ./test-results",
|
|
31
32
|
"compile": "run-s 'compile:*'",
|
|
32
33
|
"compile:esm": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions '.ts' --source-maps",
|
|
33
34
|
"compile:cjs": "babel --config-file ./babel.cjs.json ./src --out-dir ./dist/cjs --extensions '.ts' --source-maps",
|
|
34
35
|
"compile:types": "tsc",
|
|
35
36
|
"compile:fixup": "node ./scripts/fixup.mjs",
|
|
37
|
+
"generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean",
|
|
36
38
|
"lint": "eslint ./src ./test --ext .ts",
|
|
37
39
|
"lint:fix": "eslint ./src ./test --ext .ts --fix",
|
|
38
40
|
"test": "vitest run"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
|
-
"allure-js-commons": "3.0.0-beta.
|
|
43
|
+
"allure-js-commons": "3.0.0-beta.5"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@babel/cli": "^7.24.6",
|
|
@@ -52,9 +54,11 @@
|
|
|
52
54
|
"@types/babel__preset-env": "^7",
|
|
53
55
|
"@types/eslint": "^8",
|
|
54
56
|
"@types/jasmine": "^5.1.4",
|
|
55
|
-
"@types/node": "^20.
|
|
57
|
+
"@types/node": "^20.14.2",
|
|
56
58
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
57
59
|
"@typescript-eslint/parser": "^7.0.0",
|
|
60
|
+
"allure-commandline": "^2.29.0",
|
|
61
|
+
"allure-vitest": "3.0.0-beta.5",
|
|
58
62
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
59
63
|
"codeceptjs": "^3.5.4",
|
|
60
64
|
"eslint": "^8.57.0",
|
|
@@ -69,6 +73,6 @@
|
|
|
69
73
|
"rimraf": "^5.0.1",
|
|
70
74
|
"ts-node": "^10.9.2",
|
|
71
75
|
"typescript": "^5.2.2",
|
|
72
|
-
"vitest": "^1.
|
|
76
|
+
"vitest": "^1.6.0"
|
|
73
77
|
}
|
|
74
78
|
}
|