allure-js-commons 3.0.0-beta.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/sdk/index.js +12 -0
- package/dist/cjs/sdk/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/LifecycleState.js +39 -19
- package/dist/cjs/sdk/reporter/LifecycleState.js.map +1 -1
- package/dist/cjs/sdk/reporter/ReporterRuntime.js +89 -21
- package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/cjs/sdk/reporter/index.js +22 -1
- package/dist/cjs/sdk/reporter/index.js.map +1 -1
- package/dist/cjs/sdk/reporter/types.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils/labels.js +22 -3
- package/dist/cjs/sdk/reporter/utils/labels.js.map +1 -1
- package/dist/cjs/sdk/reporter/utils.js +17 -17
- package/dist/cjs/sdk/reporter/utils.js.map +1 -1
- package/dist/cjs/sdk/reporter/writer/MessageReader.js +3 -0
- package/dist/cjs/sdk/reporter/writer/MessageReader.js.map +1 -1
- package/dist/cjs/sdk/types.js.map +1 -1
- package/dist/cjs/sdk/utils.js +43 -1
- package/dist/cjs/sdk/utils.js.map +1 -1
- package/dist/esm/sdk/index.js +1 -1
- package/dist/esm/sdk/index.js.map +1 -1
- package/dist/esm/sdk/reporter/LifecycleState.js +39 -19
- package/dist/esm/sdk/reporter/LifecycleState.js.map +1 -1
- package/dist/esm/sdk/reporter/ReporterRuntime.js +89 -21
- package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
- package/dist/esm/sdk/reporter/index.js +1 -1
- package/dist/esm/sdk/reporter/index.js.map +1 -1
- package/dist/esm/sdk/reporter/types.js.map +1 -1
- package/dist/esm/sdk/reporter/utils/labels.js +17 -2
- package/dist/esm/sdk/reporter/utils/labels.js.map +1 -1
- package/dist/esm/sdk/reporter/utils.js +13 -13
- package/dist/esm/sdk/reporter/utils.js.map +1 -1
- package/dist/esm/sdk/reporter/writer/MessageReader.js +3 -0
- package/dist/esm/sdk/reporter/writer/MessageReader.js.map +1 -1
- package/dist/esm/sdk/types.js.map +1 -1
- package/dist/esm/sdk/utils.js +41 -0
- package/dist/esm/sdk/utils.js.map +1 -1
- package/dist/types/sdk/index.d.ts +1 -1
- package/dist/types/sdk/reporter/LifecycleState.d.ts +6 -8
- package/dist/types/sdk/reporter/index.d.ts +1 -1
- package/dist/types/sdk/reporter/types.d.ts +13 -3
- package/dist/types/sdk/reporter/utils/labels.d.ts +4 -1
- package/dist/types/sdk/reporter/utils.d.ts +10 -2
- package/dist/types/sdk/reporter/writer/MessageReader.d.ts +1 -0
- package/dist/types/sdk/types.d.ts +4 -0
- package/dist/types/sdk/utils.d.ts +3 -1
- package/package.json +3 -3
|
@@ -3,66 +3,86 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
3
3
|
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; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
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
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
7
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
8
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
9
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
10
|
+
var _scopes = /*#__PURE__*/new WeakMap();
|
|
11
|
+
var _testResults = /*#__PURE__*/new WeakMap();
|
|
12
|
+
var _stepResults = /*#__PURE__*/new WeakMap();
|
|
13
|
+
var _fixturesResults = /*#__PURE__*/new WeakMap();
|
|
6
14
|
export class LifecycleState {
|
|
7
15
|
constructor() {
|
|
8
16
|
var _this = this;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_defineProperty(this, "getScope", uuid => this.
|
|
14
|
-
_defineProperty(this, "getWrappedFixtureResult", uuid => this.
|
|
17
|
+
_classPrivateFieldInitSpec(this, _scopes, new Map());
|
|
18
|
+
_classPrivateFieldInitSpec(this, _testResults, new Map());
|
|
19
|
+
_classPrivateFieldInitSpec(this, _stepResults, new Map());
|
|
20
|
+
_classPrivateFieldInitSpec(this, _fixturesResults, new Map());
|
|
21
|
+
_defineProperty(this, "getScope", uuid => _classPrivateFieldGet(_scopes, this).get(uuid));
|
|
22
|
+
_defineProperty(this, "getWrappedFixtureResult", uuid => _classPrivateFieldGet(_fixturesResults, this).get(uuid));
|
|
15
23
|
_defineProperty(this, "getFixtureResult", uuid => {
|
|
16
24
|
var _this$getWrappedFixtu;
|
|
17
25
|
return (_this$getWrappedFixtu = this.getWrappedFixtureResult(uuid)) === null || _this$getWrappedFixtu === void 0 ? void 0 : _this$getWrappedFixtu.value;
|
|
18
26
|
});
|
|
19
|
-
_defineProperty(this, "
|
|
20
|
-
_defineProperty(this, "
|
|
27
|
+
_defineProperty(this, "getWrappedTestResult", uuid => _classPrivateFieldGet(_testResults, this).get(uuid));
|
|
28
|
+
_defineProperty(this, "getTestResult", uuid => {
|
|
29
|
+
var _this$getWrappedTestR;
|
|
30
|
+
return (_this$getWrappedTestR = this.getWrappedTestResult(uuid)) === null || _this$getWrappedTestR === void 0 ? void 0 : _this$getWrappedTestR.value;
|
|
31
|
+
});
|
|
32
|
+
_defineProperty(this, "getStepResult", uuid => _classPrivateFieldGet(_stepResults, this).get(uuid));
|
|
21
33
|
_defineProperty(this, "getExecutionItem", uuid => {
|
|
22
34
|
var _ref, _this$getFixtureResul;
|
|
23
35
|
return (_ref = (_this$getFixtureResul = this.getFixtureResult(uuid)) !== null && _this$getFixtureResul !== void 0 ? _this$getFixtureResul : this.getTestResult(uuid)) !== null && _ref !== void 0 ? _ref : this.getStepResult(uuid);
|
|
24
36
|
});
|
|
25
37
|
// test results
|
|
26
|
-
_defineProperty(this, "setTestResult", (uuid, result)
|
|
27
|
-
|
|
38
|
+
_defineProperty(this, "setTestResult", function (uuid, result) {
|
|
39
|
+
var scopeUuids = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
40
|
+
_classPrivateFieldGet(_testResults, _this).set(uuid, {
|
|
41
|
+
value: result,
|
|
42
|
+
scopeUuids
|
|
43
|
+
});
|
|
28
44
|
});
|
|
29
45
|
_defineProperty(this, "deleteTestResult", uuid => {
|
|
30
|
-
this.
|
|
46
|
+
_classPrivateFieldGet(_testResults, this).delete(uuid);
|
|
31
47
|
});
|
|
32
48
|
// steps
|
|
33
49
|
_defineProperty(this, "setStepResult", (uuid, result) => {
|
|
34
|
-
this.
|
|
50
|
+
_classPrivateFieldGet(_stepResults, this).set(uuid, result);
|
|
35
51
|
});
|
|
36
52
|
_defineProperty(this, "deleteStepResult", uuid => {
|
|
37
|
-
this.
|
|
53
|
+
_classPrivateFieldGet(_stepResults, this).delete(uuid);
|
|
38
54
|
});
|
|
39
55
|
// fixtures
|
|
40
|
-
_defineProperty(this, "setFixtureResult", (uuid, type, result) => {
|
|
56
|
+
_defineProperty(this, "setFixtureResult", (scopeUuid, uuid, type, result) => {
|
|
41
57
|
var wrappedResult = {
|
|
42
58
|
uuid,
|
|
43
59
|
type,
|
|
44
|
-
value: result
|
|
60
|
+
value: result,
|
|
61
|
+
scopeUuid
|
|
45
62
|
};
|
|
46
|
-
this.
|
|
63
|
+
_classPrivateFieldGet(_fixturesResults, this).set(uuid, wrappedResult);
|
|
47
64
|
return wrappedResult;
|
|
48
65
|
});
|
|
49
66
|
_defineProperty(this, "deleteFixtureResult", uuid => {
|
|
50
|
-
this.
|
|
67
|
+
_classPrivateFieldGet(_fixturesResults, this).delete(uuid);
|
|
51
68
|
});
|
|
52
69
|
// test scopes
|
|
53
70
|
_defineProperty(this, "setScope", function (uuid) {
|
|
54
71
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
55
72
|
var scope = _objectSpread(_objectSpread({
|
|
73
|
+
labels: [],
|
|
74
|
+
links: [],
|
|
75
|
+
parameters: [],
|
|
56
76
|
fixtures: [],
|
|
57
77
|
tests: []
|
|
58
78
|
}, data), {}, {
|
|
59
79
|
uuid
|
|
60
80
|
});
|
|
61
|
-
_this.
|
|
81
|
+
_classPrivateFieldGet(_scopes, _this).set(uuid, scope);
|
|
62
82
|
return scope;
|
|
63
83
|
});
|
|
64
84
|
_defineProperty(this, "deleteScope", uuid => {
|
|
65
|
-
this.
|
|
85
|
+
_classPrivateFieldGet(_scopes, this).delete(uuid);
|
|
66
86
|
});
|
|
67
87
|
}
|
|
68
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LifecycleState.js","names":["LifecycleState","constructor","_this","
|
|
1
|
+
{"version":3,"file":"LifecycleState.js","names":["LifecycleState","constructor","_this","_classPrivateFieldInitSpec","_scopes","Map","_testResults","_stepResults","_fixturesResults","_defineProperty","uuid","_classPrivateFieldGet","get","_this$getWrappedFixtu","getWrappedFixtureResult","value","_this$getWrappedTestR","getWrappedTestResult","_ref","_this$getFixtureResul","getFixtureResult","getTestResult","getStepResult","result","scopeUuids","arguments","length","undefined","set","delete","scopeUuid","type","wrappedResult","data","scope","_objectSpread","labels","links","parameters","fixtures","tests"],"sources":["../../../../src/sdk/reporter/LifecycleState.ts"],"sourcesContent":["import type { FixtureResult, StepResult, TestResult } from \"../../model.js\";\nimport type { FixtureResultWrapper, FixtureType, TestResultWrapper, TestScope } from \"./types.js\";\n\nexport class LifecycleState {\n #scopes = new Map<string, TestScope>();\n\n #testResults = new Map<string, TestResultWrapper>();\n\n #stepResults = new Map<string, StepResult>();\n\n #fixturesResults = new Map<string, FixtureResultWrapper>();\n\n getScope = (uuid: string) => this.#scopes.get(uuid);\n\n getWrappedFixtureResult = (uuid: string) => this.#fixturesResults.get(uuid);\n\n getFixtureResult = (uuid: string) => this.getWrappedFixtureResult(uuid)?.value;\n\n getWrappedTestResult = (uuid: string) => this.#testResults.get(uuid);\n\n getTestResult = (uuid: string) => this.getWrappedTestResult(uuid)?.value;\n\n getStepResult = (uuid: string) => this.#stepResults.get(uuid);\n\n getExecutionItem = (uuid: string): FixtureResult | TestResult | StepResult | undefined =>\n this.getFixtureResult(uuid) ?? this.getTestResult(uuid) ?? this.getStepResult(uuid);\n\n // test results\n setTestResult = (uuid: string, result: TestResult, scopeUuids: string[] = []) => {\n this.#testResults.set(uuid, { value: result, scopeUuids });\n };\n\n deleteTestResult = (uuid: string) => {\n this.#testResults.delete(uuid);\n };\n\n // steps\n setStepResult = (uuid: string, result: StepResult) => {\n this.#stepResults.set(uuid, result);\n };\n\n deleteStepResult = (uuid: string) => {\n this.#stepResults.delete(uuid);\n };\n\n // fixtures\n setFixtureResult = (scopeUuid: string, uuid: string, type: FixtureType, result: FixtureResult) => {\n const wrappedResult: FixtureResultWrapper = {\n uuid,\n type,\n value: result,\n scopeUuid,\n };\n this.#fixturesResults.set(uuid, wrappedResult);\n return wrappedResult;\n };\n\n deleteFixtureResult = (uuid: string) => {\n this.#fixturesResults.delete(uuid);\n };\n\n // test scopes\n setScope = (uuid: string, data: Partial<TestScope> = {}) => {\n const scope: TestScope = {\n labels: [],\n links: [],\n parameters: [],\n fixtures: [],\n tests: [],\n ...data,\n uuid,\n };\n this.#scopes.set(uuid, scope);\n return scope;\n };\n\n deleteScope = (uuid: string) => {\n this.#scopes.delete(uuid);\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,OAAO,MA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gB,EAArB,IAAoB,CAAC,CAACqB,MAAM,CAACnB,IAAI,CAAC;IACpC,CAAC;IAED;IAAAD,eAAA,mBACW,UAACC,IAAY,EAAoC;MAAA,IAAlCuB,IAAwB,GAAAR,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;MACrD,IAAMS,KAAgB,GAAAC,aAAA,CAAAA,aAAA;QACpBC,MAAM,EAAE,EAAE;QACVC,KAAK,EAAE,EAAE;QACTC,UAAU,EAAE,EAAE;QACdC,QAAQ,EAAE,EAAE;QACZC,KAAK,EAAE;MAAE,GACNP,IAAI;QACPvB;MAAI,EACL;MACDC,qBAAA,CAAKP,OAAO,EAAZF,KAAW,CAAC,CAAC0B,GAAG,CAAClB,IAAI,EAAEwB,KAAK,CAAC;MAC7B,OAAOA,KAAK;IACd,CAAC;IAAAzB,eAAA,sBAEcC,IAAY,IAAK;MAC9BC,qBAAA,CAAKP,OAAO,EAAZ,IAAW,CAAC,CAACyB,MAAM,CAACnB,IAAI,CAAC;IAC3B,CAAC;EAAA;AACH","ignoreList":[]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var _excluded = ["links", "labels", "parameters", "displayName"];
|
|
2
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
4
1
|
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; }
|
|
5
2
|
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; }
|
|
6
3
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
@@ -124,7 +121,7 @@ export class ReporterRuntime {
|
|
|
124
121
|
return;
|
|
125
122
|
}
|
|
126
123
|
var uuid = randomUuid();
|
|
127
|
-
var wrappedFixture = this.state.setFixtureResult(uuid, type, _objectSpread(_objectSpread({}, createFixtureResult()), {}, {
|
|
124
|
+
var wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, _objectSpread(_objectSpread({}, createFixtureResult()), {}, {
|
|
128
125
|
start: Date.now()
|
|
129
126
|
}, fixtureResult));
|
|
130
127
|
scope.fixtures.push(wrappedFixture);
|
|
@@ -167,7 +164,7 @@ export class ReporterRuntime {
|
|
|
167
164
|
}
|
|
168
165
|
scope.tests.push(uuid);
|
|
169
166
|
});
|
|
170
|
-
_this.state.setTestResult(uuid, testResult);
|
|
167
|
+
_this.state.setTestResult(uuid, testResult, scopeUuids);
|
|
171
168
|
_this.notifier.afterTestResultStart(testResult);
|
|
172
169
|
return uuid;
|
|
173
170
|
});
|
|
@@ -184,22 +181,44 @@ export class ReporterRuntime {
|
|
|
184
181
|
});
|
|
185
182
|
_defineProperty(this, "stopTest", (uuid, opts) => {
|
|
186
183
|
var _testResult$testCaseI, _testResult$historyId;
|
|
187
|
-
var
|
|
188
|
-
if (!
|
|
184
|
+
var wrapped = this.state.getWrappedTestResult(uuid);
|
|
185
|
+
if (!wrapped) {
|
|
189
186
|
// eslint-disable-next-line no-console
|
|
190
187
|
console.error("could not stop test result: no test with uuid ".concat(uuid, ") is found"));
|
|
191
188
|
return;
|
|
192
189
|
}
|
|
190
|
+
var testResult = wrapped.value;
|
|
193
191
|
this.notifier.beforeTestResultStop(testResult);
|
|
194
192
|
(_testResult$testCaseI = testResult.testCaseId) !== null && _testResult$testCaseI !== void 0 ? _testResult$testCaseI : testResult.testCaseId = getTestResultTestCaseId(testResult);
|
|
195
193
|
(_testResult$historyId = testResult.historyId) !== null && _testResult$historyId !== void 0 ? _testResult$historyId : testResult.historyId = getTestResultHistoryId(testResult);
|
|
196
194
|
var startStop = _classPrivateFieldGet(_calculateTimings, this).call(this, testResult.start, opts === null || opts === void 0 ? void 0 : opts.stop, opts === null || opts === void 0 ? void 0 : opts.duration);
|
|
197
195
|
testResult.start = startStop.start;
|
|
198
196
|
testResult.stop = startStop.stop;
|
|
197
|
+
var scopeUuids = wrapped.scopeUuids;
|
|
198
|
+
scopeUuids.forEach(scopeUuid => {
|
|
199
|
+
var scope = this.state.getScope(scopeUuid);
|
|
200
|
+
if (scope !== null && scope !== void 0 && scope.labels) {
|
|
201
|
+
testResult.labels = [...testResult.labels, ...scope.labels];
|
|
202
|
+
}
|
|
203
|
+
if (scope !== null && scope !== void 0 && scope.links) {
|
|
204
|
+
testResult.links = [...testResult.links, ...scope.links];
|
|
205
|
+
}
|
|
206
|
+
if (scope !== null && scope !== void 0 && scope.parameters) {
|
|
207
|
+
testResult.parameters = [...testResult.parameters, ...scope.parameters];
|
|
208
|
+
}
|
|
209
|
+
if (scope !== null && scope !== void 0 && scope.description) {
|
|
210
|
+
var _testResult$descripti;
|
|
211
|
+
testResult.description = (_testResult$descripti = testResult.description) !== null && _testResult$descripti !== void 0 ? _testResult$descripti : scope.description;
|
|
212
|
+
}
|
|
213
|
+
if (scope !== null && scope !== void 0 && scope.descriptionHtml) {
|
|
214
|
+
var _testResult$descripti2;
|
|
215
|
+
testResult.descriptionHtml = (_testResult$descripti2 = testResult.descriptionHtml) !== null && _testResult$descripti2 !== void 0 ? _testResult$descripti2 : scope.descriptionHtml;
|
|
216
|
+
}
|
|
217
|
+
});
|
|
199
218
|
this.notifier.afterTestResultStop(testResult);
|
|
200
219
|
});
|
|
201
220
|
_defineProperty(this, "writeTest", uuid => {
|
|
202
|
-
var testResult = this.state.
|
|
221
|
+
var testResult = this.state.getTestResult(uuid);
|
|
203
222
|
if (!testResult) {
|
|
204
223
|
// eslint-disable-next-line no-console
|
|
205
224
|
console.error("could not write test result: no test with uuid ".concat(uuid, " is found"));
|
|
@@ -346,22 +365,60 @@ export class ReporterRuntime {
|
|
|
346
365
|
});
|
|
347
366
|
_classPrivateFieldInitSpec(this, _handleMetadataMessage, (rootUuid, message) => {
|
|
348
367
|
// only display name could be set to fixture.
|
|
349
|
-
var fixtureResult = this.state.
|
|
368
|
+
var fixtureResult = this.state.getWrappedFixtureResult(rootUuid);
|
|
369
|
+
var {
|
|
370
|
+
links,
|
|
371
|
+
labels,
|
|
372
|
+
parameters,
|
|
373
|
+
displayName,
|
|
374
|
+
testCaseId,
|
|
375
|
+
historyId,
|
|
376
|
+
description,
|
|
377
|
+
descriptionHtml
|
|
378
|
+
} = message;
|
|
350
379
|
if (fixtureResult) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
result.name =
|
|
380
|
+
if (displayName) {
|
|
381
|
+
this.updateFixture(rootUuid, result => {
|
|
382
|
+
result.name = displayName;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
if (historyId) {
|
|
386
|
+
// eslint-disable-next-line no-console
|
|
387
|
+
console.error("historyId can't be changed within test fixtures");
|
|
388
|
+
}
|
|
389
|
+
if (testCaseId) {
|
|
390
|
+
// eslint-disable-next-line no-console
|
|
391
|
+
console.error("testCaseId can't be changed within test fixtures");
|
|
392
|
+
}
|
|
393
|
+
if (links || labels || parameters || description || descriptionHtml) {
|
|
394
|
+
// in some frameworks, afterEach methods can be executed before test stop event, while
|
|
395
|
+
// in others after. To remove the possible undetermined behaviour we only allow
|
|
396
|
+
// using runtime metadata API in before hooks.
|
|
397
|
+
if (fixtureResult.type === "after") {
|
|
398
|
+
// eslint-disable-next-line no-console
|
|
399
|
+
console.error("metadata messages isn't supported for after test fixtures");
|
|
400
|
+
return;
|
|
354
401
|
}
|
|
355
|
-
|
|
402
|
+
this.updateScope(fixtureResult.scopeUuid, scope => {
|
|
403
|
+
if (links) {
|
|
404
|
+
scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];
|
|
405
|
+
}
|
|
406
|
+
if (labels) {
|
|
407
|
+
scope.labels = [...scope.labels, ...labels];
|
|
408
|
+
}
|
|
409
|
+
if (parameters) {
|
|
410
|
+
scope.parameters = [...scope.parameters, ...parameters];
|
|
411
|
+
}
|
|
412
|
+
if (description) {
|
|
413
|
+
scope.description = description;
|
|
414
|
+
}
|
|
415
|
+
if (descriptionHtml) {
|
|
416
|
+
scope.descriptionHtml = descriptionHtml;
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}
|
|
356
420
|
return;
|
|
357
421
|
}
|
|
358
|
-
var {
|
|
359
|
-
links,
|
|
360
|
-
labels,
|
|
361
|
-
parameters,
|
|
362
|
-
displayName
|
|
363
|
-
} = message,
|
|
364
|
-
rest = _objectWithoutProperties(message, _excluded);
|
|
365
422
|
this.updateTest(rootUuid, result => {
|
|
366
423
|
if (links) {
|
|
367
424
|
result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];
|
|
@@ -375,7 +432,18 @@ export class ReporterRuntime {
|
|
|
375
432
|
if (displayName) {
|
|
376
433
|
result.name = displayName;
|
|
377
434
|
}
|
|
378
|
-
|
|
435
|
+
if (testCaseId) {
|
|
436
|
+
result.testCaseId = testCaseId;
|
|
437
|
+
}
|
|
438
|
+
if (historyId) {
|
|
439
|
+
result.historyId = historyId;
|
|
440
|
+
}
|
|
441
|
+
if (description) {
|
|
442
|
+
result.description = description;
|
|
443
|
+
}
|
|
444
|
+
if (descriptionHtml) {
|
|
445
|
+
result.descriptionHtml = descriptionHtml;
|
|
446
|
+
}
|
|
379
447
|
});
|
|
380
448
|
});
|
|
381
449
|
_classPrivateFieldInitSpec(this, _handleStepMetadataMessage, (rootUuid, message) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","DefaultStepStack","constructor","_defineProperty","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","length","set","push","removeStep","newValue","filter","value","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","uuid","state","setScope","updateFunc","scope","getScope","console","error","concat","_classPrivateFieldGet","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","_objectSpread","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","FINISHED","result","scopeUuids","arguments","undefined","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","beforeTestResultStop","testCaseId","historyId","afterTestResultStop","testResults","labels","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","_classPrivateFieldInitSpec","updateFixture","displayName","parameters","rest","_objectWithoutProperties","_excluded","updateTest","linkConfig","Object","assign","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type { FixtureType, FixtureWrapper, LinkConfig, ReporterRuntimeConfig, TestScope, Writer } from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n\n constructor({ writer, listeners = [], environmentInfo, categories, links }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultStop(testResult);\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.testResults.get(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getFixtureResult(rootUuid);\n if (fixtureResult) {\n this.updateFixture(rootUuid, (result) => {\n if (message.displayName) {\n result.name = message.displayName;\n }\n });\n return;\n }\n\n const { links, labels, parameters, displayName, ...rest } = message;\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n Object.assign(result, rest);\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (start?: number, stop?: number, duration?: number): { start?: number; stop?: number } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return result;\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAIEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAE5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,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ACtC,IAAI,CAAC2G,UAAU,GAAGzG,MAAK;EACzB;AAgeF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReporterRuntime.js","names":["extname","Stage","LifecycleState","Notifier","createFixtureResult","createStepResult","createTestResult","hasSkipLabel","deepClone","formatLinks","getTestResultHistoryId","getTestResultTestCaseId","randomUuid","buildAttachmentFileName","resolveWriter","DefaultStepStack","constructor","_defineProperty","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","get","delete","forEach","stepUuid","length","set","push","removeStep","newValue","filter","value","_handleMetadataMessage","WeakMap","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_findParent","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this","writer","listeners","environmentInfo","categories","links","uuid","state","setScope","updateFunc","scope","getScope","console","error","concat","_classPrivateFieldGet","call","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","_objectSpread","start","Date","now","fixtures","fixture","getFixtureResult","opts","startStop","stop","duration","stage","FINISHED","result","scopeUuids","arguments","undefined","testResult","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","testCaseId","historyId","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","afterTestResultStop","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","currentStep","parentStepUuid","parent","JSON","stringify","stepResult","steps","setStepResult","addStep","step","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","isPath","fileExtension","attachmentFileName","contentType","writeAttachmentFromPath","writeAttachment","attachment","name","source","wrapInStep","timestamp","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","traceRegex","writeCategoriesDefinitions","messages","message","data","_classPrivateFieldInitSpec","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","updateTest","updateStep","startStep","status","statusDetails","stopStep","Buffer","from","content","encoding","path","root","getExecutionItem","_ref2","writtenFixtures","Set","has","deleteFixtureResult","add","befores","afters","writeGroup","children","normalisedDuration","Math","max"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\ninterface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\nclass DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n\n constructor({ writer, listeners = [], environmentInfo, categories, links }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n const scopeUuids = wrapped.scopeUuids;\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const fileExtension = options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined);\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n const attachment: Attachment = {\n name: attachmentName,\n source: attachmentFileName,\n type: options.contentType,\n };\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (start?: number, stop?: number, duration?: number): { start?: number; stop?: number } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return result;\n };\n}\n"],"mappings":";;;;;;;;;AAAA;AACA,SAASA,OAAO,QAAQ,MAAM;AAC9B,SAIEC,KAAK,QAGA,gBAAgB;AAYvB,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,gBAAgB,QAAQ,cAAc;AACtF,SAASC,YAAY,QAAQ,eAAe;AAS5C,SAASC,SAAS,EAAEC,WAAW,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAChH,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,aAAa,QAAQ,oBAAoB;AAclD,MAAMC,gBAAgB,CAAsB;EAAAC,YAAA;IAAAC,eAAA,sBACG,IAAIC,GAAG,CAAC,CAAC;IAAAD,eAA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SystemWriter } from "./writer/FileSystemWriter.js";
|
|
9
9
|
export { MessageWriter } from "./writer/MessageWriter.js";
|
|
10
10
|
export { MessageReader } from "./writer/MessageReader.js";
|
|
11
|
-
export { getEnvironmentLabels, getHostLabel, getThreadLabel } from "./utils/labels.js";
|
|
11
|
+
export { getEnvironmentLabels, getHostLabel, getThreadLabel, getPackageLabel, getLanguageLabel, getFrameworkLabel } from "./utils/labels.js";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE","LifecycleState","ReporterRuntime","InMemoryWriter","FileSystemWriter","MessageWriter","MessageReader","getEnvironmentLabels","getHostLabel","getThreadLabel"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { ReporterRuntime } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE","LifecycleState","ReporterRuntime","InMemoryWriter","FileSystemWriter","MessageWriter","MessageReader","getEnvironmentLabels","getHostLabel","getThreadLabel","getPackageLabel","getLanguageLabel","getFrameworkLabel"],"sources":["../../../../src/sdk/reporter/index.ts"],"sourcesContent":["export type * from \"./types.js\";\nexport { ALLURE_METADATA_CONTENT_TYPE, ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE } from \"./types.js\";\nexport * from \"./utils.js\";\nexport * from \"./testplan.js\";\nexport * from \"./factory.js\";\nexport { LifecycleState } from \"./LifecycleState.js\";\nexport { ReporterRuntime } from \"./ReporterRuntime.js\";\nexport { InMemoryWriter } from \"./writer/InMemoryWriter.js\";\nexport { FileSystemWriter } from \"./writer/FileSystemWriter.js\";\nexport { MessageWriter } from \"./writer/MessageWriter.js\";\nexport { MessageReader } from \"./writer/MessageReader.js\";\nexport {\n getEnvironmentLabels,\n getHostLabel,\n getThreadLabel,\n getPackageLabel,\n getLanguageLabel,\n getFrameworkLabel,\n} from \"./utils/labels.js\";\n"],"mappings":"AACA,SAASA,4BAA4B,EAAEC,mCAAmC,QAAQ,YAAY;AAC9F,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SACEC,oBAAoB,EACpBC,YAAY,EACZC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","names":["ALLURE_METADATA_CONTENT_TYPE","ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE"],"sources":["../../../../src/sdk/reporter/types.ts"],"sourcesContent":["import type {\n FixtureResult,\n Label,\n Link,\n LinkType,\n Parameter,\n StepResult,\n TestResult,\n TestResultContainer,\n} from \"../../model.js\";\nimport type { Category, EnvironmentInfo } from \"../types.js\";\n\nexport const ALLURE_METADATA_CONTENT_TYPE = \"application/vnd.allure.metadata+json\";\nexport const ALLURE_RUNTIME_MESSAGE_CONTENT_TYPE = \"application/vnd.allure.message+json\";\n\nexport interface LifecycleListener {\n beforeTestResultStart?: (result: TestResult) => void;\n\n afterTestResultStart?: (result: TestResult) => void;\n\n beforeTestResultStop?: (result: TestResult) => void;\n\n afterTestResultStop?: (result: TestResult) => void;\n\n beforeTestResultUpdate?: (result: TestResult) => void;\n\n afterTestResultUpdate?: (result: TestResult) => void;\n\n beforeTestResultWrite?: (result: TestResult) => void;\n\n afterTestResultWrite?: (result: TestResult) => void;\n\n beforeStepStop?: (result: StepResult) => void;\n\n afterStepStop?: (result: StepResult) => void;\n}\n\nexport type LinkTemplate = string | ((url: string) => string);\n\nexport type LinkTypeOptions = {\n urlTemplate: LinkTemplate;\n nameTemplate?: LinkTemplate;\n};\n\nexport type LinkConfig<TOpts extends LinkTypeOptions = LinkTypeOptions> = Partial<Record<LinkType, TOpts>> &\n Record<string, TOpts>;\n\nexport type WriterDescriptor = [cls: string, ...args: readonly unknown[]] | string;\n\nexport interface ReporterConfig {\n readonly resultsDir?: string;\n readonly links?: LinkConfig;\n readonly listeners?: LifecycleListener[];\n readonly environmentInfo?: EnvironmentInfo;\n readonly categories?: Category[];\n}\n\nexport interface ReporterRuntimeConfig extends Omit<ReporterConfig, \"resultsDir\"> {\n readonly writer: Writer | WriterDescriptor;\n}\n\nexport interface Writer {\n writeResult(result: TestResult): void;\n\n writeGroup(result: TestResultContainer): void;\n\n writeAttachment(distFileName: string, content: Buffer): void;\n\n writeAttachmentFromPath(distFileName: string, from: string): void;\n\n writeEnvironmentInfo(info: EnvironmentInfo): void;\n\n writeCategoriesDefinitions(categories: Category[]): void;\n}\n\nexport type TestScope = {\n uuid: string;\n tests: string[];\n fixtures: FixtureResultWrapper[];\n labels: Label[];\n links: Link[];\n parameters: Parameter[];\n description?: string;\n descriptionHtml?: string;\n};\n\nexport type FixtureType = \"before\" | \"after\";\n\nexport type FixtureResultWrapper = {\n uuid: string;\n value: FixtureResult;\n type: FixtureType;\n scopeUuid: string;\n};\n\nexport type TestResultWrapper = {\n value: TestResult;\n scopeUuids: string[];\n};\n"],"mappings":"AAYA,OAAO,IAAMA,4BAA4B,GAAG,sCAAsC;AAClF,OAAO,IAAMC,mCAAmC,GAAG,qCAAqC","ignoreList":[]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { hostname } from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import { env, pid } from "node:process";
|
|
4
|
+
import { isMainThread, threadId } from "node:worker_threads";
|
|
3
5
|
import { LabelName } from "../../../model.js";
|
|
6
|
+
import { getRelativePath } from "../utils.js";
|
|
4
7
|
var ENV_LABEL_PREFIX = "ALLURE_LABEL_";
|
|
5
8
|
export var getEnvironmentLabels = () => {
|
|
6
9
|
var result = [];
|
|
@@ -28,11 +31,23 @@ export var getHostLabel = () => {
|
|
|
28
31
|
value: hostValue
|
|
29
32
|
};
|
|
30
33
|
};
|
|
31
|
-
export var getThreadLabel =
|
|
34
|
+
export var getThreadLabel = userProvidedThreadId => {
|
|
32
35
|
var _ref, _env$ALLURE_THREAD_NA;
|
|
33
36
|
return {
|
|
34
37
|
name: LabelName.THREAD,
|
|
35
|
-
value: (_ref = (_env$ALLURE_THREAD_NA = env.ALLURE_THREAD_NAME) !== null && _env$ALLURE_THREAD_NA !== void 0 ? _env$ALLURE_THREAD_NA :
|
|
38
|
+
value: (_ref = (_env$ALLURE_THREAD_NA = env.ALLURE_THREAD_NAME) !== null && _env$ALLURE_THREAD_NA !== void 0 ? _env$ALLURE_THREAD_NA : userProvidedThreadId) !== null && _ref !== void 0 ? _ref : "pid-".concat(pid.toString(), "-worker-").concat(isMainThread ? "main" : threadId)
|
|
36
39
|
};
|
|
37
40
|
};
|
|
41
|
+
export var getPackageLabel = filepath => ({
|
|
42
|
+
name: LabelName.PACKAGE,
|
|
43
|
+
value: getRelativePath(filepath).split(path.sep).filter(v => v).join(".")
|
|
44
|
+
});
|
|
45
|
+
export var getLanguageLabel = () => ({
|
|
46
|
+
name: LabelName.LANGUAGE,
|
|
47
|
+
value: "javascript"
|
|
48
|
+
});
|
|
49
|
+
export var getFrameworkLabel = framework => ({
|
|
50
|
+
name: LabelName.FRAMEWORK,
|
|
51
|
+
value: framework
|
|
52
|
+
});
|
|
38
53
|
//# sourceMappingURL=labels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","names":["hostname","env","pid","LabelName","ENV_LABEL_PREFIX","getEnvironmentLabels","result","envKey","startsWith","name","substring","length","trim","push","value","process","hostValue","getHostLabel","_env$ALLURE_HOST_NAME","ALLURE_HOST_NAME","HOST","getThreadLabel","
|
|
1
|
+
{"version":3,"file":"labels.js","names":["hostname","path","env","pid","isMainThread","threadId","LabelName","getRelativePath","ENV_LABEL_PREFIX","getEnvironmentLabels","result","envKey","startsWith","name","substring","length","trim","push","value","process","hostValue","getHostLabel","_env$ALLURE_HOST_NAME","ALLURE_HOST_NAME","HOST","getThreadLabel","userProvidedThreadId","_ref","_env$ALLURE_THREAD_NA","THREAD","ALLURE_THREAD_NAME","concat","toString","getPackageLabel","filepath","PACKAGE","split","sep","filter","v","join","getLanguageLabel","LANGUAGE","getFrameworkLabel","framework","FRAMEWORK"],"sources":["../../../../../src/sdk/reporter/utils/labels.ts"],"sourcesContent":["import { hostname } from \"node:os\";\nimport path from \"node:path\";\nimport { env, pid } from \"node:process\";\nimport { isMainThread, threadId } from \"node:worker_threads\";\nimport type { Label } from \"../../../model.js\";\nimport { LabelName } from \"../../../model.js\";\nimport { getRelativePath } from \"../utils.js\";\n\nconst ENV_LABEL_PREFIX = \"ALLURE_LABEL_\";\n\nexport const getEnvironmentLabels = (): Label[] => {\n const result: Label[] = [];\n for (const envKey in env) {\n if (envKey.startsWith(ENV_LABEL_PREFIX)) {\n const name = envKey.substring(ENV_LABEL_PREFIX.length).trim();\n if (name !== \"\") {\n result.push({ name, value: process.env[envKey]! });\n }\n }\n }\n return result;\n};\n\nlet hostValue: string;\n\nexport const getHostLabel = (): Label => {\n if (!hostValue) {\n hostValue = env.ALLURE_HOST_NAME ?? hostname();\n }\n\n return {\n name: LabelName.HOST,\n value: hostValue,\n };\n};\n\nexport const getThreadLabel = (userProvidedThreadId?: string): Label => {\n return {\n name: LabelName.THREAD,\n value:\n env.ALLURE_THREAD_NAME ??\n userProvidedThreadId ??\n `pid-${pid.toString()}-worker-${isMainThread ? \"main\" : threadId}`,\n };\n};\n\nexport const getPackageLabel = (filepath: string): Label => ({\n name: LabelName.PACKAGE,\n value: getRelativePath(filepath)\n .split(path.sep)\n .filter((v) => v)\n .join(\".\"),\n});\n\nexport const getLanguageLabel = (): Label => ({\n name: LabelName.LANGUAGE,\n value: \"javascript\",\n});\n\nexport const getFrameworkLabel = (framework: string): Label => ({\n name: LabelName.FRAMEWORK,\n value: framework,\n});\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,SAAS;AAClC,OAAOC,IAAI,MAAM,WAAW;AAC5B,SAASC,GAAG,EAAEC,GAAG,QAAQ,cAAc;AACvC,SAASC,YAAY,EAAEC,QAAQ,QAAQ,qBAAqB;AAE5D,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,eAAe,QAAQ,aAAa;AAE7C,IAAMC,gBAAgB,GAAG,eAAe;AAExC,OAAO,IAAMC,oBAAoB,GAAGA,CAAA,KAAe;EACjD,IAAMC,MAAe,GAAG,EAAE;EAC1B,KAAK,IAAMC,MAAM,IAAIT,GAAG,EAAE;IACxB,IAAIS,MAAM,CAACC,UAAU,CAACJ,gBAAgB,CAAC,EAAE;MACvC,IAAMK,IAAI,GAAGF,MAAM,CAACG,SAAS,CAACN,gBAAgB,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,CAAC;MAC7D,IAAIH,IAAI,KAAK,EAAE,EAAE;QACfH,MAAM,CAACO,IAAI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