allure-cypress 3.14.0 → 3.16.0
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 +18 -4
- package/dist/cjs/browser/commandLog.js +44 -57
- package/dist/cjs/browser/commandLog.js.map +1 -1
- package/dist/cjs/browser/events/cypress.js +20 -9
- package/dist/cjs/browser/events/cypress.js.map +1 -1
- package/dist/cjs/browser/lifecycle.js +4 -1
- package/dist/cjs/browser/lifecycle.js.map +1 -1
- package/dist/cjs/browser/patching.js +16 -9
- package/dist/cjs/browser/patching.js.map +1 -1
- package/dist/cjs/browser/runtime.js +86 -10
- package/dist/cjs/browser/runtime.js.map +1 -1
- package/dist/cjs/browser/serialize.js +19 -23
- package/dist/cjs/browser/serialize.js.map +1 -1
- package/dist/cjs/browser/steps.js +15 -7
- package/dist/cjs/browser/steps.js.map +1 -1
- package/dist/cjs/browser/testplan.js +13 -11
- package/dist/cjs/browser/testplan.js.map +1 -1
- package/dist/cjs/browser/utils.js +9 -9
- package/dist/cjs/browser/utils.js.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/reporter.js +123 -123
- package/dist/cjs/reporter.js.map +1 -1
- package/dist/esm/browser/commandLog.js +44 -57
- package/dist/esm/browser/commandLog.js.map +1 -1
- package/dist/esm/browser/events/cypress.js +20 -9
- package/dist/esm/browser/events/cypress.js.map +1 -1
- package/dist/esm/browser/lifecycle.js +3 -1
- package/dist/esm/browser/lifecycle.js.map +1 -1
- package/dist/esm/browser/patching.js +16 -9
- package/dist/esm/browser/patching.js.map +1 -1
- package/dist/esm/browser/runtime.js +85 -10
- package/dist/esm/browser/runtime.js.map +1 -1
- package/dist/esm/browser/serialize.js +19 -23
- package/dist/esm/browser/serialize.js.map +1 -1
- package/dist/esm/browser/steps.js +14 -7
- package/dist/esm/browser/steps.js.map +1 -1
- package/dist/esm/browser/testplan.js +13 -11
- package/dist/esm/browser/testplan.js.map +1 -1
- package/dist/esm/browser/utils.js +8 -9
- package/dist/esm/browser/utils.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/reporter.js +124 -124
- package/dist/esm/reporter.js.map +1 -1
- package/dist/types/browser/lifecycle.d.ts +1 -1
- package/dist/types/browser/runtime.d.ts +6 -2
- package/dist/types/reporter.d.ts +5 -0
- package/package.json +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patching.js","names":["_sdk","require","_lifecycle","enableScopeLevelAfterHookReporting","suiteDepthCounter","createSuiteDepthCounterState","patchDescribe","patchAfter","exports","suiteDepth","getSuiteDepth","incrementSuiteDepth","decrementSuiteDepth","_ref","patchDescribeFn","target","title","configOrFn","fn","forwardDescribeCall","originalDescribeFn","globalThis","describe","patchedDescribe","only","skip","_ref2","originalAfter","after","patchedAfter","nameOrFn","wrapRootAfterFn","_len","arguments","length","args","Array","_key","wrappedFn","wrapAfterFnWithCallback","wrapAfterFnWithoutArgs","Object","defineProperty","value","name","done","wrappedDone","hookError","_completeSpecOnAfterH","completeSpecOnAfterHookFailure","then","_completeSpecIfNoAfte","completeSpecIfNoAfterHookLeft","allureError","bind","result","syncError","e","throwAfterSpecCompletion","isPromise","
|
|
1
|
+
{"version":3,"file":"patching.js","names":["_sdk","require","_lifecycle","enableScopeLevelAfterHookReporting","suiteDepthCounter","createSuiteDepthCounterState","patchDescribe","patchAfter","exports","suiteDepth","getSuiteDepth","incrementSuiteDepth","decrementSuiteDepth","_ref","patchDescribeFn","target","title","configOrFn","fn","forwardDescribeCall","originalDescribeFn","globalThis","describe","patchedDescribe","only","skip","_ref2","originalAfter","after","patchedAfter","nameOrFn","wrapRootAfterFn","_len","arguments","length","args","Array","_key","wrappedFn","wrapAfterFnWithCallback","wrapAfterFnWithoutArgs","Object","defineProperty","value","name","done","wrappedDone","hookError","_completeSpecOnAfterH","completeSpecOnAfterHookFailure","then","_completeSpecIfNoAfte","completeSpecIfNoAfterHookLeft","allureError","bind","result","syncError","e","throwAfterSpecCompletion","isPromise","outcome","ok","error","cy","settled"],"sources":["../../../src/browser/patching.ts"],"sourcesContent":["import { isPromise } from \"allure-js-commons/sdk\";\n\nimport type { CypressSuiteFunction, DirectHookImplementation, HookImplementation } from \"../types.js\";\nimport {\n completeSpecIfNoAfterHookLeft,\n completeSpecOnAfterHookFailure,\n throwAfterSpecCompletion,\n} from \"./lifecycle.js\";\n\ntype SuiteDepthCounter = {\n getSuiteDepth: () => number;\n incrementSuiteDepth: () => void;\n decrementSuiteDepth: () => void;\n};\n\n/**\n * Patches the `after` function, to inject reporting of spec-level\n * `after` hooks defined by the user.\n */\nexport const enableScopeLevelAfterHookReporting = () => {\n const suiteDepthCounter = createSuiteDepthCounterState();\n patchDescribe(suiteDepthCounter);\n patchAfter(suiteDepthCounter);\n};\n\nconst createSuiteDepthCounterState = (): SuiteDepthCounter => {\n let suiteDepth = 0;\n return {\n getSuiteDepth: () => suiteDepth,\n incrementSuiteDepth: () => {\n suiteDepth++;\n },\n decrementSuiteDepth: () => {\n suiteDepth--;\n },\n };\n};\n\nconst patchDescribe = ({ incrementSuiteDepth, decrementSuiteDepth }: SuiteDepthCounter) => {\n const patchDescribeFn =\n (target: CypressSuiteFunction): CypressSuiteFunction =>\n (title, configOrFn, fn) => {\n incrementSuiteDepth();\n try {\n return forwardDescribeCall(target, title, configOrFn, fn);\n } finally {\n decrementSuiteDepth();\n }\n };\n const originalDescribeFn: Mocha.SuiteFunction = globalThis.describe;\n const patchedDescribe = patchDescribeFn(originalDescribeFn) as Mocha.SuiteFunction;\n patchedDescribe.only = patchDescribeFn(\n originalDescribeFn.only as CypressSuiteFunction,\n ) as Mocha.ExclusiveSuiteFunction;\n patchedDescribe.skip = patchDescribeFn(originalDescribeFn.skip as CypressSuiteFunction) as Mocha.PendingSuiteFunction;\n globalThis.describe = patchedDescribe;\n};\n\nconst patchAfter = ({ getSuiteDepth }: SuiteDepthCounter) => {\n const originalAfter = globalThis.after;\n const patchedAfter = (nameOrFn: string | HookImplementation, fn?: HookImplementation): void => {\n return typeof nameOrFn === \"string\"\n ? originalAfter(nameOrFn, wrapRootAfterFn(getSuiteDepth, fn))\n : originalAfter(wrapRootAfterFn(getSuiteDepth, nameOrFn)!);\n };\n globalThis.after = patchedAfter;\n};\n\nconst forwardDescribeCall = (target: CypressSuiteFunction, ...args: Parameters<CypressSuiteFunction>) => {\n const [title, configOrFn, fn] = args;\n if (typeof fn === \"undefined\" && typeof configOrFn === \"undefined\") {\n return target(title);\n } else if (typeof configOrFn === \"function\") {\n return target(title, configOrFn);\n } else {\n return target(title, configOrFn, fn);\n }\n};\n\nconst wrapRootAfterFn = (getSuiteDepth: () => number, fn?: HookImplementation): HookImplementation | undefined => {\n if (getSuiteDepth() === 0 && fn) {\n const wrappedFn = fn.length ? wrapAfterFnWithCallback(fn) : wrapAfterFnWithoutArgs(fn as DirectHookImplementation);\n Object.defineProperty(wrappedFn, \"name\", { value: fn.name });\n return wrappedFn;\n }\n return fn;\n};\n\nconst wrapAfterFnWithCallback = (fn: Mocha.Func): Mocha.Func => {\n return function (this: Mocha.Context, done: Mocha.Done) {\n const wrappedDone = (hookError?: Error) => {\n if (hookError) {\n if (!completeSpecOnAfterHookFailure(this, hookError)?.then(() => done(hookError))) {\n done(hookError);\n }\n return;\n }\n\n try {\n if (completeSpecIfNoAfterHookLeft(this)?.then(() => done())) {\n return;\n }\n } catch (allureError) {\n done(allureError);\n return;\n }\n\n done();\n };\n return fn.bind(this)(wrappedDone);\n };\n};\n\nconst wrapAfterFnWithoutArgs = (fn: DirectHookImplementation) => {\n return function (this: Mocha.Context) {\n let result;\n let syncError: any;\n\n try {\n result = fn.bind(this)();\n } catch (e) {\n syncError = e;\n }\n\n if (syncError) {\n throwAfterSpecCompletion(this, syncError);\n } else if (isPromise(result)) {\n // Await the hook without queuing Cypress commands inside its promise callbacks.\n const outcome = result.then(\n () => ({ ok: true as const }),\n (error: unknown) => ({ ok: false as const, error }),\n );\n return cy\n .then(() => outcome)\n .then((settled) => {\n return settled.ok ? completeSpecIfNoAfterHookLeft(this) : throwAfterSpecCompletion(this, settled.error);\n });\n } else {\n completeSpecIfNoAfterHookLeft(this);\n return result;\n }\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAYA;AACA;AACA;AACA;AACO,IAAME,kCAAkC,GAAGA,CAAA,KAAM;EACtD,IAAMC,iBAAiB,GAAGC,4BAA4B,CAAC,CAAC;EACxDC,aAAa,CAACF,iBAAiB,CAAC;EAChCG,UAAU,CAACH,iBAAiB,CAAC;AAC/B,CAAC;AAACI,OAAA,CAAAL,kCAAA,GAAAA,kCAAA;AAEF,IAAME,4BAA4B,GAAGA,CAAA,KAAyB;EAC5D,IAAII,UAAU,GAAG,CAAC;EAClB,OAAO;IACLC,aAAa,EAAEA,CAAA,KAAMD,UAAU;IAC/BE,mBAAmB,EAAEA,CAAA,KAAM;MACzBF,UAAU,EAAE;IACd,CAAC;IACDG,mBAAmB,EAAEA,CAAA,KAAM;MACzBH,UAAU,EAAE;IACd;EACF,CAAC;AACH,CAAC;AAED,IAAMH,aAAa,GAAGO,IAAA,IAAqE;EAAA,IAAlEF,mBAAmB,GAAAE,IAAA,CAAnBF,mBAAmB;IAAEC,mBAAmB,GAAAC,IAAA,CAAnBD,mBAAmB;EAC/D,IAAME,eAAe,GAClBC,MAA4B,IAC7B,CAACC,KAAK,EAAEC,UAAU,EAAEC,EAAE,KAAK;IACzBP,mBAAmB,CAAC,CAAC;IACrB,IAAI;MACF,OAAOQ,mBAAmB,CAACJ,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,EAAE,CAAC;IAC3D,CAAC,SAAS;MACRN,mBAAmB,CAAC,CAAC;IACvB;EACF,CAAC;EACH,IAAMQ,kBAAuC,GAAGC,UAAU,CAACC,QAAQ;EACnE,IAAMC,eAAe,GAAGT,eAAe,CAACM,kBAAkB,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O3B,EAAE,CAACoC,IAAI,CAAC,IAAI,CAAC,CAACR,WAAW,CAAC;EACnC,CAAC;AACH,CAAC;AAED,IAAMN,sBAAsB,GAAItB,EAA4B,IAAK;EAC/D,OAAO,YAA+B;IACpC,IAAIqC,MAAM;IACV,IAAIC,SAAc;IAElB,IAAI;MACFD,MAAM,GAAGrC,EAAE,CAACoC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1B,CAAC,CAAC,OAAOG,CAAC,EAAE;MACVD,SAAS,GAAGC,CAAC;IACf;IAEA,IAAID,SAAS,EAAE;MACb,IAAAE,mCAAwB,EAAC,IAAI,EAAEF,SAAS,CAAC;IAC3C,CAAC,MAAM,IAAI,IAAAG,cAAS,EAACJ,MAAM,CAAC,EAAE;MAC5B;MACA,IAAMK,OAAO,GAAGL,MAAM,CAACL,IAAI,CACzB,OAAO;QAAEW,EAAE,EAAE;MAAc,CAAC,CAAC,EAC5BC,KAAc,KAAM;QAAED,EAAE,EAAE,KAAc;QAAEC;MAAM,CAAC,CACpD,CAAC;MACD,OAAOC,EAAE,CACNb,IAAI,CAAC,MAAMU,OAAO,CAAC,CACnBV,IAAI,CAAEc,OAAO,IAAK;QACjB,OAAOA,OAAO,CAACH,EAAE,GAAG,IAAAT,wCAA6B,EAAC,IAAI,CAAC,GAAG,IAAAM,mCAAwB,EAAC,IAAI,EAAEM,OAAO,CAACF,KAAK,CAAC;MACzG,CAAC,CAAC;IACN,CAAC,MAAM;MACL,IAAAV,wCAA6B,EAAC,IAAI,CAAC;MACnC,OAAOG,MAAM;IACf;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,17 @@ exports.initTestRuntime = exports.getTestRuntime = void 0;
|
|
|
7
7
|
var _allureJsCommons = require("allure-js-commons");
|
|
8
8
|
var _sdk = require("allure-js-commons/sdk");
|
|
9
9
|
var _runtime = require("allure-js-commons/sdk/runtime");
|
|
10
|
+
var _serialize = _interopRequireDefault(require("./serialize.js"));
|
|
10
11
|
var _state = require("./state.js");
|
|
11
12
|
var _steps = require("./steps.js");
|
|
12
13
|
var _utils = require("./utils.js");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
21
|
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; }
|
|
14
22
|
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; }
|
|
15
23
|
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; }
|
|
@@ -81,6 +89,38 @@ class AllureCypressTestRuntime {
|
|
|
81
89
|
}
|
|
82
90
|
});
|
|
83
91
|
}
|
|
92
|
+
precondition(markdown) {
|
|
93
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
94
|
+
type: "metadata",
|
|
95
|
+
data: {
|
|
96
|
+
precondition: markdown
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
preconditionHtml(html) {
|
|
101
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
102
|
+
type: "metadata",
|
|
103
|
+
data: {
|
|
104
|
+
preconditionHtml: html
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
expectedResult(markdown) {
|
|
109
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
110
|
+
type: "metadata",
|
|
111
|
+
data: {
|
|
112
|
+
expectedResult: markdown
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
expectedResultHtml(html) {
|
|
117
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
118
|
+
type: "metadata",
|
|
119
|
+
data: {
|
|
120
|
+
expectedResultHtml: html
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
84
124
|
displayName(name) {
|
|
85
125
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
86
126
|
type: "metadata",
|
|
@@ -106,7 +146,10 @@ class AllureCypressTestRuntime {
|
|
|
106
146
|
});
|
|
107
147
|
}
|
|
108
148
|
attachment(name, content, options) {
|
|
109
|
-
var
|
|
149
|
+
var _assertClassBrand$cal = _assertClassBrand(_AllureCypressTestRuntime_brand, this, _buildAttachmentContent).call(this, content),
|
|
150
|
+
_assertClassBrand$cal2 = _slicedToArray(_assertClassBrand$cal, 2),
|
|
151
|
+
attachmentContent = _assertClassBrand$cal2[0],
|
|
152
|
+
actualEncoding = _assertClassBrand$cal2[1];
|
|
110
153
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
111
154
|
type: "attachment_content",
|
|
112
155
|
data: {
|
|
@@ -130,7 +173,10 @@ class AllureCypressTestRuntime {
|
|
|
130
173
|
});
|
|
131
174
|
}
|
|
132
175
|
globalAttachment(name, content, options) {
|
|
133
|
-
var
|
|
176
|
+
var _assertClassBrand$cal3 = _assertClassBrand(_AllureCypressTestRuntime_brand, this, _buildAttachmentContent).call(this, content),
|
|
177
|
+
_assertClassBrand$cal4 = _slicedToArray(_assertClassBrand$cal3, 2),
|
|
178
|
+
attachmentContent = _assertClassBrand$cal4[0],
|
|
179
|
+
actualEncoding = _assertClassBrand$cal4[1];
|
|
134
180
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
135
181
|
type: "global_attachment_content",
|
|
136
182
|
data: {
|
|
@@ -159,12 +205,12 @@ class AllureCypressTestRuntime {
|
|
|
159
205
|
data: (0, _sdk.getGlobalErrorDetails)(...arguments)
|
|
160
206
|
});
|
|
161
207
|
}
|
|
162
|
-
|
|
208
|
+
metrics() {
|
|
163
209
|
for (var _len3 = arguments.length, results = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
164
210
|
results[_key3] = arguments[_key3];
|
|
165
211
|
}
|
|
166
212
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
167
|
-
type: "
|
|
213
|
+
type: "metric_result",
|
|
168
214
|
data: results
|
|
169
215
|
});
|
|
170
216
|
}
|
|
@@ -173,7 +219,7 @@ class AllureCypressTestRuntime {
|
|
|
173
219
|
var error = arguments.length > 2 ? arguments[2] : undefined;
|
|
174
220
|
if (_assertClassBrand(_AllureCypressTestRuntime_brand, this, _isInOriginContext).call(this)) {
|
|
175
221
|
(0, _steps.startAllureApiStep)(name);
|
|
176
|
-
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error) : undefined);
|
|
222
|
+
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default) : undefined);
|
|
177
223
|
return Cypress.Promise.resolve();
|
|
178
224
|
}
|
|
179
225
|
return cy.wrap(_steps.ALLURE_STEP_CMD_SUBJECT, {
|
|
@@ -182,7 +228,7 @@ class AllureCypressTestRuntime {
|
|
|
182
228
|
(0, _steps.startAllureApiStep)(name);
|
|
183
229
|
return Cypress.Promise.resolve();
|
|
184
230
|
}).then(() => {
|
|
185
|
-
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error) : undefined);
|
|
231
|
+
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default) : undefined);
|
|
186
232
|
return Cypress.Promise.resolve();
|
|
187
233
|
});
|
|
188
234
|
}
|
|
@@ -352,6 +398,30 @@ function _createSyncRuntime() {
|
|
|
352
398
|
descriptionHtml: html
|
|
353
399
|
}
|
|
354
400
|
}),
|
|
401
|
+
precondition: markdown => (0, _state.enqueueRuntimeMessage)({
|
|
402
|
+
type: "metadata",
|
|
403
|
+
data: {
|
|
404
|
+
precondition: markdown
|
|
405
|
+
}
|
|
406
|
+
}),
|
|
407
|
+
preconditionHtml: html => (0, _state.enqueueRuntimeMessage)({
|
|
408
|
+
type: "metadata",
|
|
409
|
+
data: {
|
|
410
|
+
preconditionHtml: html
|
|
411
|
+
}
|
|
412
|
+
}),
|
|
413
|
+
expectedResult: markdown => (0, _state.enqueueRuntimeMessage)({
|
|
414
|
+
type: "metadata",
|
|
415
|
+
data: {
|
|
416
|
+
expectedResult: markdown
|
|
417
|
+
}
|
|
418
|
+
}),
|
|
419
|
+
expectedResultHtml: html => (0, _state.enqueueRuntimeMessage)({
|
|
420
|
+
type: "metadata",
|
|
421
|
+
data: {
|
|
422
|
+
expectedResultHtml: html
|
|
423
|
+
}
|
|
424
|
+
}),
|
|
355
425
|
displayName: name => (0, _state.enqueueRuntimeMessage)({
|
|
356
426
|
type: "metadata",
|
|
357
427
|
data: {
|
|
@@ -371,7 +441,10 @@ function _createSyncRuntime() {
|
|
|
371
441
|
}
|
|
372
442
|
}),
|
|
373
443
|
attachment: (name, content, options) => {
|
|
374
|
-
var
|
|
444
|
+
var _assertClassBrand$cal5 = _assertClassBrand(_AllureCypressTestRuntime_brand, this, _buildAttachmentContent).call(this, content),
|
|
445
|
+
_assertClassBrand$cal6 = _slicedToArray(_assertClassBrand$cal5, 2),
|
|
446
|
+
attachmentContent = _assertClassBrand$cal6[0],
|
|
447
|
+
actualEncoding = _assertClassBrand$cal6[1];
|
|
375
448
|
(0, _state.enqueueRuntimeMessage)({
|
|
376
449
|
type: "attachment_content",
|
|
377
450
|
data: {
|
|
@@ -393,7 +466,10 @@ function _createSyncRuntime() {
|
|
|
393
466
|
}
|
|
394
467
|
}),
|
|
395
468
|
globalAttachment: (name, content, options) => {
|
|
396
|
-
var
|
|
469
|
+
var _assertClassBrand$cal7 = _assertClassBrand(_AllureCypressTestRuntime_brand, this, _buildAttachmentContent).call(this, content),
|
|
470
|
+
_assertClassBrand$cal8 = _slicedToArray(_assertClassBrand$cal7, 2),
|
|
471
|
+
attachmentContent = _assertClassBrand$cal8[0],
|
|
472
|
+
actualEncoding = _assertClassBrand$cal8[1];
|
|
397
473
|
(0, _state.enqueueRuntimeMessage)({
|
|
398
474
|
type: "global_attachment_content",
|
|
399
475
|
data: {
|
|
@@ -424,7 +500,7 @@ function _createSyncRuntime() {
|
|
|
424
500
|
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _allureJsCommons.Status.PASSED;
|
|
425
501
|
var error = arguments.length > 2 ? arguments[2] : undefined;
|
|
426
502
|
(0, _steps.startAllureApiStep)(name);
|
|
427
|
-
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error) : undefined);
|
|
503
|
+
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default) : undefined);
|
|
428
504
|
},
|
|
429
505
|
step: (name, body) => {
|
|
430
506
|
(0, _steps.startAllureApiStep)(name);
|
|
@@ -439,7 +515,7 @@ function _createSyncRuntime() {
|
|
|
439
515
|
return result;
|
|
440
516
|
} catch (err) {
|
|
441
517
|
var error = err;
|
|
442
|
-
(0, _steps.stopCurrentAllureApiStep)((0, _sdk.getStatusFromError)(error), (0, _sdk.getMessageAndTraceFromError)(error));
|
|
518
|
+
(0, _steps.stopCurrentAllureApiStep)((0, _sdk.getStatusFromError)(error), (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default));
|
|
443
519
|
throw err;
|
|
444
520
|
}
|
|
445
521
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":["_allureJsCommons","require","_sdk","_runtime","_state","_steps","_utils","ownKeys","e","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","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","has","_assertClassBrand","n","SYNC_STEP_PURE_FUNCTION_ERROR","initTestRuntime","setGlobalTestRuntime","AllureCypressTestRuntime","exports","getTestRuntime","getGlobalTestRuntime","_AllureCypressTestRuntime_brand","WeakSet","constructor","_resetMessages","sync","_createSyncRuntime","labels","_len","Array","_key","_enqueueMessageAsync","type","data","links","_len2","_key2","parameter","name","options","parameters","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","attachmentContent","actualEncoding","_buildAttachmentContent","encoding","contentType","fileExtension","attachmentFromPath","path","globalAttachment","globalAttachmentFromPath","globalError","getGlobalErrorDetails","performanceMetrics","_len3","results","_key3","logStep","status","undefined","Status","PASSED","error","_isInOriginContext","startAllureApiStep","stopCurrentAllureApiStep","getMessageAndTraceFromError","Cypress","Promise","resolve","cy","wrap","ALLURE_STEP_CMD_SUBJECT","log","then","step","body","result","stepDisplayName","stepParameter","mode","flushAllureMessagesToTask","taskName","messages","_dequeueAllMessages","task","absolutePath","spec","absolute","flushAllureMessagesToTaskAsync","args","isInteractive","config","setRuntimeMessages","message","enqueueRuntimeMessage","getRuntimeMessages","rawContent","_normalizeAttachmentContent","uint8ArrayToBase64","Uint8Array","_isSerializedBuffer","candidate","isArray","hasOriginContext","window","cypressOriginContext","hasOriginWindow","cypressOriginWindow","baseUrl","currentOrigin","location","origin","cypressInstance","state","cyExists","cyTaskExists","_unused","_unused2","_len4","_key4","_len5","_key5","isPromise","console","warn","Error","err","getStatusFromError"],"sources":["../../../src/browser/runtime.ts"],"sourcesContent":["import type {\n AllurePerformanceResult,\n AttachmentOptions,\n GlobalErrorArgs,\n Label,\n Link,\n ParameterMode,\n ParameterOptions,\n} from \"allure-js-commons\";\nimport { Status } from \"allure-js-commons\";\nimport {\n getGlobalErrorDetails,\n getMessageAndTraceFromError,\n getStatusFromError,\n isPromise,\n} from \"allure-js-commons/sdk\";\nimport type { SyncTestRuntime, TestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { getGlobalTestRuntime, setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport type { AllureCypressTaskArgs, CypressMessage } from \"../types.js\";\nimport { enqueueRuntimeMessage, getRuntimeMessages, setRuntimeMessages } from \"./state.js\";\nimport { ALLURE_STEP_CMD_SUBJECT, startAllureApiStep, stopCurrentAllureApiStep } from \"./steps.js\";\nimport { uint8ArrayToBase64 } from \"./utils.js\";\n\nconst SYNC_STEP_PURE_FUNCTION_ERROR =\n \"allure-js-commons/sync step body must be synchronous and must not return a Promise\";\n\nexport const initTestRuntime = () => setGlobalTestRuntime(new AllureCypressTestRuntime() as TestRuntime);\n\nexport const getTestRuntime = () => getGlobalTestRuntime() as AllureCypressTestRuntime;\n\ntype SerializedBuffer = {\n type: \"Buffer\";\n data: number[];\n};\n\nclass AllureCypressTestRuntime implements TestRuntime {\n constructor() {\n this.#resetMessages();\n }\n\n get sync(): SyncTestRuntime {\n return this.#createSyncRuntime();\n }\n\n labels(...labels: Label[]) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n labels,\n },\n });\n }\n\n links(...links: Link[]) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n links,\n },\n });\n }\n\n parameter(name: string, value: string, options?: ParameterOptions) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n parameters: [\n {\n name,\n value,\n ...options,\n },\n ],\n },\n });\n }\n\n description(markdown: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n description: markdown,\n },\n });\n }\n\n descriptionHtml(html: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n descriptionHtml: html,\n },\n });\n }\n\n displayName(name: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n displayName: name,\n },\n });\n }\n\n historyId(value: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n historyId: value,\n },\n });\n }\n\n testCaseId(value: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n testCaseId: value,\n },\n });\n }\n\n attachment(name: string, content: Uint8Array | Buffer | string, options: AttachmentOptions) {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Buffer | string | SerializedBuffer,\n );\n\n return this.#enqueueMessageAsync({\n type: \"attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n attachmentFromPath(name: string, path: string, options: Omit<AttachmentOptions, \"encoding\">) {\n return this.#enqueueMessageAsync({\n type: \"attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n globalAttachment(name: string, content: Uint8Array | Buffer | string, options: AttachmentOptions) {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Buffer | string | SerializedBuffer,\n );\n\n return this.#enqueueMessageAsync({\n type: \"global_attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n globalAttachmentFromPath(name: string, path: string, options: Omit<AttachmentOptions, \"encoding\">) {\n return this.#enqueueMessageAsync({\n type: \"global_attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n globalError(...args: GlobalErrorArgs) {\n return this.#enqueueMessageAsync({\n type: \"global_error\",\n data: getGlobalErrorDetails(...args),\n });\n }\n\n performanceMetrics(...results: AllurePerformanceResult[]) {\n return this.#enqueueMessageAsync({\n type: \"performance_result\",\n data: results,\n });\n }\n\n logStep(name: string, status: Status = Status.PASSED, error?: Error): PromiseLike<void> {\n if (this.#isInOriginContext()) {\n startAllureApiStep(name);\n stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error) : undefined);\n return Cypress.Promise.resolve();\n }\n\n return cy\n .wrap(ALLURE_STEP_CMD_SUBJECT, { log: false })\n .then(() => {\n startAllureApiStep(name);\n return Cypress.Promise.resolve();\n })\n .then(() => {\n stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error) : undefined);\n return Cypress.Promise.resolve();\n });\n }\n\n step<T = void>(name: string, body: () => T | PromiseLike<T>) {\n return cy\n .wrap(ALLURE_STEP_CMD_SUBJECT, { log: false })\n .then(() => {\n startAllureApiStep(name);\n return Cypress.Promise.resolve(body());\n })\n .then((result) => {\n stopCurrentAllureApiStep();\n return result;\n });\n }\n\n stepDisplayName(name: string) {\n return this.#enqueueMessageAsync({\n type: \"step_metadata\",\n data: {\n name,\n },\n });\n }\n\n stepParameter(name: string, value: string, mode?: ParameterMode) {\n return this.#enqueueMessageAsync({\n type: \"step_metadata\",\n data: {\n parameters: [{ name, value, mode }],\n },\n });\n }\n\n flushAllureMessagesToTask(taskName: string) {\n const messages = this.#dequeueAllMessages();\n if (messages.length) {\n cy.task(taskName, { absolutePath: Cypress.spec.absolute, messages }, { log: false });\n }\n }\n\n flushAllureMessagesToTaskAsync(taskName: string): Cypress.Chainable<unknown> | undefined {\n const messages = this.#dequeueAllMessages();\n if (messages.length) {\n const args: AllureCypressTaskArgs = {\n absolutePath: Cypress.spec.absolute,\n messages,\n isInteractive: Cypress.config(\"isInteractive\"),\n };\n return cy.task(taskName, args, { log: false });\n }\n }\n\n #resetMessages() {\n setRuntimeMessages([]);\n }\n\n #enqueueMessageAsync(message: CypressMessage): PromiseLike<void> {\n enqueueRuntimeMessage(message);\n return Cypress.Promise.resolve();\n }\n\n #dequeueAllMessages() {\n const messages = getRuntimeMessages();\n this.#resetMessages();\n return messages;\n }\n\n #buildAttachmentContent(content: Uint8Array | Buffer | string | SerializedBuffer): [string, BufferEncoding] {\n const rawContent = this.#normalizeAttachmentContent(content);\n const encoding: BufferEncoding = typeof rawContent === \"string\" ? \"utf8\" : \"base64\";\n\n return [uint8ArrayToBase64(rawContent), encoding];\n }\n\n #normalizeAttachmentContent(content: Uint8Array | Buffer | string | SerializedBuffer): string | Uint8Array {\n if (content instanceof Uint8Array || typeof content === \"string\") {\n return content;\n }\n\n if (this.#isSerializedBuffer(content)) {\n return new Uint8Array(content.data);\n }\n\n return content;\n }\n\n #isSerializedBuffer(content: unknown): content is SerializedBuffer {\n if (!content || typeof content !== \"object\") {\n return false;\n }\n\n const candidate = content as Partial<SerializedBuffer>;\n return candidate.type === \"Buffer\" && Array.isArray(candidate.data);\n }\n\n #isInOriginContext(): boolean {\n try {\n const hasOriginContext = !!(window as any).cypressOriginContext;\n const hasOriginWindow = !!(window as any).cypressOriginWindow;\n\n if (hasOriginContext || hasOriginWindow) {\n return true;\n }\n\n const baseUrl = Cypress.config(\"baseUrl\");\n const currentOrigin = window.location.origin;\n\n if (baseUrl && currentOrigin !== baseUrl) {\n return true;\n }\n\n const cypressInstance = (window as any).Cypress;\n\n if (cypressInstance && cypressInstance.state && cypressInstance.state(\"origin\")) {\n return true;\n }\n\n try {\n const cyExists = typeof cy !== \"undefined\";\n const cyTaskExists = typeof cy.task !== \"undefined\";\n\n // In cy.origin context, cy.task may not be available or may throw\n if (!cyExists || !cyTaskExists) {\n return true;\n }\n } catch {\n return true;\n }\n\n return false;\n } catch {\n return true;\n }\n }\n\n #createSyncRuntime(): SyncTestRuntime {\n return {\n labels: (...labels) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n labels,\n },\n }),\n links: (...links) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n links,\n },\n }),\n parameter: (name, value, options) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n parameters: [\n {\n name,\n value,\n ...options,\n },\n ],\n },\n }),\n description: (markdown) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n description: markdown,\n },\n }),\n descriptionHtml: (html) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n descriptionHtml: html,\n },\n }),\n displayName: (name) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n displayName: name,\n },\n }),\n historyId: (value) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n historyId: value,\n },\n }),\n testCaseId: (value) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n testCaseId: value,\n },\n }),\n attachment: (name, content, options) => {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Uint8Array | Buffer | string | SerializedBuffer,\n );\n\n enqueueRuntimeMessage({\n type: \"attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n },\n attachmentFromPath: (name, path, options) =>\n enqueueRuntimeMessage({\n type: \"attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n }),\n globalAttachment: (name, content, options) => {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Uint8Array | Buffer | string | SerializedBuffer,\n );\n\n enqueueRuntimeMessage({\n type: \"global_attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n },\n globalAttachmentFromPath: (name, path, options) =>\n enqueueRuntimeMessage({\n type: \"global_attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n }),\n globalError: (...args) =>\n enqueueRuntimeMessage({\n type: \"global_error\",\n data: getGlobalErrorDetails(...args),\n }),\n logStep: (name, status = Status.PASSED, error) => {\n startAllureApiStep(name);\n stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error) : undefined);\n },\n step: (name, body) => {\n startAllureApiStep(name);\n\n try {\n const result = body();\n\n if (isPromise(result)) {\n // eslint-disable-next-line no-console\n console.warn(SYNC_STEP_PURE_FUNCTION_ERROR);\n throw new Error(SYNC_STEP_PURE_FUNCTION_ERROR);\n }\n\n stopCurrentAllureApiStep();\n\n return result;\n } catch (err) {\n const error = err as Error;\n\n stopCurrentAllureApiStep(getStatusFromError(error), getMessageAndTraceFromError(error));\n throw err;\n }\n },\n stepDisplayName: (name) =>\n enqueueRuntimeMessage({\n type: \"step_metadata\",\n data: {\n name,\n },\n }),\n stepParameter: (name, value, mode) =>\n enqueueRuntimeMessage({\n type: \"step_metadata\",\n data: {\n parameters: [{ name, value, mode }],\n },\n }),\n };\n }\n}\n"],"mappings":";;;;;;AASA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAOA,IAAAE,QAAA,GAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAgD,SAAAM,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,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C;IACJkD,aAAa,EAAEA,CAAClD,IAAI,EAAE1C,KAAK,EAAE6F,IAAI,KAC/B,IAAAe,4BAAqB,EAAC;MACpBxE,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACJO,UAAU,EAAE,CAAC;UAAEF,IAAI;UAAE1C,KAAK;UAAE6F;QAAK,CAAC;MACpC;IACF,CAAC;EACL,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"runtime.js","names":["_allureJsCommons","require","_sdk","_runtime","_serialize","_interopRequireDefault","_state","_steps","_utils","e","__esModule","default","_slicedToArray","r","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","return","isArray","ownKeys","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","configurable","writable","_toPrimitive","toPrimitive","String","Number","_classPrivateMethodInitSpec","_checkPrivateRedeclaration","add","has","_assertClassBrand","SYNC_STEP_PURE_FUNCTION_ERROR","initTestRuntime","setGlobalTestRuntime","AllureCypressTestRuntime","exports","getTestRuntime","getGlobalTestRuntime","_AllureCypressTestRuntime_brand","WeakSet","_resetMessages","sync","_createSyncRuntime","labels","_len","_key","_enqueueMessageAsync","type","data","links","_len2","_key2","parameter","options","parameters","description","markdown","descriptionHtml","html","precondition","preconditionHtml","expectedResult","expectedResultHtml","displayName","historyId","testCaseId","attachment","content","_assertClassBrand$cal","_buildAttachmentContent","_assertClassBrand$cal2","attachmentContent","actualEncoding","encoding","contentType","fileExtension","attachmentFromPath","path","globalAttachment","_assertClassBrand$cal3","_assertClassBrand$cal4","globalAttachmentFromPath","globalError","getGlobalErrorDetails","metrics","_len3","results","_key3","logStep","status","undefined","Status","PASSED","error","_isInOriginContext","startAllureApiStep","stopCurrentAllureApiStep","getMessageAndTraceFromError","serializeValue","Cypress","Promise","resolve","cy","wrap","ALLURE_STEP_CMD_SUBJECT","log","then","step","body","result","stepDisplayName","stepParameter","mode","flushAllureMessagesToTask","taskName","messages","_dequeueAllMessages","task","absolutePath","spec","absolute","flushAllureMessagesToTaskAsync","args","isInteractive","config","setRuntimeMessages","message","enqueueRuntimeMessage","getRuntimeMessages","rawContent","_normalizeAttachmentContent","uint8ArrayToBase64","Uint8Array","_isSerializedBuffer","candidate","hasOriginContext","window","cypressOriginContext","hasOriginWindow","cypressOriginWindow","baseUrl","currentOrigin","location","origin","cypressInstance","state","cyExists","cyTaskExists","_unused","_unused2","_len4","_key4","_len5","_key5","_assertClassBrand$cal5","_assertClassBrand$cal6","_assertClassBrand$cal7","_assertClassBrand$cal8","isPromise","console","warn","Error","err","getStatusFromError"],"sources":["../../../src/browser/runtime.ts"],"sourcesContent":["import type {\n AllureMetricResult,\n AttachmentOptions,\n GlobalErrorArgs,\n Label,\n Link,\n ParameterMode,\n ParameterOptions,\n} from \"allure-js-commons\";\nimport { Status } from \"allure-js-commons\";\nimport {\n getGlobalErrorDetails,\n getMessageAndTraceFromError,\n getStatusFromError,\n isPromise,\n} from \"allure-js-commons/sdk\";\nimport type { SyncTestRuntime, TestRuntime } from \"allure-js-commons/sdk/runtime\";\nimport { getGlobalTestRuntime, setGlobalTestRuntime } from \"allure-js-commons/sdk/runtime\";\n\nimport type { AllureCypressTaskArgs, CypressMessage } from \"../types.js\";\nimport serializeValue from \"./serialize.js\";\nimport { enqueueRuntimeMessage, getRuntimeMessages, setRuntimeMessages } from \"./state.js\";\nimport { ALLURE_STEP_CMD_SUBJECT, startAllureApiStep, stopCurrentAllureApiStep } from \"./steps.js\";\nimport { uint8ArrayToBase64 } from \"./utils.js\";\n\nconst SYNC_STEP_PURE_FUNCTION_ERROR =\n \"allure-js-commons/sync step body must be synchronous and must not return a Promise\";\n\nexport const initTestRuntime = () => setGlobalTestRuntime(new AllureCypressTestRuntime() as TestRuntime);\n\nexport const getTestRuntime = () => getGlobalTestRuntime() as AllureCypressTestRuntime;\n\ntype SerializedBuffer = {\n type: \"Buffer\";\n data: number[];\n};\n\nclass AllureCypressTestRuntime implements TestRuntime {\n constructor() {\n this.#resetMessages();\n }\n\n get sync(): SyncTestRuntime {\n return this.#createSyncRuntime();\n }\n\n labels(...labels: Label[]) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n labels,\n },\n });\n }\n\n links(...links: Link[]) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n links,\n },\n });\n }\n\n parameter(name: string, value: string, options?: ParameterOptions) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n parameters: [\n {\n name,\n value,\n ...options,\n },\n ],\n },\n });\n }\n\n description(markdown: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n description: markdown,\n },\n });\n }\n\n descriptionHtml(html: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n descriptionHtml: html,\n },\n });\n }\n\n precondition(markdown: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n precondition: markdown,\n },\n });\n }\n\n preconditionHtml(html: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n preconditionHtml: html,\n },\n });\n }\n\n expectedResult(markdown: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n expectedResult: markdown,\n },\n });\n }\n\n expectedResultHtml(html: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n expectedResultHtml: html,\n },\n });\n }\n\n displayName(name: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n displayName: name,\n },\n });\n }\n\n historyId(value: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n historyId: value,\n },\n });\n }\n\n testCaseId(value: string) {\n return this.#enqueueMessageAsync({\n type: \"metadata\",\n data: {\n testCaseId: value,\n },\n });\n }\n\n attachment(name: string, content: Uint8Array | Buffer | string, options: AttachmentOptions) {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Buffer | string | SerializedBuffer,\n );\n\n return this.#enqueueMessageAsync({\n type: \"attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n attachmentFromPath(name: string, path: string, options: Omit<AttachmentOptions, \"encoding\">) {\n return this.#enqueueMessageAsync({\n type: \"attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n globalAttachment(name: string, content: Uint8Array | Buffer | string, options: AttachmentOptions) {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Buffer | string | SerializedBuffer,\n );\n\n return this.#enqueueMessageAsync({\n type: \"global_attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n globalAttachmentFromPath(name: string, path: string, options: Omit<AttachmentOptions, \"encoding\">) {\n return this.#enqueueMessageAsync({\n type: \"global_attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n }\n\n globalError(...args: GlobalErrorArgs) {\n return this.#enqueueMessageAsync({\n type: \"global_error\",\n data: getGlobalErrorDetails(...args),\n });\n }\n\n metrics(...results: AllureMetricResult[]) {\n return this.#enqueueMessageAsync({\n type: \"metric_result\",\n data: results,\n });\n }\n\n logStep(name: string, status: Status = Status.PASSED, error?: Error): PromiseLike<void> {\n if (this.#isInOriginContext()) {\n startAllureApiStep(name);\n stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error, serializeValue) : undefined);\n return Cypress.Promise.resolve();\n }\n\n return cy\n .wrap(ALLURE_STEP_CMD_SUBJECT, { log: false })\n .then(() => {\n startAllureApiStep(name);\n return Cypress.Promise.resolve();\n })\n .then(() => {\n stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error, serializeValue) : undefined);\n return Cypress.Promise.resolve();\n });\n }\n\n step<T = void>(name: string, body: () => T | PromiseLike<T>) {\n return cy\n .wrap(ALLURE_STEP_CMD_SUBJECT, { log: false })\n .then(() => {\n startAllureApiStep(name);\n return Cypress.Promise.resolve(body());\n })\n .then((result) => {\n stopCurrentAllureApiStep();\n return result;\n });\n }\n\n stepDisplayName(name: string) {\n return this.#enqueueMessageAsync({\n type: \"step_metadata\",\n data: {\n name,\n },\n });\n }\n\n stepParameter(name: string, value: string, mode?: ParameterMode) {\n return this.#enqueueMessageAsync({\n type: \"step_metadata\",\n data: {\n parameters: [{ name, value, mode }],\n },\n });\n }\n\n flushAllureMessagesToTask(taskName: string) {\n const messages = this.#dequeueAllMessages();\n if (messages.length) {\n cy.task(taskName, { absolutePath: Cypress.spec.absolute, messages }, { log: false });\n }\n }\n\n flushAllureMessagesToTaskAsync(taskName: string): Cypress.Chainable<unknown> | undefined {\n const messages = this.#dequeueAllMessages();\n if (messages.length) {\n const args: AllureCypressTaskArgs = {\n absolutePath: Cypress.spec.absolute,\n messages,\n isInteractive: Cypress.config(\"isInteractive\"),\n };\n return cy.task(taskName, args, { log: false });\n }\n }\n\n #resetMessages() {\n setRuntimeMessages([]);\n }\n\n #enqueueMessageAsync(message: CypressMessage): PromiseLike<void> {\n enqueueRuntimeMessage(message);\n return Cypress.Promise.resolve();\n }\n\n #dequeueAllMessages() {\n const messages = getRuntimeMessages();\n this.#resetMessages();\n return messages;\n }\n\n #buildAttachmentContent(content: Uint8Array | Buffer | string | SerializedBuffer): [string, BufferEncoding] {\n const rawContent = this.#normalizeAttachmentContent(content);\n const encoding: BufferEncoding = typeof rawContent === \"string\" ? \"utf8\" : \"base64\";\n\n return [uint8ArrayToBase64(rawContent), encoding];\n }\n\n #normalizeAttachmentContent(content: Uint8Array | Buffer | string | SerializedBuffer): string | Uint8Array {\n if (content instanceof Uint8Array || typeof content === \"string\") {\n return content;\n }\n\n if (this.#isSerializedBuffer(content)) {\n return new Uint8Array(content.data);\n }\n\n return content;\n }\n\n #isSerializedBuffer(content: unknown): content is SerializedBuffer {\n if (!content || typeof content !== \"object\") {\n return false;\n }\n\n const candidate = content as Partial<SerializedBuffer>;\n return candidate.type === \"Buffer\" && Array.isArray(candidate.data);\n }\n\n #isInOriginContext(): boolean {\n try {\n const hasOriginContext = !!(window as any).cypressOriginContext;\n const hasOriginWindow = !!(window as any).cypressOriginWindow;\n\n if (hasOriginContext || hasOriginWindow) {\n return true;\n }\n\n const baseUrl = Cypress.config(\"baseUrl\");\n const currentOrigin = window.location.origin;\n\n if (baseUrl && currentOrigin !== baseUrl) {\n return true;\n }\n\n const cypressInstance = (window as any).Cypress;\n\n if (cypressInstance && cypressInstance.state && cypressInstance.state(\"origin\")) {\n return true;\n }\n\n try {\n const cyExists = typeof cy !== \"undefined\";\n const cyTaskExists = typeof cy.task !== \"undefined\";\n\n // In cy.origin context, cy.task may not be available or may throw\n if (!cyExists || !cyTaskExists) {\n return true;\n }\n } catch {\n return true;\n }\n\n return false;\n } catch {\n return true;\n }\n }\n\n #createSyncRuntime(): SyncTestRuntime {\n return {\n labels: (...labels) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n labels,\n },\n }),\n links: (...links) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n links,\n },\n }),\n parameter: (name, value, options) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n parameters: [\n {\n name,\n value,\n ...options,\n },\n ],\n },\n }),\n description: (markdown) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n description: markdown,\n },\n }),\n descriptionHtml: (html) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n descriptionHtml: html,\n },\n }),\n precondition: (markdown) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n precondition: markdown,\n },\n }),\n preconditionHtml: (html) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n preconditionHtml: html,\n },\n }),\n expectedResult: (markdown) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n expectedResult: markdown,\n },\n }),\n expectedResultHtml: (html) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n expectedResultHtml: html,\n },\n }),\n displayName: (name) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n displayName: name,\n },\n }),\n historyId: (value) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n historyId: value,\n },\n }),\n testCaseId: (value) =>\n enqueueRuntimeMessage({\n type: \"metadata\",\n data: {\n testCaseId: value,\n },\n }),\n attachment: (name, content, options) => {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Uint8Array | Buffer | string | SerializedBuffer,\n );\n\n enqueueRuntimeMessage({\n type: \"attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n },\n attachmentFromPath: (name, path, options) =>\n enqueueRuntimeMessage({\n type: \"attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n }),\n globalAttachment: (name, content, options) => {\n const [attachmentContent, actualEncoding] = this.#buildAttachmentContent(\n content as Uint8Array | Buffer | string | SerializedBuffer,\n );\n\n enqueueRuntimeMessage({\n type: \"global_attachment_content\",\n data: {\n name,\n content: attachmentContent,\n encoding: actualEncoding,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n });\n },\n globalAttachmentFromPath: (name, path, options) =>\n enqueueRuntimeMessage({\n type: \"global_attachment_path\",\n data: {\n name,\n path,\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n },\n }),\n globalError: (...args) =>\n enqueueRuntimeMessage({\n type: \"global_error\",\n data: getGlobalErrorDetails(...args),\n }),\n logStep: (name, status = Status.PASSED, error) => {\n startAllureApiStep(name);\n stopCurrentAllureApiStep(status, error ? getMessageAndTraceFromError(error, serializeValue) : undefined);\n },\n step: (name, body) => {\n startAllureApiStep(name);\n\n try {\n const result = body();\n\n if (isPromise(result)) {\n // eslint-disable-next-line no-console\n console.warn(SYNC_STEP_PURE_FUNCTION_ERROR);\n throw new Error(SYNC_STEP_PURE_FUNCTION_ERROR);\n }\n\n stopCurrentAllureApiStep();\n\n return result;\n } catch (err) {\n const error = err as Error;\n\n stopCurrentAllureApiStep(getStatusFromError(error), getMessageAndTraceFromError(error, serializeValue));\n throw err;\n }\n },\n stepDisplayName: (name) =>\n enqueueRuntimeMessage({\n type: \"step_metadata\",\n data: {\n name,\n },\n }),\n stepParameter: (name, value, mode) =>\n enqueueRuntimeMessage({\n type: \"step_metadata\",\n data: {\n parameters: [{ name, value, mode }],\n },\n }),\n };\n }\n}\n"],"mappings":";;;;;;AASA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAOA,IAAAE,QAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAgD,SAAAI,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAC,CAAA,EAAAJ,CAAA,WAAAK,eAAA,CAAAD,CAAA,KAAAE,qBAAA,CAAAF,CAAA,EAAAJ,CAAA,KAAAO,2BAAA,CAAAH,CAAA,EAAAJ,CAAA,KAAAQ,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA,EAAAM,CAAA,QAAAN,CAAA,2BAAAA,CAAA,SAAAO,iBAAA,CAAAP,CAAA,EAAAM,CAAA,OAAAE,CAAA,MAAAC,QAAA,CAAAC,IAAA,CAAAV,CAAA,EAAAW,KAAA,6BAAAH,CAAA,IAAAR,CAAA,CA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;MAExB,IAAI;QACF,IAAM4H,MAAM,GAAGD,IAAI,CAAC,CAAC;QAErB,IAAI,IAAAkD,cAAS,EAACjD,MAAM,CAAC,EAAE;UACrB;UACAkD,OAAO,CAACC,IAAI,CAACjI,6BAA6B,CAAC;UAC3C,MAAM,IAAIkI,KAAK,CAAClI,6BAA6B,CAAC;QAChD;QAEA,IAAAiE,+BAAwB,EAAC,CAAC;QAE1B,OAAOa,MAAM;MACf,CAAC,CAAC,OAAOqD,GAAG,EAAE;QACZ,IAAMrE,KAAK,GAAGqE,GAAY;QAE1B,IAAAlE,+BAAwB,EAAC,IAAAmE,uBAAkB,EAACtE,KAAK,CAAC,EAAE,IAAAI,gCAA2B,EAACJ,KAAK,EAAEK,kBAAc,CAAC,CAAC;QACvG,MAAMgE,GAAG;MACX;IACF,CAAC;IACDpD,eAAe,EAAG7H,IAAI,IACpB,IAAA8I,4BAAqB,EAAC;MACpBhF,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACJ/D;MACF;IACF,CAAC,CAAC;IACJ8H,aAAa,EAAEA,CAAC9H,IAAI,EAAEiB,KAAK,EAAE8G,IAAI,KAC/B,IAAAe,4BAAqB,EAAC;MACpBhF,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACJM,UAAU,EAAE,CAAC;UAAErE,IAAI;UAAEiB,KAAK;UAAE8G;QAAK,CAAC;MACpC;IACF,CAAC;EACL,CAAC;AACH","ignoreList":[]}
|
|
@@ -6,39 +6,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _sdk = require("allure-js-commons/sdk");
|
|
8
8
|
var _state = require("./state.js");
|
|
9
|
-
var _default = value =>
|
|
9
|
+
var _default = value => {
|
|
10
|
+
try {
|
|
11
|
+
// Storage can belong to another window, so instanceof Storage is not reliable here.
|
|
12
|
+
if (Object.prototype.toString.call(value) === "[object Storage]") {
|
|
13
|
+
return "[object Storage]";
|
|
14
|
+
}
|
|
15
|
+
return (0, _sdk.serialize)(isDomObject(value) ? stringifyAsDom(value) : value, getSerializeOptions());
|
|
16
|
+
} catch (_unused) {
|
|
17
|
+
// Unexpected serialization errors must not interrupt the test lifecycle.
|
|
18
|
+
return "[Unserializable value]";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
10
21
|
exports.default = _default;
|
|
11
22
|
var getSerializeOptions = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = (0, _state.getConfig)();
|
|
23
|
+
// Use the same value limits for command parameters and assertion comparisons.
|
|
24
|
+
var _getConfig = (0, _state.getConfig)(),
|
|
25
|
+
_getConfig$stepsFromC = _getConfig.stepsFromCommands,
|
|
26
|
+
maxDepth = _getConfig$stepsFromC.maxArgumentDepth,
|
|
27
|
+
maxLength = _getConfig$stepsFromC.maxArgumentLength;
|
|
18
28
|
return {
|
|
19
29
|
maxDepth,
|
|
20
30
|
maxLength,
|
|
21
|
-
|
|
31
|
+
replacer: replacerWithDomSupport
|
|
22
32
|
};
|
|
23
33
|
};
|
|
24
34
|
var isDomObject = value => typeof value === "object" && value !== null && Cypress.dom.isDom(value);
|
|
25
35
|
|
|
26
36
|
// @ts-ignore
|
|
27
37
|
var stringifyAsDom = value => Cypress.dom.stringify(value, "long");
|
|
28
|
-
var
|
|
29
|
-
if (typeof value === "object") {
|
|
30
|
-
// Exclude null properties to make the result more compact.
|
|
31
|
-
if (value === null) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
if (Cypress.dom.isDom(value)) {
|
|
35
|
-
// Window, document, and DOM element properties are serialized with Cypress.dom.stringify.
|
|
36
|
-
return stringifyAsDom(value);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Use the implementation from allure-js-commons/sdk in all other cases.
|
|
41
|
-
return value;
|
|
42
|
-
};
|
|
38
|
+
var replacerWithDomSupport = (_, value) => isDomObject(value) ? stringifyAsDom(value) : value;
|
|
43
39
|
module.exports = exports.default;
|
|
44
40
|
//# sourceMappingURL=serialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","names":["_sdk","require","_state","_default","value","
|
|
1
|
+
{"version":3,"file":"serialize.js","names":["_sdk","require","_state","_default","value","Object","prototype","toString","call","serialize","isDomObject","stringifyAsDom","getSerializeOptions","_unused","exports","default","_getConfig","getConfig","_getConfig$stepsFromC","stepsFromCommands","maxDepth","maxArgumentDepth","maxLength","maxArgumentLength","replacer","replacerWithDomSupport","Cypress","dom","isDom","stringify","_","module"],"sources":["../../../src/browser/serialize.ts"],"sourcesContent":["import { type SerializeOptions, serialize } from \"allure-js-commons/sdk\";\n\nimport { getConfig } from \"./state.js\";\n\nexport default (value: unknown) => {\n try {\n // Storage can belong to another window, so instanceof Storage is not reliable here.\n if (Object.prototype.toString.call(value) === \"[object Storage]\") {\n return \"[object Storage]\";\n }\n\n return serialize(isDomObject(value) ? stringifyAsDom(value) : value, getSerializeOptions());\n } catch {\n // Unexpected serialization errors must not interrupt the test lifecycle.\n return \"[Unserializable value]\";\n }\n};\n\nconst getSerializeOptions = (): SerializeOptions => {\n // Use the same value limits for command parameters and assertion comparisons.\n const {\n stepsFromCommands: { maxArgumentDepth: maxDepth, maxArgumentLength: maxLength },\n } = getConfig();\n\n return { maxDepth, maxLength, replacer: replacerWithDomSupport };\n};\n\nconst isDomObject = (value: unknown): value is object =>\n typeof value === \"object\" && value !== null && Cypress.dom.isDom(value);\n\n// @ts-ignore\nconst stringifyAsDom = (value: object) => Cypress.dom.stringify(value, \"long\");\n\nconst replacerWithDomSupport = (_: string, value: unknown) => (isDomObject(value) ? stringifyAsDom(value) : value);\n"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAuC,IAAAE,QAAA,GAEvBC,KAAc,IAAK;EACjC,IAAI;IACF;IACA,IAAIC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ,KAAK,CAAC,KAAK,kBAAkB,EAAE;MAChE,OAAO,kBAAkB;IAC3B;IAEA,OAAO,IAAAK,cAAS,EAACC,WAAW,CAACN,KAAK,CAAC,GAAGO,cAAc,CAACP,KAAK,CAAC,GAAGA,KAAK,EAAEQ,mBAAmB,CAAC,CAAC,CAAC;EAC7F,CAAC,CAAC,OAAAC,OAAA,EAAM;IACN;IACA,OAAO,wBAAwB;EACjC;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAZ,QAAA;AAED,IAAMS,mBAAmB,GAAGA,CAAA,KAAwB;EAClD;EACA,IAAAI,UAAA,GAEI,IAAAC,gBAAS,EAAC,CAAC;IAAAC,qBAAA,GAAAF,UAAA,CADbG,iBAAiB;IAAsBC,QAAQ,GAAAF,qBAAA,CAA1BG,gBAAgB;IAA+BC,SAAS,GAAAJ,qBAAA,CAA5BK,iBAAiB;EAGpE,OAAO;IAAEH,QAAQ;IAAEE,SAAS;IAAEE,QAAQ,EAAEC;EAAuB,CAAC;AAClE,CAAC;AAED,IAAMf,WAAW,GAAIN,KAAc,IACjC,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,IAAIsB,OAAO,CAACC,GAAG,CAACC,KAAK,CAACxB,KAAK,CAAC;;AAEzE;AACA,IAAMO,cAAc,GAAIP,KAAa,IAAKsB,OAAO,CAACC,GAAG,CAACE,SAAS,CAACzB,KAAK,EAAE,MAAM,CAAC;AAE9E,IAAMqB,sBAAsB,GAAGA,CAACK,CAAS,EAAE1B,KAAc,KAAMM,WAAW,CAACN,KAAK,CAAC,GAAGO,cAAc,CAACP,KAAK,CAAC,GAAGA,KAAM;AAAC2B,MAAA,CAAAjB,OAAA,GAAAA,OAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -8,8 +8,16 @@ var _allureJsCommons = require("allure-js-commons");
|
|
|
8
8
|
var _sdk = require("allure-js-commons/sdk");
|
|
9
9
|
var _utils = require("../utils.js");
|
|
10
10
|
var _lifecycle = require("./lifecycle.js");
|
|
11
|
+
var _serialize = _interopRequireDefault(require("./serialize.js"));
|
|
11
12
|
var _state = require("./state.js");
|
|
12
13
|
var _utils2 = require("./utils.js");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
21
|
var ALLURE_STEP_CMD_SUBJECT = exports.ALLURE_STEP_CMD_SUBJECT = {};
|
|
14
22
|
var isApiStep = descriptor => {
|
|
15
23
|
return descriptor.type === "api";
|
|
@@ -32,7 +40,7 @@ var pushAllureStep = () => {
|
|
|
32
40
|
exports.pushAllureStep = pushAllureStep;
|
|
33
41
|
var reportStepError = error => {
|
|
34
42
|
var status = (0, _sdk.getStatusFromError)(error);
|
|
35
|
-
var statusDetails = (0, _sdk.getMessageAndTraceFromError)(error);
|
|
43
|
+
var statusDetails = (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default);
|
|
36
44
|
|
|
37
45
|
// Cypress will abort the test/hook execution soon. No subsequent commands will be run, including the ones that
|
|
38
46
|
// have been scheduled by `allure.step` to stop the currently running steps.
|
|
@@ -70,11 +78,11 @@ exports.finalizeSteps = finalizeSteps;
|
|
|
70
78
|
var resolveStepStatus = step => step.error ? (0, _sdk.getStatusFromError)(step.error) : _allureJsCommons.Status.PASSED;
|
|
71
79
|
exports.resolveStepStatus = resolveStepStatus;
|
|
72
80
|
var finalizeOneStep = _ref => {
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
82
|
+
step = _ref2[0],
|
|
83
|
+
finalizer = _ref2[1];
|
|
84
|
+
var id = step.id,
|
|
85
|
+
error = step.error;
|
|
78
86
|
var data = {
|
|
79
87
|
id
|
|
80
88
|
};
|
|
@@ -83,7 +91,7 @@ var finalizeOneStep = _ref => {
|
|
|
83
91
|
// trace points inside the messy bundle, which is not helpful. There are circumstances when we can't be sure this
|
|
84
92
|
// has happened when a step is about to stop. That's why we defer setting the status details until we are sure
|
|
85
93
|
// Cypress does its job.
|
|
86
|
-
data.statusDetails = (0, _sdk.getMessageAndTraceFromError)(error);
|
|
94
|
+
data.statusDetails = (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default);
|
|
87
95
|
}
|
|
88
96
|
finalizer === null || finalizer === void 0 || finalizer(data);
|
|
89
97
|
(0, _state.enqueueRuntimeMessage)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","names":["_allureJsCommons","require","_sdk","_utils","_lifecycle","_state","_utils2","ALLURE_STEP_CMD_SUBJECT","exports","isApiStep","descriptor","type","isLogStep","startAllureApiStep","name","reportStepStart","pushAllureStep","id","generateApiStepId","pushStep","reportStepError","error","status","getStatusFromError","statusDetails","getMessageAndTraceFromError","stopAllureApiStepStackTip","associateErrorWithRunningSteps","stopCurrentAllureApiStep","findAndStopStepWithSubsteps","stepDescriptor","pred","stopSelectedSteps","popUntilFindIncluded","getStepStack","stopAllSteps","popAllSteps","finalizeSteps","getStepsToFinalize","forEach","finalizeOneStep","clearStepsToFinalize","resolveStepStatus","step","Status","PASSED","_ref","finalizer","data","enqueueRuntimeMessage","stepStack","firstApiStepAfterLastLogStep","at","findLastIndex","logEntryOrMessage","Object","is","propagateErrorToStepDescriptor","errorOfSubstep","log","attributes","steps","stepEntry","stopStep","reportStepStop","setupStepFinalization"],"sources":["../../../src/browser/steps.ts"],"sourcesContent":["import type { StatusDetails } from \"allure-js-commons\";\nimport { Status } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\n\nimport type {\n ApiStepDescriptor,\n CypressStepFinalizeMessage,\n LogStepDescriptor,\n StepDescriptor,\n StepFinalizer,\n} from \"../types.js\";\nimport { popUntilFindIncluded } from \"../utils.js\";\nimport { reportStepStart, reportStepStop } from \"./lifecycle.js\";\nimport {\n clearStepsToFinalize,\n enqueueRuntimeMessage,\n getStepStack,\n getStepsToFinalize,\n popAllSteps,\n pushStep,\n setupStepFinalization,\n} from \"./state.js\";\nimport { generateApiStepId } from \"./utils.js\";\n\nexport const ALLURE_STEP_CMD_SUBJECT = {};\n\nexport const isApiStep = (descriptor: StepDescriptor): descriptor is ApiStepDescriptor => {\n return descriptor.type === \"api\";\n};\n\nexport const isLogStep = (descriptor: StepDescriptor): descriptor is LogStepDescriptor => {\n return descriptor.type === \"log\";\n};\n\nexport const startAllureApiStep = (name: string) => reportStepStart(pushAllureStep(), name);\n\nexport const pushAllureStep = () => {\n const id = generateApiStepId();\n pushStep({ id, type: \"api\" });\n return id;\n};\n\nexport const reportStepError = (error: Error) => {\n const status = getStatusFromError(error);\n const statusDetails = getMessageAndTraceFromError(error);\n\n // Cypress will abort the test/hook execution soon. No subsequent commands will be run, including the ones that\n // have been scheduled by `allure.step` to stop the currently running steps.\n // Additionally, we can't tell in advance if the current command log steps will be stopped normally or not.\n //\n // Given that, this function will stop all consecutive Allure API steps at the tip of the step stack.\n // The command log steps will be given a chance to stop normally to get the most correct timings.\n //\n // The command log steps that won't stop normally (and Allure API substeps thereof) will be stopped during the\n // test/hook finalization phase.\n stopAllureApiStepStackTip(status, statusDetails);\n\n // It's not guaranteed for command log steps and intermediate Allure API steps to have access to the error at the\n // moment they are stopped.\n // Additionally, Cypress may not update the stack trace of the error at that time. Until that happens, the stack\n // trace points deep in the bundled code, which is little to no use for the user. Therefore, we need to associate\n // the remaining steps with the error object to grab the updated stack trace later.\n associateErrorWithRunningSteps(error);\n};\n\nexport const stopCurrentAllureApiStep = (status?: Status, statusDetails?: StatusDetails) =>\n findAndStopStepWithSubsteps((stepDescriptor) => isApiStep(stepDescriptor), status, statusDetails);\n\nexport const findAndStopStepWithSubsteps = (\n pred: (stepEntry: StepDescriptor) => boolean,\n status?: Status,\n statusDetails?: StatusDetails,\n) => stopSelectedSteps(popUntilFindIncluded(getStepStack(), pred), status, statusDetails);\n\nexport const stopAllSteps = (status?: Status, statusDetails?: StatusDetails) =>\n stopSelectedSteps(popAllSteps(), status, statusDetails);\n\nexport const finalizeSteps = () => {\n // This will stop all dangling steps (like log groups with missing endGroup calls or logs that haven't been\n // finished by Cypress due to an error).\n stopAllSteps();\n\n getStepsToFinalize().forEach(finalizeOneStep);\n clearStepsToFinalize();\n};\n\nexport const resolveStepStatus = (step: StepDescriptor) =>\n step.error ? getStatusFromError(step.error) : Status.PASSED;\n\nconst finalizeOneStep = ([step, finalizer]: [StepDescriptor, StepFinalizer | undefined]) => {\n const { id, error } = step;\n const data: CypressStepFinalizeMessage[\"data\"] = { id };\n\n if (error) {\n // Cypress rewrites the stack trace of an error to point to the location in the test file. Until then, the stack\n // trace points inside the messy bundle, which is not helpful. There are circumstances when we can't be sure this\n // has happened when a step is about to stop. That's why we defer setting the status details until we are sure\n // Cypress does its job.\n data.statusDetails = getMessageAndTraceFromError(error);\n }\n\n finalizer?.(data);\n\n enqueueRuntimeMessage({\n type: \"cypress_step_finalize\",\n data,\n });\n};\n\nconst stopAllureApiStepStackTip = (status: Status, statusDetails: StatusDetails) => {\n const stepStack = getStepStack();\n const firstApiStepAfterLastLogStep = stepStack.at(stepStack.findLastIndex(isLogStep) + 1);\n if (firstApiStepAfterLastLogStep) {\n findAndStopStepWithSubsteps(\n (logEntryOrMessage) => Object.is(logEntryOrMessage, firstApiStepAfterLastLogStep),\n status,\n statusDetails,\n );\n }\n};\n\nconst propagateErrorToStepDescriptor = (step: StepDescriptor, errorOfSubstep: Error | undefined) => {\n if (isLogStep(step)) {\n const error = step.log.attributes.error;\n if (error) {\n return (step.error = error);\n }\n }\n\n if (errorOfSubstep) {\n step.error = errorOfSubstep;\n }\n\n return step.error;\n};\n\nconst stopSelectedSteps = (steps: readonly StepDescriptor[], status?: Status, statusDetails?: StatusDetails) => {\n let error: Error | undefined;\n for (const stepEntry of steps) {\n error = propagateErrorToStepDescriptor(stepEntry, error);\n stopStep(stepEntry, status, statusDetails);\n }\n\n if (error) {\n associateErrorWithRunningSteps(error);\n }\n};\n\nconst associateErrorWithRunningSteps = (error: Error) => getStepStack().forEach((step) => (step.error = error));\n\nconst stopStep = (step: StepDescriptor, status?: Status, statusDetails?: StatusDetails) => {\n reportStepStop(step, status, statusDetails);\n\n if (isApiStep(step) && step.error) {\n setupStepFinalization(step);\n }\n};\n"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAA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a,CAAC;EAC5C;EAEA,IAAIH,KAAK,EAAE;IACTM,8BAA8B,CAACN,KAAK,CAAC;EACvC;AACF,CAAC;AAED,IAAMM,8BAA8B,GAAIN,KAAY,IAAK,IAAAa,mBAAY,EAAC,CAAC,CAACK,OAAO,CAAEI,IAAI,IAAMA,IAAI,CAACtB,KAAK,GAAGA,KAAM,CAAC;AAE/G,IAAM0C,QAAQ,GAAGA,CAACpB,IAAoB,EAAErB,MAAe,EAAEE,aAA6B,KAAK;EACzF,IAAAwC,yBAAc,EAACrB,IAAI,EAAErB,MAAM,EAAEE,aAAa,CAAC;EAE3C,IAAIf,SAAS,CAACkC,IAAI,CAAC,IAAIA,IAAI,CAACtB,KAAK,EAAE;IACjC,IAAA4C,4BAAqB,EAACtB,IAAI,CAAC;EAC7B;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"steps.js","names":["_allureJsCommons","require","_sdk","_utils","_lifecycle","_serialize","_interopRequireDefault","_state","_utils2","e","__esModule","default","_slicedToArray","r","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","return","isArray","ALLURE_STEP_CMD_SUBJECT","exports","isApiStep","descriptor","type","isLogStep","startAllureApiStep","reportStepStart","pushAllureStep","id","generateApiStepId","pushStep","reportStepError","error","status","getStatusFromError","statusDetails","getMessageAndTraceFromError","serializeValue","stopAllureApiStepStackTip","associateErrorWithRunningSteps","stopCurrentAllureApiStep","findAndStopStepWithSubsteps","stepDescriptor","pred","stopSelectedSteps","popUntilFindIncluded","getStepStack","stopAllSteps","popAllSteps","finalizeSteps","getStepsToFinalize","forEach","finalizeOneStep","clearStepsToFinalize","resolveStepStatus","step","Status","PASSED","_ref","_ref2","finalizer","data","enqueueRuntimeMessage","stepStack","firstApiStepAfterLastLogStep","at","findLastIndex","logEntryOrMessage","is","propagateErrorToStepDescriptor","errorOfSubstep","log","attributes","steps","stepEntry","stopStep","reportStepStop","setupStepFinalization"],"sources":["../../../src/browser/steps.ts"],"sourcesContent":["import type { StatusDetails } from \"allure-js-commons\";\nimport { Status } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\n\nimport type {\n ApiStepDescriptor,\n CypressStepFinalizeMessage,\n LogStepDescriptor,\n StepDescriptor,\n StepFinalizer,\n} from \"../types.js\";\nimport { popUntilFindIncluded } from \"../utils.js\";\nimport { reportStepStart, reportStepStop } from \"./lifecycle.js\";\nimport serializeValue from \"./serialize.js\";\nimport {\n clearStepsToFinalize,\n enqueueRuntimeMessage,\n getStepStack,\n getStepsToFinalize,\n popAllSteps,\n pushStep,\n setupStepFinalization,\n} from \"./state.js\";\nimport { generateApiStepId } from \"./utils.js\";\n\nexport const ALLURE_STEP_CMD_SUBJECT = {};\n\nexport const isApiStep = (descriptor: StepDescriptor): descriptor is ApiStepDescriptor => {\n return descriptor.type === \"api\";\n};\n\nexport const isLogStep = (descriptor: StepDescriptor): descriptor is LogStepDescriptor => {\n return descriptor.type === \"log\";\n};\n\nexport const startAllureApiStep = (name: string) => reportStepStart(pushAllureStep(), name);\n\nexport const pushAllureStep = () => {\n const id = generateApiStepId();\n pushStep({ id, type: \"api\" });\n return id;\n};\n\nexport const reportStepError = (error: Error) => {\n const status = getStatusFromError(error);\n const statusDetails = getMessageAndTraceFromError(error, serializeValue);\n\n // Cypress will abort the test/hook execution soon. No subsequent commands will be run, including the ones that\n // have been scheduled by `allure.step` to stop the currently running steps.\n // Additionally, we can't tell in advance if the current command log steps will be stopped normally or not.\n //\n // Given that, this function will stop all consecutive Allure API steps at the tip of the step stack.\n // The command log steps will be given a chance to stop normally to get the most correct timings.\n //\n // The command log steps that won't stop normally (and Allure API substeps thereof) will be stopped during the\n // test/hook finalization phase.\n stopAllureApiStepStackTip(status, statusDetails);\n\n // It's not guaranteed for command log steps and intermediate Allure API steps to have access to the error at the\n // moment they are stopped.\n // Additionally, Cypress may not update the stack trace of the error at that time. Until that happens, the stack\n // trace points deep in the bundled code, which is little to no use for the user. Therefore, we need to associate\n // the remaining steps with the error object to grab the updated stack trace later.\n associateErrorWithRunningSteps(error);\n};\n\nexport const stopCurrentAllureApiStep = (status?: Status, statusDetails?: StatusDetails) =>\n findAndStopStepWithSubsteps((stepDescriptor) => isApiStep(stepDescriptor), status, statusDetails);\n\nexport const findAndStopStepWithSubsteps = (\n pred: (stepEntry: StepDescriptor) => boolean,\n status?: Status,\n statusDetails?: StatusDetails,\n) => stopSelectedSteps(popUntilFindIncluded(getStepStack(), pred), status, statusDetails);\n\nexport const stopAllSteps = (status?: Status, statusDetails?: StatusDetails) =>\n stopSelectedSteps(popAllSteps(), status, statusDetails);\n\nexport const finalizeSteps = () => {\n // This will stop all dangling steps (like log groups with missing endGroup calls or logs that haven't been\n // finished by Cypress due to an error).\n stopAllSteps();\n\n getStepsToFinalize().forEach(finalizeOneStep);\n clearStepsToFinalize();\n};\n\nexport const resolveStepStatus = (step: StepDescriptor) =>\n step.error ? getStatusFromError(step.error) : Status.PASSED;\n\nconst finalizeOneStep = ([step, finalizer]: [StepDescriptor, StepFinalizer | undefined]) => {\n const { id, error } = step;\n const data: CypressStepFinalizeMessage[\"data\"] = { id };\n\n if (error) {\n // Cypress rewrites the stack trace of an error to point to the location in the test file. Until then, the stack\n // trace points inside the messy bundle, which is not helpful. There are circumstances when we can't be sure this\n // has happened when a step is about to stop. That's why we defer setting the status details until we are sure\n // Cypress does its job.\n data.statusDetails = getMessageAndTraceFromError(error, serializeValue);\n }\n\n finalizer?.(data);\n\n enqueueRuntimeMessage({\n type: \"cypress_step_finalize\",\n data,\n });\n};\n\nconst stopAllureApiStepStackTip = (status: Status, statusDetails: StatusDetails) => {\n const stepStack = getStepStack();\n const firstApiStepAfterLastLogStep = stepStack.at(stepStack.findLastIndex(isLogStep) + 1);\n if (firstApiStepAfterLastLogStep) {\n findAndStopStepWithSubsteps(\n (logEntryOrMessage) => Object.is(logEntryOrMessage, firstApiStepAfterLastLogStep),\n status,\n statusDetails,\n );\n }\n};\n\nconst propagateErrorToStepDescriptor = (step: StepDescriptor, errorOfSubstep: Error | undefined) => {\n if (isLogStep(step)) {\n const error = step.log.attributes.error;\n if (error) {\n return (step.error = error);\n }\n }\n\n if (errorOfSubstep) {\n step.error = errorOfSubstep;\n }\n\n return step.error;\n};\n\nconst stopSelectedSteps = (steps: readonly StepDescriptor[], status?: Status, statusDetails?: StatusDetails) => {\n let error: Error | undefined;\n for (const stepEntry of steps) {\n error = propagateErrorToStepDescriptor(stepEntry, error);\n stopStep(stepEntry, status, statusDetails);\n }\n\n if (error) {\n associateErrorWithRunningSteps(error);\n }\n};\n\nconst associateErrorWithRunningSteps = (error: Error) => getStepStack().forEach((step) => (step.error = error));\n\nconst stopStep = (step: StepDescriptor, status?: Status, statusDetails?: StatusDetails) => {\n reportStepStop(step, status, statusDetails);\n\n if (isApiStep(step) && step.error) {\n setupStepFinalization(step);\n }\n};\n"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AASA,IAAAO,OAAA,GAAAP,OAAA;AAA+C,SAAAK,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAC,CAAA,EAAAJ,CAAA,WAAAK,eAAA,CAAAD,CAAA,KAAAE,qBAAA,CAAAF,CAAA,EAAAJ,CAAA,KAAAO,2BAAA,CAAAH,CAAA,EAAAJ,CAAA,KAAAQ,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAH,CAAA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