allure-codeceptjs 3.0.0-beta.2 → 3.0.0-beta.4
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 +96 -71
- 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 +96 -71
- 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 +13 -6
- package/package.json +7 -3
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,11 +6,15 @@ 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");
|
|
12
13
|
var _helpers = require("./helpers.js");
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
16
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
17
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -19,22 +23,24 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
19
23
|
class AllureCodeceptJsReporter {
|
|
20
24
|
constructor(config) {
|
|
21
25
|
_defineProperty(this, "allureRuntime", void 0);
|
|
22
|
-
_defineProperty(this, "
|
|
26
|
+
_defineProperty(this, "currentTestUuid", void 0);
|
|
27
|
+
_defineProperty(this, "currentFixtureUuid", void 0);
|
|
28
|
+
_defineProperty(this, "scopeUuids", []);
|
|
23
29
|
_defineProperty(this, "currentTest", null);
|
|
24
30
|
_defineProperty(this, "config", void 0);
|
|
25
31
|
this.registerEvents();
|
|
26
32
|
this.config = config || {};
|
|
27
33
|
this.allureRuntime = new _reporter.ReporterRuntime(_objectSpread(_objectSpread({}, config), {}, {
|
|
28
|
-
writer:
|
|
34
|
+
writer: _nodeProcess.env.ALLURE_TEST_MODE ? new _reporter.MessageWriter() : new _reporter.FileSystemWriter({
|
|
29
35
|
resultsDir: config.resultsDir || "./allure-results"
|
|
30
36
|
})
|
|
31
37
|
}));
|
|
32
38
|
}
|
|
33
39
|
closeCurrentAllureTest(test) {
|
|
34
|
-
if (!this.
|
|
40
|
+
if (!this.currentTestUuid) {
|
|
35
41
|
return;
|
|
36
42
|
}
|
|
37
|
-
this.allureRuntime.updateTest(result => {
|
|
43
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
38
44
|
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
39
45
|
|
|
40
46
|
// @ts-ignore
|
|
@@ -47,12 +53,10 @@ class AllureCodeceptJsReporter {
|
|
|
47
53
|
name: "Repetition",
|
|
48
54
|
value: "".concat(test.retryNum + 1)
|
|
49
55
|
});
|
|
50
|
-
}, this.currentAllureResultUuid);
|
|
51
|
-
this.allureRuntime.stopTest({
|
|
52
|
-
uuid: this.currentAllureResultUuid
|
|
53
56
|
});
|
|
54
|
-
this.allureRuntime.
|
|
55
|
-
this.
|
|
57
|
+
this.allureRuntime.stopTest(this.currentTestUuid);
|
|
58
|
+
this.allureRuntime.writeTest(this.currentTestUuid);
|
|
59
|
+
this.currentTestUuid = undefined;
|
|
56
60
|
}
|
|
57
61
|
startAllureTest(test) {
|
|
58
62
|
var relativeFile = _nodePath.default.relative(codecept_dir, test.file).split(_nodePath.default.sep).join("/");
|
|
@@ -62,12 +66,12 @@ class AllureCodeceptJsReporter {
|
|
|
62
66
|
var {
|
|
63
67
|
labels
|
|
64
68
|
} = (0, _helpers.extractMeta)(test);
|
|
65
|
-
this.
|
|
69
|
+
this.currentTestUuid = this.allureRuntime.startTest({
|
|
66
70
|
name: titleMetadata.cleanTitle,
|
|
67
71
|
fullName,
|
|
68
72
|
testCaseId: (0, _reporter.md5)(fullName)
|
|
69
|
-
});
|
|
70
|
-
this.allureRuntime.updateTest(result => {
|
|
73
|
+
}, this.scopeUuids);
|
|
74
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
71
75
|
var _test$parent;
|
|
72
76
|
result.labels.push(...labels);
|
|
73
77
|
result.labels.push(...titleMetadata.labels);
|
|
@@ -85,123 +89,143 @@ class AllureCodeceptJsReporter {
|
|
|
85
89
|
value: test.parent.title
|
|
86
90
|
});
|
|
87
91
|
}
|
|
88
|
-
}, this.currentAllureResultUuid);
|
|
89
|
-
}
|
|
90
|
-
closeCurrentAllureStep() {
|
|
91
|
-
if (!this.currentAllureResultUuid) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
this.allureRuntime.updateStep(result => {
|
|
95
|
-
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
96
|
-
}, this.currentAllureResultUuid);
|
|
97
|
-
this.allureRuntime.stopStep({
|
|
98
|
-
uuid: this.currentAllureResultUuid
|
|
99
92
|
});
|
|
100
93
|
}
|
|
101
94
|
registerEvents() {
|
|
102
95
|
// Hooks
|
|
103
|
-
_codeceptjs.event.dispatcher.
|
|
104
|
-
_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));
|
|
98
|
+
// Suite
|
|
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));
|
|
105
101
|
// Test
|
|
106
|
-
_codeceptjs.event.dispatcher.
|
|
107
|
-
_codeceptjs.event.dispatcher.
|
|
108
|
-
_codeceptjs.event.dispatcher.
|
|
109
|
-
_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));
|
|
110
106
|
// Step
|
|
111
|
-
_codeceptjs.event.dispatcher.
|
|
112
|
-
_codeceptjs.event.dispatcher.
|
|
113
|
-
_codeceptjs.event.dispatcher.
|
|
114
|
-
_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));
|
|
113
|
+
}
|
|
114
|
+
suiteBefore() {
|
|
115
|
+
var scopeUuid = this.allureRuntime.startScope();
|
|
116
|
+
this.scopeUuids.push(scopeUuid);
|
|
117
|
+
}
|
|
118
|
+
suiteAfter() {
|
|
119
|
+
var suiteUuid = this.scopeUuids.pop();
|
|
120
|
+
if (suiteUuid) {
|
|
121
|
+
this.allureRuntime.writeScope(suiteUuid);
|
|
122
|
+
}
|
|
115
123
|
}
|
|
116
124
|
hookStarted(hook) {
|
|
117
125
|
var _hook$ctx;
|
|
118
|
-
var
|
|
119
|
-
|
|
126
|
+
var currentRunnable = hook === null || hook === void 0 || (_hook$ctx = hook.ctx) === null || _hook$ctx === void 0 ? void 0 : _hook$ctx.test;
|
|
127
|
+
var hookType = currentRunnable.title.match( /*#__PURE__*/_wrapRegExp(/^"(.+)" hook/, {
|
|
128
|
+
hookType: 1
|
|
129
|
+
})).groups.hookType;
|
|
130
|
+
var fixtureType = /before/.test(hookType) ? "before" : "after";
|
|
131
|
+
var scopeUuid = this.scopeUuids.length > 0 ? this.scopeUuids[this.scopeUuids.length - 1] : undefined;
|
|
132
|
+
if (!scopeUuid) {
|
|
120
133
|
return;
|
|
121
134
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
name: "before hook"
|
|
128
|
-
}, this.currentAllureResultUuid);
|
|
135
|
+
this.currentFixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {
|
|
136
|
+
name: currentRunnable.title,
|
|
137
|
+
stage: _allureJsCommons.Stage.RUNNING,
|
|
138
|
+
start: Date.now()
|
|
139
|
+
});
|
|
129
140
|
}
|
|
130
141
|
hookPassed() {
|
|
131
|
-
if (!this.
|
|
142
|
+
if (!this.currentFixtureUuid) {
|
|
132
143
|
return;
|
|
133
144
|
}
|
|
134
|
-
this.allureRuntime.
|
|
145
|
+
this.allureRuntime.updateFixture(this.currentFixtureUuid, result => {
|
|
135
146
|
result.status = _allureJsCommons.Status.PASSED;
|
|
136
147
|
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
137
|
-
}, this.currentAllureResultUuid);
|
|
138
|
-
this.allureRuntime.stopStep({
|
|
139
|
-
uuid: this.currentAllureResultUuid
|
|
140
148
|
});
|
|
149
|
+
this.allureRuntime.stopFixture(this.currentFixtureUuid);
|
|
141
150
|
}
|
|
142
151
|
testStarted(test) {
|
|
143
152
|
// test has been already started
|
|
144
|
-
if (this.
|
|
153
|
+
if (this.currentTestUuid) {
|
|
145
154
|
return;
|
|
146
155
|
}
|
|
147
156
|
this.startAllureTest(test);
|
|
148
157
|
}
|
|
149
158
|
testFailed(test, err) {
|
|
150
|
-
if (!this.
|
|
159
|
+
if (!this.currentTestUuid) {
|
|
151
160
|
return;
|
|
152
161
|
}
|
|
153
|
-
this.allureRuntime.updateTest(result => {
|
|
162
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
154
163
|
result.status = _allureJsCommons.Status.FAILED;
|
|
155
164
|
// @ts-ignore
|
|
156
165
|
result.statusDetails = (0, _sdk.getMessageAndTraceFromError)(err);
|
|
157
|
-
}
|
|
166
|
+
});
|
|
158
167
|
this.closeCurrentAllureTest(test);
|
|
159
168
|
}
|
|
160
169
|
testPassed(test) {
|
|
161
|
-
if (!this.
|
|
170
|
+
if (!this.currentTestUuid) {
|
|
162
171
|
return;
|
|
163
172
|
}
|
|
164
|
-
this.allureRuntime.updateTest(result => {
|
|
173
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
165
174
|
result.status = _allureJsCommons.Status.PASSED;
|
|
166
|
-
}
|
|
175
|
+
});
|
|
167
176
|
this.closeCurrentAllureTest(test);
|
|
168
177
|
}
|
|
169
178
|
testSkipped(test) {
|
|
170
|
-
if (!this.
|
|
179
|
+
if (!this.currentTestUuid) {
|
|
171
180
|
return;
|
|
172
181
|
}
|
|
173
|
-
this.allureRuntime.updateTest(result => {
|
|
182
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
174
183
|
result.status = _allureJsCommons.Status.SKIPPED;
|
|
175
184
|
if (test.opts.skipInfo) {
|
|
176
185
|
result.statusDetails = {
|
|
177
186
|
message: test.opts.skipInfo.message
|
|
178
187
|
};
|
|
179
188
|
}
|
|
180
|
-
}
|
|
189
|
+
});
|
|
181
190
|
this.closeCurrentAllureTest(test);
|
|
182
191
|
}
|
|
183
192
|
stepStarted(step) {
|
|
184
|
-
this.
|
|
193
|
+
if (!this.currentTestUuid) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
this.allureRuntime.startStep(this.currentTestUuid, undefined, {
|
|
185
197
|
name: "".concat(step.actor, " ").concat(step.name)
|
|
186
|
-
}
|
|
198
|
+
});
|
|
187
199
|
}
|
|
188
200
|
stepFailed() {
|
|
189
|
-
this.
|
|
201
|
+
this.stopCurrentStep(result => {
|
|
190
202
|
result.status = _allureJsCommons.Status.FAILED;
|
|
191
|
-
|
|
192
|
-
|
|
203
|
+
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
204
|
+
});
|
|
193
205
|
}
|
|
194
206
|
stepComment() {
|
|
195
|
-
this.
|
|
207
|
+
this.stopCurrentStep(result => {
|
|
196
208
|
result.status = _allureJsCommons.Status.PASSED;
|
|
197
|
-
|
|
198
|
-
|
|
209
|
+
result.stage = _allureJsCommons.Stage.FINISHED;
|
|
210
|
+
});
|
|
199
211
|
}
|
|
200
212
|
stepPassed() {
|
|
201
|
-
this.
|
|
213
|
+
this.stopCurrentStep(result => {
|
|
202
214
|
result.status = _allureJsCommons.Status.PASSED;
|
|
203
|
-
|
|
204
|
-
|
|
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();
|
|
205
229
|
}
|
|
206
230
|
|
|
207
231
|
// TODO: not implemented in the new version at all
|
|
@@ -216,9 +240,10 @@ class AllureCodeceptJsReporter {
|
|
|
216
240
|
// }
|
|
217
241
|
|
|
218
242
|
handleRuntimeMessage(message) {
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
}
|
|
243
|
+
if (!this.currentTestUuid) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this.allureRuntime.applyRuntimeMessages(this.currentTestUuid, [message]);
|
|
222
247
|
}
|
|
223
248
|
}
|
|
224
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","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","AllureCodeceptJsReporter","constructor","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","join","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","bind","passed","hookPassed","testStarted","skipped","testSkipped","testPassed","failed","testFailed","step","stepStarted","stepPassed","stepFailed","comment","stepComment","_hook$ctx","currentTest","ctx","startStep","status","Status","PASSED","err","FAILED","statusDetails","getMessageAndTraceFromError","SKIPPED","opts","skipInfo","message","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 // 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 hookStarted(hook: CodeceptHook) {\n const currentTest = hook?.ctx?.currentTest;\n\n if (!currentTest) {\n return;\n }\n\n // @ts-ignore\n this.startAllureTest(currentTest);\n // TODO: group before hooks into fixture\n this.allureRuntime!.startStep(\n {\n name: \"before hook\",\n },\n this.currentAllureResultUuid!,\n );\n }\n\n hookPassed() {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n }, this.currentAllureResultUuid);\n this.allureRuntime!.stopStep({ uuid: this.currentAllureResultUuid });\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,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA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CAAA,EAAG;IACZ,IAAI,CAACxE,aAAa,CAAEkD,UAAU,CAAEvC,MAAM,IAAK;MACzCA,MAAM,CAACkE,MAAM,GAAGC,uBAAM,CAACC,MAAM;IAC/B,CAAC,EAAE,IAAI,CAACtE,uBAAwB,CAAC;IACjC,IAAI,CAACwC,sBAAsB,CAAC,CAAC;EAC/B;EAEAoB,UAAUA,CAAA,EAAG;IACX,IAAI,CAACrE,aAAa,CAAEkD,UAAU,CAAEvC,MAAM,IAAK;MACzCA,MAAM,CAACkE,MAAM,GAAGC,uBAAM,CAACC,MAAM;IAC/B,CAAC,EAAE,IAAI,CAACtE,uBAAwB,CAAC;IACjC,IAAI,CAACwC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEAwC,oBAAoBA,CAACF,OAAuB,EAAE;IAC5C,IAAI,CAACvF,aAAa,CAAE0F,oBAAoB,CAAC,CAACH,OAAO,CAAC,EAAE;MAAEI,QAAQ,EAAE,IAAI,CAAClF;IAAyB,CAAC,CAAC;EAClG;AACF;AAACmF,OAAA,CAAAhG,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,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,IAAAc,eAAA,CAAAH,CAAA,EAAAN,WAAA,CAAAE,SAAA,cAAAQ,YAAAf,CAAA,EAAAS,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,IAAAT,CAAA,CAAAW,CAAA,kBAAAQ,CAAA,iBAAAnB,CAAA,CAAAW,CAAA,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AC9G,aAAa,CAAC+G,UAAU,CAACD,WAAW,EAAED,UAAU,CAAC;IACtD,IAAI,CAAC7G,aAAa,CAACgH,QAAQ,CAACF,WAAW,CAAC;EAC1C;EAEAnC,QAAQA,CAAA,EAAG;IACT,IAAI,CAAC3E,aAAa,CAACiH,oBAAoB,CAAC,CAAC;IACzC,IAAI,CAACjH,aAAa,CAACkH,0BAA0B,CAAC,CAAC;EACjD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEAC,oBAAoBA,CAACV,OAAuB,EAAE;IAC5C,IAAI,CAAC,IAAI,CAAC/F,eAAe,EAAE;MACzB;IACF;IACA,IAAI,CAACV,aAAa,CAACoH,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
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
2
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
3
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
1
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
6
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -5,6 +8,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
5
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); }
|
|
6
9
|
import { event } from "codeceptjs";
|
|
7
10
|
import path from "node:path";
|
|
11
|
+
import { env } from "node:process";
|
|
8
12
|
import { LabelName, Stage, Status } from "allure-js-commons";
|
|
9
13
|
import { extractMetadataFromString, getMessageAndTraceFromError } from "allure-js-commons/sdk";
|
|
10
14
|
import { FileSystemWriter, MessageWriter, ReporterRuntime, md5 } from "allure-js-commons/sdk/reporter";
|
|
@@ -12,22 +16,24 @@ import { extractMeta } from "./helpers.js";
|
|
|
12
16
|
export class AllureCodeceptJsReporter {
|
|
13
17
|
constructor(config) {
|
|
14
18
|
_defineProperty(this, "allureRuntime", void 0);
|
|
15
|
-
_defineProperty(this, "
|
|
19
|
+
_defineProperty(this, "currentTestUuid", void 0);
|
|
20
|
+
_defineProperty(this, "currentFixtureUuid", void 0);
|
|
21
|
+
_defineProperty(this, "scopeUuids", []);
|
|
16
22
|
_defineProperty(this, "currentTest", null);
|
|
17
23
|
_defineProperty(this, "config", void 0);
|
|
18
24
|
this.registerEvents();
|
|
19
25
|
this.config = config || {};
|
|
20
26
|
this.allureRuntime = new ReporterRuntime(_objectSpread(_objectSpread({}, config), {}, {
|
|
21
|
-
writer:
|
|
27
|
+
writer: env.ALLURE_TEST_MODE ? new MessageWriter() : new FileSystemWriter({
|
|
22
28
|
resultsDir: config.resultsDir || "./allure-results"
|
|
23
29
|
})
|
|
24
30
|
}));
|
|
25
31
|
}
|
|
26
32
|
closeCurrentAllureTest(test) {
|
|
27
|
-
if (!this.
|
|
33
|
+
if (!this.currentTestUuid) {
|
|
28
34
|
return;
|
|
29
35
|
}
|
|
30
|
-
this.allureRuntime.updateTest(result => {
|
|
36
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
31
37
|
result.stage = Stage.FINISHED;
|
|
32
38
|
|
|
33
39
|
// @ts-ignore
|
|
@@ -40,12 +46,10 @@ export class AllureCodeceptJsReporter {
|
|
|
40
46
|
name: "Repetition",
|
|
41
47
|
value: "".concat(test.retryNum + 1)
|
|
42
48
|
});
|
|
43
|
-
}, this.currentAllureResultUuid);
|
|
44
|
-
this.allureRuntime.stopTest({
|
|
45
|
-
uuid: this.currentAllureResultUuid
|
|
46
49
|
});
|
|
47
|
-
this.allureRuntime.
|
|
48
|
-
this.
|
|
50
|
+
this.allureRuntime.stopTest(this.currentTestUuid);
|
|
51
|
+
this.allureRuntime.writeTest(this.currentTestUuid);
|
|
52
|
+
this.currentTestUuid = undefined;
|
|
49
53
|
}
|
|
50
54
|
startAllureTest(test) {
|
|
51
55
|
var relativeFile = path.relative(codecept_dir, test.file).split(path.sep).join("/");
|
|
@@ -55,12 +59,12 @@ export class AllureCodeceptJsReporter {
|
|
|
55
59
|
var {
|
|
56
60
|
labels
|
|
57
61
|
} = extractMeta(test);
|
|
58
|
-
this.
|
|
62
|
+
this.currentTestUuid = this.allureRuntime.startTest({
|
|
59
63
|
name: titleMetadata.cleanTitle,
|
|
60
64
|
fullName,
|
|
61
65
|
testCaseId: md5(fullName)
|
|
62
|
-
});
|
|
63
|
-
this.allureRuntime.updateTest(result => {
|
|
66
|
+
}, this.scopeUuids);
|
|
67
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
64
68
|
var _test$parent;
|
|
65
69
|
result.labels.push(...labels);
|
|
66
70
|
result.labels.push(...titleMetadata.labels);
|
|
@@ -78,123 +82,143 @@ export class AllureCodeceptJsReporter {
|
|
|
78
82
|
value: test.parent.title
|
|
79
83
|
});
|
|
80
84
|
}
|
|
81
|
-
}, this.currentAllureResultUuid);
|
|
82
|
-
}
|
|
83
|
-
closeCurrentAllureStep() {
|
|
84
|
-
if (!this.currentAllureResultUuid) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
this.allureRuntime.updateStep(result => {
|
|
88
|
-
result.stage = Stage.FINISHED;
|
|
89
|
-
}, this.currentAllureResultUuid);
|
|
90
|
-
this.allureRuntime.stopStep({
|
|
91
|
-
uuid: this.currentAllureResultUuid
|
|
92
85
|
});
|
|
93
86
|
}
|
|
94
87
|
registerEvents() {
|
|
95
88
|
// Hooks
|
|
96
|
-
event.dispatcher.
|
|
97
|
-
event.dispatcher.
|
|
89
|
+
event.dispatcher.on(event.hook.started, this.hookStarted.bind(this));
|
|
90
|
+
event.dispatcher.on(event.hook.passed, this.hookPassed.bind(this));
|
|
91
|
+
// Suite
|
|
92
|
+
event.dispatcher.on(event.suite.before, this.suiteBefore.bind(this));
|
|
93
|
+
event.dispatcher.on(event.suite.after, this.suiteAfter.bind(this));
|
|
98
94
|
// Test
|
|
99
|
-
event.dispatcher.
|
|
100
|
-
event.dispatcher.
|
|
101
|
-
event.dispatcher.
|
|
102
|
-
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));
|
|
103
99
|
// Step
|
|
104
|
-
event.dispatcher.
|
|
105
|
-
event.dispatcher.
|
|
106
|
-
event.dispatcher.
|
|
107
|
-
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));
|
|
106
|
+
}
|
|
107
|
+
suiteBefore() {
|
|
108
|
+
var scopeUuid = this.allureRuntime.startScope();
|
|
109
|
+
this.scopeUuids.push(scopeUuid);
|
|
110
|
+
}
|
|
111
|
+
suiteAfter() {
|
|
112
|
+
var suiteUuid = this.scopeUuids.pop();
|
|
113
|
+
if (suiteUuid) {
|
|
114
|
+
this.allureRuntime.writeScope(suiteUuid);
|
|
115
|
+
}
|
|
108
116
|
}
|
|
109
117
|
hookStarted(hook) {
|
|
110
118
|
var _hook$ctx;
|
|
111
|
-
var
|
|
112
|
-
|
|
119
|
+
var currentRunnable = hook === null || hook === void 0 || (_hook$ctx = hook.ctx) === null || _hook$ctx === void 0 ? void 0 : _hook$ctx.test;
|
|
120
|
+
var hookType = currentRunnable.title.match( /*#__PURE__*/_wrapRegExp(/^"(.+)" hook/, {
|
|
121
|
+
hookType: 1
|
|
122
|
+
})).groups.hookType;
|
|
123
|
+
var fixtureType = /before/.test(hookType) ? "before" : "after";
|
|
124
|
+
var scopeUuid = this.scopeUuids.length > 0 ? this.scopeUuids[this.scopeUuids.length - 1] : undefined;
|
|
125
|
+
if (!scopeUuid) {
|
|
113
126
|
return;
|
|
114
127
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
name: "before hook"
|
|
121
|
-
}, this.currentAllureResultUuid);
|
|
128
|
+
this.currentFixtureUuid = this.allureRuntime.startFixture(scopeUuid, fixtureType, {
|
|
129
|
+
name: currentRunnable.title,
|
|
130
|
+
stage: Stage.RUNNING,
|
|
131
|
+
start: Date.now()
|
|
132
|
+
});
|
|
122
133
|
}
|
|
123
134
|
hookPassed() {
|
|
124
|
-
if (!this.
|
|
135
|
+
if (!this.currentFixtureUuid) {
|
|
125
136
|
return;
|
|
126
137
|
}
|
|
127
|
-
this.allureRuntime.
|
|
138
|
+
this.allureRuntime.updateFixture(this.currentFixtureUuid, result => {
|
|
128
139
|
result.status = Status.PASSED;
|
|
129
140
|
result.stage = Stage.FINISHED;
|
|
130
|
-
}, this.currentAllureResultUuid);
|
|
131
|
-
this.allureRuntime.stopStep({
|
|
132
|
-
uuid: this.currentAllureResultUuid
|
|
133
141
|
});
|
|
142
|
+
this.allureRuntime.stopFixture(this.currentFixtureUuid);
|
|
134
143
|
}
|
|
135
144
|
testStarted(test) {
|
|
136
145
|
// test has been already started
|
|
137
|
-
if (this.
|
|
146
|
+
if (this.currentTestUuid) {
|
|
138
147
|
return;
|
|
139
148
|
}
|
|
140
149
|
this.startAllureTest(test);
|
|
141
150
|
}
|
|
142
151
|
testFailed(test, err) {
|
|
143
|
-
if (!this.
|
|
152
|
+
if (!this.currentTestUuid) {
|
|
144
153
|
return;
|
|
145
154
|
}
|
|
146
|
-
this.allureRuntime.updateTest(result => {
|
|
155
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
147
156
|
result.status = Status.FAILED;
|
|
148
157
|
// @ts-ignore
|
|
149
158
|
result.statusDetails = getMessageAndTraceFromError(err);
|
|
150
|
-
}
|
|
159
|
+
});
|
|
151
160
|
this.closeCurrentAllureTest(test);
|
|
152
161
|
}
|
|
153
162
|
testPassed(test) {
|
|
154
|
-
if (!this.
|
|
163
|
+
if (!this.currentTestUuid) {
|
|
155
164
|
return;
|
|
156
165
|
}
|
|
157
|
-
this.allureRuntime.updateTest(result => {
|
|
166
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
158
167
|
result.status = Status.PASSED;
|
|
159
|
-
}
|
|
168
|
+
});
|
|
160
169
|
this.closeCurrentAllureTest(test);
|
|
161
170
|
}
|
|
162
171
|
testSkipped(test) {
|
|
163
|
-
if (!this.
|
|
172
|
+
if (!this.currentTestUuid) {
|
|
164
173
|
return;
|
|
165
174
|
}
|
|
166
|
-
this.allureRuntime.updateTest(result => {
|
|
175
|
+
this.allureRuntime.updateTest(this.currentTestUuid, result => {
|
|
167
176
|
result.status = Status.SKIPPED;
|
|
168
177
|
if (test.opts.skipInfo) {
|
|
169
178
|
result.statusDetails = {
|
|
170
179
|
message: test.opts.skipInfo.message
|
|
171
180
|
};
|
|
172
181
|
}
|
|
173
|
-
}
|
|
182
|
+
});
|
|
174
183
|
this.closeCurrentAllureTest(test);
|
|
175
184
|
}
|
|
176
185
|
stepStarted(step) {
|
|
177
|
-
this.
|
|
186
|
+
if (!this.currentTestUuid) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
this.allureRuntime.startStep(this.currentTestUuid, undefined, {
|
|
178
190
|
name: "".concat(step.actor, " ").concat(step.name)
|
|
179
|
-
}
|
|
191
|
+
});
|
|
180
192
|
}
|
|
181
193
|
stepFailed() {
|
|
182
|
-
this.
|
|
194
|
+
this.stopCurrentStep(result => {
|
|
183
195
|
result.status = Status.FAILED;
|
|
184
|
-
|
|
185
|
-
|
|
196
|
+
result.stage = Stage.FINISHED;
|
|
197
|
+
});
|
|
186
198
|
}
|
|
187
199
|
stepComment() {
|
|
188
|
-
this.
|
|
200
|
+
this.stopCurrentStep(result => {
|
|
189
201
|
result.status = Status.PASSED;
|
|
190
|
-
|
|
191
|
-
|
|
202
|
+
result.stage = Stage.FINISHED;
|
|
203
|
+
});
|
|
192
204
|
}
|
|
193
205
|
stepPassed() {
|
|
194
|
-
this.
|
|
206
|
+
this.stopCurrentStep(result => {
|
|
195
207
|
result.status = Status.PASSED;
|
|
196
|
-
|
|
197
|
-
|
|
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();
|
|
198
222
|
}
|
|
199
223
|
|
|
200
224
|
// TODO: not implemented in the new version at all
|
|
@@ -209,9 +233,10 @@ export class AllureCodeceptJsReporter {
|
|
|
209
233
|
// }
|
|
210
234
|
|
|
211
235
|
handleRuntimeMessage(message) {
|
|
212
|
-
this.
|
|
213
|
-
|
|
214
|
-
}
|
|
236
|
+
if (!this.currentTestUuid) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
this.allureRuntime.applyRuntimeMessages(this.currentTestUuid, [message]);
|
|
215
240
|
}
|
|
216
241
|
}
|
|
217
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","testStarted","skipped","testSkipped","testPassed","failed","testFailed","step","stepStarted","stepPassed","stepFailed","comment","stepComment","_hook$ctx","currentTest","ctx","startStep","status","PASSED","err","FAILED","statusDetails","SKIPPED","opts","skipInfo","message","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 // 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 hookStarted(hook: CodeceptHook) {\n const currentTest = hook?.ctx?.currentTest;\n\n if (!currentTest) {\n return;\n }\n\n // @ts-ignore\n this.startAllureTest(currentTest);\n // TODO: group before hooks into fixture\n this.allureRuntime!.startStep(\n {\n name: \"before hook\",\n },\n this.currentAllureResultUuid!,\n );\n }\n\n hookPassed() {\n if (!this.currentAllureResultUuid) {\n return;\n }\n\n this.allureRuntime!.updateStep((result) => {\n result.status = Status.PASSED;\n result.stage = Stage.FINISHED;\n }, this.currentAllureResultUuid);\n this.allureRuntime!.stopStep({ uuid: this.currentAllureResultUuid });\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,aAAa,GAAG,IAAIR,eAAe,CAAAS,aAAA,CAAAA,aAAA,KACnCJ,MAAM;MACTK,MAAM,EAAEL,MAAM,CAACM,QAAQ,GACnB,IAAIZ,aAAa,CAAC,CAAC,GACnB,IAAID,gBAAgB,CAAC;QACnBc,UAAU,EAAEP,MAAM,CAACO,UAAU,IAAI;MACnC,CAAC;IAAC,EACP,CAAC;EACJ;EAEQC,sBAAsBA,CAACC,IAAkB,EAAE;IACjD,IAAI,CAAC,IAAI,CAACC,uBAAuB,EAAE;MACjC;IACF;IAEA,IAAI,CAACP,aAAa,CAAEQ,UAAU,CAAEC,MAAM,IAAK;MACzCA,MAAM,CAACC,KAAK,GAAGxB,KAAK,CAACyB,QAAQ;;MAE7B;MACA,IAAIL,IAAI,CAACM,QAAQ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MAAM,CAACsF,MAAM;IAC/B,CAAC,EAAE,IAAI,CAAClE,uBAAwB,CAAC;IACjC,IAAI,CAACoC,sBAAsB,CAAC,CAAC;EAC/B;EAEAsB,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACjE,aAAa,CAAE4C,UAAU,CAAEnC,MAAM,IAAK;MACzCA,MAAM,CAAC6D,MAAM,GAAGnF,MAAM,CAACoF,MAAM;IAC/B,CAAC,EAAE,IAAI,CAAChE,uBAAwB,CAAC;IACjC,IAAI,CAACoC,sBAAsB,CAAC,CAAC;EAC/B;EAEAmB,UAAUA,CAAA,EAAG;IACX,IAAI,CAAC9D,aAAa,CAAE4C,UAAU,CAAEnC,MAAM,IAAK;MACzCA,MAAM,CAAC6D,MAAM,GAAGnF,MAAM,CAACoF,MAAM;IAC/B,CAAC,EAAE,IAAI,CAAChE,uBAAwB,CAAC;IACjC,IAAI,CAACoC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEAqC,oBAAoBA,CAACF,OAAuB,EAAE;IAC5C,IAAI,CAAC9E,aAAa,CAAEiF,oBAAoB,CAAC,CAACH,OAAO,CAAC,EAAE;MAAEI,QAAQ,EAAE,IAAI,CAAC3E;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,EAAE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AAG,IAAI,CAACP,aAAa,CAACyG,WAAW,CAAC,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,16 +1,21 @@
|
|
|
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;
|
|
17
|
+
suiteBefore(): void;
|
|
18
|
+
suiteAfter(): void;
|
|
14
19
|
hookStarted(hook: CodeceptHook): void;
|
|
15
20
|
hookPassed(): void;
|
|
16
21
|
testStarted(test: CodeceptTest & {
|
|
@@ -30,5 +35,7 @@ export declare class AllureCodeceptJsReporter {
|
|
|
30
35
|
stepFailed(): void;
|
|
31
36
|
stepComment(): void;
|
|
32
37
|
stepPassed(): void;
|
|
38
|
+
stopCurrentStep(updateFunc: (result: StepResult) => void): void;
|
|
39
|
+
afterAll(): void;
|
|
33
40
|
handleRuntimeMessage(message: RuntimeMessage): void;
|
|
34
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.4",
|
|
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.4"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@babel/cli": "^7.24.6",
|
|
@@ -55,6 +57,8 @@
|
|
|
55
57
|
"@types/node": "^20.6.3",
|
|
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.4",
|
|
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
|
}
|