allure-cypress 3.13.0 → 3.15.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 +15 -1
- package/dist/cjs/browser/events/cypress.js +17 -5
- package/dist/cjs/browser/events/cypress.js.map +1 -1
- package/dist/cjs/browser/lifecycle.js +3 -1
- package/dist/cjs/browser/lifecycle.js.map +1 -1
- package/dist/cjs/browser/runtime.js +83 -14
- package/dist/cjs/browser/runtime.js.map +1 -1
- package/dist/cjs/browser/serialize.js +15 -17
- package/dist/cjs/browser/serialize.js.map +1 -1
- package/dist/cjs/browser/steps.js +4 -2
- package/dist/cjs/browser/steps.js.map +1 -1
- package/dist/cjs/browser/utils.js +3 -1
- package/dist/cjs/browser/utils.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/reporter.js +97 -56
- package/dist/cjs/reporter.js.map +1 -1
- package/dist/esm/browser/events/cypress.js +17 -5
- package/dist/esm/browser/events/cypress.js.map +1 -1
- package/dist/esm/browser/lifecycle.js +2 -1
- package/dist/esm/browser/lifecycle.js.map +1 -1
- package/dist/esm/browser/runtime.js +83 -15
- package/dist/esm/browser/runtime.js.map +1 -1
- package/dist/esm/browser/serialize.js +15 -17
- package/dist/esm/browser/serialize.js.map +1 -1
- package/dist/esm/browser/steps.js +3 -2
- package/dist/esm/browser/steps.js.map +1 -1
- package/dist/esm/browser/utils.js +2 -1
- package/dist/esm/browser/utils.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/reporter.js +98 -57
- package/dist/esm/reporter.js.map +1 -1
- package/dist/types/browser/runtime.d.ts +7 -2
- package/dist/types/browser/steps.d.ts +1 -1
- package/dist/types/reporter.d.ts +5 -0
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ npm install -D allure-cypress
|
|
|
32
32
|
|
|
33
33
|
Install Allure Report separately when you want to render the generated `allure-results`:
|
|
34
34
|
|
|
35
|
-
- follow the [Allure Report 2 installation guide](https://allurereport.org/docs/install/) to use the `allure` CLI
|
|
35
|
+
- follow the [Allure Report 2 installation guide](https://allurereport.org/docs/v2/install/) to use the `allure` CLI
|
|
36
36
|
- or install Allure Report 3 with `npm install -D allure` to use `npx allure`
|
|
37
37
|
|
|
38
38
|
## Supported versions and platforms
|
|
@@ -139,6 +139,14 @@ describe("signing in with a password", () => {
|
|
|
139
139
|
|
|
140
140
|
More details about the API are available at [https://allurereport.org/docs/cypress-reference/](https://allurereport.org/docs/cypress-reference/).
|
|
141
141
|
|
|
142
|
+
### Assertion comparison values
|
|
143
|
+
|
|
144
|
+
Assertion and step errors use DOM-aware formatting for `actual` and `expected` values. These values share the `stepsFromCommands.maxArgumentDepth` and `maxArgumentLength` limits with command parameters.
|
|
145
|
+
|
|
146
|
+
These limits affect reported comparison values, not assertion execution or the original error message and stack trace. Set a limit to `0` to disable it for both command parameters and comparison values.
|
|
147
|
+
|
|
148
|
+
`globalError()` does not apply DOM formatting or the limits above. For global errors with DOM subjects, pass plain status details with `message`, `trace`, and already formatted string values for `actual` and `expected` instead of raw DOM values.
|
|
149
|
+
|
|
142
150
|
### Sync API
|
|
143
151
|
|
|
144
152
|
When your test code uses synchronous helpers or matcher integrations, you can use the sync facade from `allure-js-commons/sync`.
|
|
@@ -227,6 +235,7 @@ Cypress can't compose multiple Node events, which are set in `setupNodeEvents`.
|
|
|
227
235
|
|
|
228
236
|
Allure Cypress requires access to the following events:
|
|
229
237
|
|
|
238
|
+
- `after:screenshot`
|
|
230
239
|
- `after:spec`
|
|
231
240
|
- `after:run`
|
|
232
241
|
|
|
@@ -243,6 +252,11 @@ export default defineConfig({
|
|
|
243
252
|
setupNodeEvents: (on, config) => {
|
|
244
253
|
const allurePlugin = allureCypress(on, config);
|
|
245
254
|
|
|
255
|
+
on("after:screenshot", (details) => {
|
|
256
|
+
// Apply any screenshot changes first, then pass the final path to Allure.
|
|
257
|
+
allurePlugin.onAfterScreenshot(details);
|
|
258
|
+
});
|
|
259
|
+
|
|
246
260
|
on("after:spec", (spec, results) => {
|
|
247
261
|
allurePlugin.onAfterSpec(spec, results);
|
|
248
262
|
|
|
@@ -10,13 +10,25 @@ var _steps = require("../steps.js");
|
|
|
10
10
|
var _utils = require("../utils.js");
|
|
11
11
|
var registerCypressEventListeners = () => Cypress.on("fail", onFail).on("log:added", onLogAdded);
|
|
12
12
|
exports.registerCypressEventListeners = registerCypressEventListeners;
|
|
13
|
-
var enableReportingOfCypressScreenshots = () =>
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
var enableReportingOfCypressScreenshots = () => {
|
|
14
|
+
// Observe the dispatcher, so later defaults() calls cannot replace Allure's reporting.
|
|
15
|
+
var screenshot = Cypress.Screenshot;
|
|
16
|
+
var original = screenshot.onAfterScreenshot;
|
|
17
|
+
screenshot.onAfterScreenshot = function () {
|
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
+
args[_key] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return original.apply(this, args);
|
|
23
|
+
} finally {
|
|
24
|
+
onAfterScreenshot(...args);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
16
28
|
exports.enableReportingOfCypressScreenshots = enableReportingOfCypressScreenshots;
|
|
17
29
|
var onAfterScreenshot = function onAfterScreenshot() {
|
|
18
|
-
for (var
|
|
19
|
-
_ref[
|
|
30
|
+
for (var _len2 = arguments.length, _ref = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
31
|
+
_ref[_key2] = arguments[_key2];
|
|
20
32
|
}
|
|
21
33
|
var [, {
|
|
22
34
|
name: originalName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.js","names":["_commandLog","require","_lifecycle","_steps","_utils","registerCypressEventListeners","Cypress","on","onFail","onLogAdded","exports","enableReportingOfCypressScreenshots","Screenshot","
|
|
1
|
+
{"version":3,"file":"cypress.js","names":["_commandLog","require","_lifecycle","_steps","_utils","registerCypressEventListeners","Cypress","on","onFail","onLogAdded","exports","enableReportingOfCypressScreenshots","screenshot","Screenshot","original","onAfterScreenshot","_len","arguments","length","args","Array","_key","apply","_len2","_ref","_key2","name","originalName","path","getFileNameFromPath","reportScreenshot","setupScreenshotAttachmentStep","_","entry","shouldCreateStepFromCommandLogEntry","startCommandLogStep","error","reportStepError","noSubsequentFailListeners","Object","is","listeners","at"],"sources":["../../../../src/browser/events/cypress.ts"],"sourcesContent":["import type { CypressLogEntry } from \"../../types.js\";\nimport {\n setupScreenshotAttachmentStep,\n shouldCreateStepFromCommandLogEntry,\n startCommandLogStep,\n} from \"../commandLog.js\";\nimport { reportScreenshot } from \"../lifecycle.js\";\nimport { reportStepError } from \"../steps.js\";\nimport { getFileNameFromPath } from \"../utils.js\";\n\nexport const registerCypressEventListeners = () => Cypress.on(\"fail\", onFail).on(\"log:added\", onLogAdded);\n\nexport const enableReportingOfCypressScreenshots = () => {\n // Observe the dispatcher, so later defaults() calls cannot replace Allure's reporting.\n const screenshot = Cypress.Screenshot as unknown as {\n onAfterScreenshot: Cypress.ScreenshotDefaultsOptions[\"onAfterScreenshot\"];\n };\n const original = screenshot.onAfterScreenshot;\n screenshot.onAfterScreenshot = function (...args) {\n try {\n return original.apply(this, args);\n } finally {\n onAfterScreenshot(...args);\n }\n };\n};\n\nconst onAfterScreenshot = (\n ...[, { name: originalName, path }]: Parameters<Cypress.ScreenshotDefaultsOptions[\"onAfterScreenshot\"]>\n) => {\n const name = originalName ?? getFileNameFromPath(path);\n\n reportScreenshot(path, name);\n setupScreenshotAttachmentStep(originalName, name);\n};\n\nconst onLogAdded = (_: Cypress.ObjectLike, entry: CypressLogEntry) => {\n if (shouldCreateStepFromCommandLogEntry(entry)) {\n startCommandLogStep(entry);\n }\n};\n\nconst onFail = (error: Cypress.CypressError) => {\n reportStepError(error);\n\n // If there are more \"fail\" handlers yet to run, it's not our responsibility to throw.\n // Otherwise, we won't give them any chance to do their job (EventEmitter stops executing handlers as soon\n // as one of them throws - that is also true for eventemitter2, which is used by the browser-side of Cypress).\n if (noSubsequentFailListeners()) {\n throw error;\n }\n};\n\nconst noSubsequentFailListeners = () => Object.is(Cypress.listeners(\"fail\").at(-1), onFail);\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,IAAMI,6BAA6B,GAAGA,CAAA,KAAMC,OAAO,CAACC,EAAE,CAAC,MAAM,EAAEC,MAAM,CAAC,CAACD,EAAE,CAAC,WAAW,EAAEE,UAAU,CAAC;AAACC,OAAA,CAAAL,6BAAA,GAAAA,6BAAA;AAEnG,IAAMM,mCAAmC,GAAGA,CAAA,KAAM;EACvD;EACA,IAAMC,UAAU,GAAGN,OAAO,CAACO,UAE1B;EACD,IAAMC,QAAQ,GAAGF,UAAU,CAACG,iBAAiB;EAC7CH,UAAU,CAACG,iBAAiB,GAAG,YAAmB;IAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAANC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAC9C,IAAI;MACF,OAAOP,QAAQ,CAACQ,KAAK,CAAC,IAAI,EAAEH,IAAI,CAAC;IACnC,CAAC,SAAS;MACRJ,iBAAiB,CAAC,GAAGI,IAAI,CAAC;IAC5B;EACF,CAAC;AACH,CAAC;AAACT,OAAA,CAAAC,mCAAA,GAAAA,mCAAA;AAEF,IAAMI,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAA,EAElB;EAAA,SAAAQ,KAAA,GAAAN,SAAA,CAAAC,MAAA,EAAAM,IAAA,OAAAJ,KAAA,CAAAG,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAAAD,IAAA,CAAAC,KAAA,IAAAR,SAAA,CAAAQ,KAAA;EAAA;EAAA,IADA,GAAG;IAAEC,IAAI,EAAEC,YAAY;IAAEC;EAAK,CAAC,CAAC,GAAAJ,IAAA;EAEnC,IAAME,IAAI,GAAGC,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAAE,0BAAmB,EAACD,IAAI,CAAC;EAEtD,IAAAE,2BAAgB,EAACF,IAAI,EAAEF,IAAI,CAAC;EAC5B,IAAAK,yCAA6B,EAACJ,YAAY,EAAED,IAAI,CAAC;AACnD,CAAC;AAED,IAAMjB,UAAU,GAAGA,CAACuB,CAAqB,EAAEC,KAAsB,KAAK;EACpE,IAAI,IAAAC,+CAAmC,EAACD,KAAK,CAAC,EAAE;IAC9C,IAAAE,+BAAmB,EAACF,KAAK,CAAC;EAC5B;AACF,CAAC;AAED,IAAMzB,MAAM,GAAI4B,KAA2B,IAAK;EAC9C,IAAAC,sBAAe,EAACD,KAAK,CAAC;;EAEtB;EACA;EACA;EACA,IAAIE,yBAAyB,CAAC,CAAC,EAAE;IAC/B,MAAMF,KAAK;EACb;AACF,CAAC;AAED,IAAME,yBAAyB,GAAGA,CAAA,KAAMC,MAAM,CAACC,EAAE,CAAClC,OAAO,CAACmC,SAAS,CAAC,MAAM,CAAC,CAACC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAElC,MAAM,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,11 @@ exports.throwAfterSpecCompletion = exports.reportTestStart = exports.reportTestS
|
|
|
7
7
|
var _allureJsCommons = require("allure-js-commons");
|
|
8
8
|
var _sdk = require("allure-js-commons/sdk");
|
|
9
9
|
var _runtime = require("./runtime.js");
|
|
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 }; }
|
|
13
15
|
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
16
|
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
17
|
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; }
|
|
@@ -103,7 +105,7 @@ var reportTestPass = () => {
|
|
|
103
105
|
exports.reportTestPass = reportTestPass;
|
|
104
106
|
var reportTestOrHookFail = err => {
|
|
105
107
|
var status = (0, _sdk.getStatusFromError)(err);
|
|
106
|
-
var statusDetails = (0, _sdk.getMessageAndTraceFromError)(err);
|
|
108
|
+
var statusDetails = (0, _sdk.getMessageAndTraceFromError)(err, _serialize.default);
|
|
107
109
|
(0, _steps.stopAllSteps)(status, statusDetails);
|
|
108
110
|
(0, _state.enqueueRuntimeMessage)({
|
|
109
111
|
type: "cypress_fail",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.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","reportRunStart","enqueueRuntimeMessage","type","data","exports","reportSuiteStart","suite","id","name","title","root","start","Date","now","reportSuiteEnd","stop","reportHookStart","hook","scopeType","hookName","includes","position","reportHookEnd","_hook$duration","finalizeSteps","duration","reportTestStart","test","setCurrentTest","getTestStartData","markTestAsReported","reportStepStart","reportStepStop","step","status","statusDetails","getStepStopData","reportTestPass","reportTestOrHookFail","err","getStatusFromError","getMessageAndTraceFromError","stopAllSteps","completeHookErrorReporting","isEachHook","parent","testFailData","getStatusDataOfTestSkippedByHookError","reportCurrentTestIfAny","reportRemainingTests","reportTestSkip","isTestReported","getCurrentTest","Status","SKIPPED","message","getTestSkipData","reportTestEnd","_test$duration","_retries","retries","dropCurrentTest","reportScreenshot","path","contentType","ContentType","PNG","completeSpecIfNoAfterHookLeft","context","isLastRootAfterHook","isAllureHook","completeSpecAsync","completeSpecOnAfterHookFailure","hookError","allureError","logAllureRootAfterError","throwAfterSpecCompletion","_completeSpecOnAfterH","chain","then","flushRuntimeMessages","getTestRuntime","flushAllureMessagesToTask","flushAllureMessagesToTaskAsync","currentTest","iterateTests","reportTestsSkippedByHookError","pending","getTestStopData","suites","getSuitePath","map","s","_context$test$title","_context$test","console","error","concat","_unused"],"sources":["../../../src/browser/lifecycle.ts"],"sourcesContent":["import { ContentType, Status } from \"allure-js-commons\";\nimport type { StatusDetails } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\n\nimport type { CypressFailMessage, CypressHook, CypressSuite, CypressTest, StepDescriptor } from \"../types.js\";\nimport { getTestRuntime } from \"./runtime.js\";\nimport { dropCurrentTest, enqueueRuntimeMessage, getCurrentTest, setCurrentTest } from \"./state.js\";\nimport { finalizeSteps, stopAllSteps } from \"./steps.js\";\nimport {\n getStatusDataOfTestSkippedByHookError,\n getStepStopData,\n getSuitePath,\n getTestSkipData,\n getTestStartData,\n getTestStopData,\n isAllureHook,\n isLastRootAfterHook,\n isTestReported,\n iterateTests,\n markTestAsReported,\n} from \"./utils.js\";\n\nexport const reportRunStart = () => {\n enqueueRuntimeMessage({\n type: \"cypress_run_start\",\n data: {},\n });\n};\n\nexport const reportSuiteStart = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_start\",\n data: {\n id: suite.id,\n name: suite.title,\n root: suite.root,\n start: Date.now(),\n },\n });\n};\n\nexport const reportSuiteEnd = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_end\",\n data: {\n root: suite.root,\n stop: Date.now(),\n },\n });\n};\n\nexport const reportHookStart = (hook: CypressHook, start?: number) => {\n enqueueRuntimeMessage({\n type: \"cypress_hook_start\",\n data: {\n name: hook.title,\n scopeType: hook.hookName.includes(\"each\") ? \"each\" : \"all\",\n position: hook.hookName.includes(\"before\") ? \"before\" : \"after\",\n start: start ?? Date.now(),\n },\n });\n};\n\nexport const reportHookEnd = (hook: CypressHook) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_hook_end\",\n data: {\n duration: hook.duration ?? 0,\n },\n });\n};\n\nexport const reportTestStart = (test: CypressTest) => {\n setCurrentTest(test);\n enqueueRuntimeMessage({\n type: \"cypress_test_start\",\n data: getTestStartData(test),\n });\n markTestAsReported(test);\n};\n\nexport const reportStepStart = (id: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_start\",\n data: {\n id,\n name,\n start: Date.now(),\n },\n });\n};\n\nexport const reportStepStop = (step: StepDescriptor, status?: Status, statusDetails?: StatusDetails) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_stop\",\n data: getStepStopData(step, status, statusDetails),\n });\n};\n\nexport const reportTestPass = () => {\n enqueueRuntimeMessage({\n type: \"cypress_test_pass\",\n data: {},\n });\n};\n\nexport const reportTestOrHookFail = (err: Error) => {\n const status = getStatusFromError(err);\n const statusDetails = getMessageAndTraceFromError(err);\n\n stopAllSteps(status, statusDetails);\n\n enqueueRuntimeMessage({\n type: \"cypress_fail\",\n data: {\n status,\n statusDetails,\n },\n });\n};\n\nexport const completeHookErrorReporting = (hook: CypressHook, err: Error) => {\n const isEachHook = hook.hookName.includes(\"each\");\n const suite = hook.parent!;\n const testFailData = getStatusDataOfTestSkippedByHookError(hook.title, isEachHook, err, suite);\n\n // Cypress doens't emit 'hook end' if the hook has failed.\n reportHookEnd(hook);\n\n // Cypress doens't emit 'test end' if the hook has failed.\n // We must report the test's end manualy in case of a 'before each' hook.\n reportCurrentTestIfAny();\n\n // Cypress skips the remaining tests in the suite of a failed hook.\n // We should include them to the report manually.\n reportRemainingTests(suite, testFailData);\n};\n\nexport const reportTestSkip = (test: CypressTest) => {\n if (isTestReported(test)) {\n // Ignore pending events for retry attempts that already ended.\n if (getCurrentTest() !== test) {\n return;\n }\n\n stopAllSteps(Status.SKIPPED, {\n message: \"The test was skipped before the command was completed\",\n });\n } else {\n reportTestStart(test);\n }\n\n enqueueRuntimeMessage({\n type: \"cypress_test_skip\",\n data: getTestSkipData(),\n });\n};\n\nexport const reportTestEnd = (test: CypressTest) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_test_end\",\n data: {\n duration: test.duration ?? 0,\n retries: (test as any)._retries ?? 0,\n },\n });\n dropCurrentTest();\n};\n\nexport const reportScreenshot = (path: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"attachment_path\",\n data: { path, name, contentType: ContentType.PNG },\n });\n};\n\nexport const completeSpecIfNoAfterHookLeft = (context: Mocha.Context) => {\n if (isLastRootAfterHook(context)) {\n const hook = context.test as CypressHook;\n if (!isAllureHook(hook)) {\n reportHookEnd(hook);\n }\n return completeSpecAsync();\n }\n};\n\nexport const completeSpecOnAfterHookFailure = (\n context: Mocha.Context,\n hookError: Error,\n): Cypress.Chainable<unknown> | undefined => {\n try {\n reportTestOrHookFail(hookError);\n completeHookErrorReporting(context.test as CypressHook, hookError);\n\n // cy.task's then doesn't have onrejected, that's why we don't log async Allure errors here.\n return completeSpecAsync();\n } catch (allureError) {\n logAllureRootAfterError(context, allureError);\n }\n};\n\nexport const throwAfterSpecCompletion = (context: Mocha.Context, err: any) => {\n const chain = completeSpecOnAfterHookFailure(context, err as Error)?.then(() => {\n throw err;\n });\n if (!chain) {\n throw err;\n }\n};\n\nexport const flushRuntimeMessages = () => getTestRuntime().flushAllureMessagesToTask(\"reportAllureCypressSpecMessages\");\n\nexport const completeSpecAsync = () =>\n getTestRuntime().flushAllureMessagesToTaskAsync(\"reportFinalAllureCypressSpecMessages\");\n\nconst reportCurrentTestIfAny = () => {\n const currentTest = getCurrentTest();\n if (currentTest) {\n reportTestEnd(currentTest);\n }\n};\n\nconst reportRemainingTests = (suite: CypressSuite, testFailData: CypressFailMessage[\"data\"]) => {\n for (const test of iterateTests(suite)) {\n // Some tests in the suite might've been already reported.\n if (!isTestReported(test)) {\n reportTestsSkippedByHookError(\n test,\n test.pending ? { ...getTestSkipData(), status: Status.SKIPPED } : testFailData,\n );\n }\n }\n};\n\nconst reportTestsSkippedByHookError = (test: CypressTest, testFailData: CypressFailMessage[\"data\"]) => {\n enqueueRuntimeMessage({\n type: \"cypress_skipped_test\",\n data: {\n ...getTestStartData(test),\n ...testFailData,\n ...getTestStopData(test),\n suites: getSuitePath(test).map((s) => s.id),\n },\n });\n markTestAsReported(test);\n};\n\nconst logAllureRootAfterError = (context: Mocha.Context, err: unknown) => {\n // We play safe and swallow errors here to keep the original 'after all' error.\n try {\n // eslint-disable-next-line no-console\n console.error(`Unexpected error when reporting the failure of ${context.test?.title ?? \"'after all'\"}`);\n // eslint-disable-next-line no-console\n console.error(err);\n } catch {}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAGA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAYoB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AAE,sBAAsB;IAC5BC,IAAI,EAAAvB,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,KACC,IAAAiD,uBAAgB,EAACF,IAAI,CAAC,GACtBmB,YAAY,GACZ,IAAA0C,sBAAe,EAAC7D,IAAI,CAAC;MACxB8D,MAAM,EAAE,IAAAC,mBAAY,EAAC/D,IAAI,CAAC,CAACgE,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACrF,EAAE;IAAC;EAE/C,CAAC,CAAC;EACF,IAAAuB,yBAAkB,EAACH,IAAI,CAAC;AAC1B,CAAC;AAED,IAAMgD,uBAAuB,GAAGA,CAACP,OAAsB,EAAE7B,GAAY,KAAK;EACxE;EACA,IAAI;IAAA,IAAAsD,mBAAA,EAAAC,aAAA;IACF;IACAC,OAAO,CAACC,KAAK,mDAAAC,MAAA,EAAAJ,mBAAA,IAAAC,aAAA,GAAmD1B,OAAO,CAACzC,IAAI,cAAAmE,aAAA,uBAAZA,aAAA,CAAcrF,KAAK,cAAAoF,mBAAA,cAAAA,mBAAA,GAAI,aAAa,CAAE,CAAC;IACvG;IACAE,OAAO,CAACC,KAAK,CAACzD,GAAG,CAAC;EACpB,CAAC,CAAC,OAAA2D,OAAA,EAAM,CAAC;AACX,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"lifecycle.js","names":["_allureJsCommons","require","_sdk","_runtime","_serialize","_interopRequireDefault","_state","_steps","_utils","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","reportRunStart","enqueueRuntimeMessage","type","data","exports","reportSuiteStart","suite","id","name","title","root","start","Date","now","reportSuiteEnd","stop","reportHookStart","hook","scopeType","hookName","includes","position","reportHookEnd","_hook$duration","finalizeSteps","duration","reportTestStart","test","setCurrentTest","getTestStartData","markTestAsReported","reportStepStart","reportStepStop","step","status","statusDetails","getStepStopData","reportTestPass","reportTestOrHookFail","err","getStatusFromError","getMessageAndTraceFromError","serializeValue","stopAllSteps","completeHookErrorReporting","isEachHook","parent","testFailData","getStatusDataOfTestSkippedByHookError","reportCurrentTestIfAny","reportRemainingTests","reportTestSkip","isTestReported","getCurrentTest","Status","SKIPPED","message","getTestSkipData","reportTestEnd","_test$duration","_retries","retries","dropCurrentTest","reportScreenshot","path","contentType","ContentType","PNG","completeSpecIfNoAfterHookLeft","context","isLastRootAfterHook","isAllureHook","completeSpecAsync","completeSpecOnAfterHookFailure","hookError","allureError","logAllureRootAfterError","throwAfterSpecCompletion","_completeSpecOnAfterH","chain","then","flushRuntimeMessages","getTestRuntime","flushAllureMessagesToTask","flushAllureMessagesToTaskAsync","currentTest","iterateTests","reportTestsSkippedByHookError","pending","getTestStopData","suites","getSuitePath","map","s","_context$test$title","_context$test","console","error","concat","_unused"],"sources":["../../../src/browser/lifecycle.ts"],"sourcesContent":["import { ContentType, Status } from \"allure-js-commons\";\nimport type { StatusDetails } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError } from \"allure-js-commons/sdk\";\n\nimport type { CypressFailMessage, CypressHook, CypressSuite, CypressTest, StepDescriptor } from \"../types.js\";\nimport { getTestRuntime } from \"./runtime.js\";\nimport serializeValue from \"./serialize.js\";\nimport { dropCurrentTest, enqueueRuntimeMessage, getCurrentTest, setCurrentTest } from \"./state.js\";\nimport { finalizeSteps, stopAllSteps } from \"./steps.js\";\nimport {\n getStatusDataOfTestSkippedByHookError,\n getStepStopData,\n getSuitePath,\n getTestSkipData,\n getTestStartData,\n getTestStopData,\n isAllureHook,\n isLastRootAfterHook,\n isTestReported,\n iterateTests,\n markTestAsReported,\n} from \"./utils.js\";\n\nexport const reportRunStart = () => {\n enqueueRuntimeMessage({\n type: \"cypress_run_start\",\n data: {},\n });\n};\n\nexport const reportSuiteStart = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_start\",\n data: {\n id: suite.id,\n name: suite.title,\n root: suite.root,\n start: Date.now(),\n },\n });\n};\n\nexport const reportSuiteEnd = (suite: CypressSuite) => {\n enqueueRuntimeMessage({\n type: \"cypress_suite_end\",\n data: {\n root: suite.root,\n stop: Date.now(),\n },\n });\n};\n\nexport const reportHookStart = (hook: CypressHook, start?: number) => {\n enqueueRuntimeMessage({\n type: \"cypress_hook_start\",\n data: {\n name: hook.title,\n scopeType: hook.hookName.includes(\"each\") ? \"each\" : \"all\",\n position: hook.hookName.includes(\"before\") ? \"before\" : \"after\",\n start: start ?? Date.now(),\n },\n });\n};\n\nexport const reportHookEnd = (hook: CypressHook) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_hook_end\",\n data: {\n duration: hook.duration ?? 0,\n },\n });\n};\n\nexport const reportTestStart = (test: CypressTest) => {\n setCurrentTest(test);\n enqueueRuntimeMessage({\n type: \"cypress_test_start\",\n data: getTestStartData(test),\n });\n markTestAsReported(test);\n};\n\nexport const reportStepStart = (id: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_start\",\n data: {\n id,\n name,\n start: Date.now(),\n },\n });\n};\n\nexport const reportStepStop = (step: StepDescriptor, status?: Status, statusDetails?: StatusDetails) => {\n enqueueRuntimeMessage({\n type: \"cypress_step_stop\",\n data: getStepStopData(step, status, statusDetails),\n });\n};\n\nexport const reportTestPass = () => {\n enqueueRuntimeMessage({\n type: \"cypress_test_pass\",\n data: {},\n });\n};\n\nexport const reportTestOrHookFail = (err: Error) => {\n const status = getStatusFromError(err);\n const statusDetails = getMessageAndTraceFromError(err, serializeValue);\n\n stopAllSteps(status, statusDetails);\n\n enqueueRuntimeMessage({\n type: \"cypress_fail\",\n data: {\n status,\n statusDetails,\n },\n });\n};\n\nexport const completeHookErrorReporting = (hook: CypressHook, err: Error) => {\n const isEachHook = hook.hookName.includes(\"each\");\n const suite = hook.parent!;\n const testFailData = getStatusDataOfTestSkippedByHookError(hook.title, isEachHook, err, suite);\n\n // Cypress doens't emit 'hook end' if the hook has failed.\n reportHookEnd(hook);\n\n // Cypress doens't emit 'test end' if the hook has failed.\n // We must report the test's end manualy in case of a 'before each' hook.\n reportCurrentTestIfAny();\n\n // Cypress skips the remaining tests in the suite of a failed hook.\n // We should include them to the report manually.\n reportRemainingTests(suite, testFailData);\n};\n\nexport const reportTestSkip = (test: CypressTest) => {\n if (isTestReported(test)) {\n // Ignore pending events for retry attempts that already ended.\n if (getCurrentTest() !== test) {\n return;\n }\n\n stopAllSteps(Status.SKIPPED, {\n message: \"The test was skipped before the command was completed\",\n });\n } else {\n reportTestStart(test);\n }\n\n enqueueRuntimeMessage({\n type: \"cypress_test_skip\",\n data: getTestSkipData(),\n });\n};\n\nexport const reportTestEnd = (test: CypressTest) => {\n finalizeSteps();\n enqueueRuntimeMessage({\n type: \"cypress_test_end\",\n data: {\n duration: test.duration ?? 0,\n retries: (test as any)._retries ?? 0,\n },\n });\n dropCurrentTest();\n};\n\nexport const reportScreenshot = (path: string, name: string) => {\n enqueueRuntimeMessage({\n type: \"attachment_path\",\n data: { path, name, contentType: ContentType.PNG },\n });\n};\n\nexport const completeSpecIfNoAfterHookLeft = (context: Mocha.Context) => {\n if (isLastRootAfterHook(context)) {\n const hook = context.test as CypressHook;\n if (!isAllureHook(hook)) {\n reportHookEnd(hook);\n }\n return completeSpecAsync();\n }\n};\n\nexport const completeSpecOnAfterHookFailure = (\n context: Mocha.Context,\n hookError: Error,\n): Cypress.Chainable<unknown> | undefined => {\n try {\n reportTestOrHookFail(hookError);\n completeHookErrorReporting(context.test as CypressHook, hookError);\n\n // cy.task's then doesn't have onrejected, that's why we don't log async Allure errors here.\n return completeSpecAsync();\n } catch (allureError) {\n logAllureRootAfterError(context, allureError);\n }\n};\n\nexport const throwAfterSpecCompletion = (context: Mocha.Context, err: any) => {\n const chain = completeSpecOnAfterHookFailure(context, err as Error)?.then(() => {\n throw err;\n });\n if (!chain) {\n throw err;\n }\n};\n\nexport const flushRuntimeMessages = () => getTestRuntime().flushAllureMessagesToTask(\"reportAllureCypressSpecMessages\");\n\nexport const completeSpecAsync = () =>\n getTestRuntime().flushAllureMessagesToTaskAsync(\"reportFinalAllureCypressSpecMessages\");\n\nconst reportCurrentTestIfAny = () => {\n const currentTest = getCurrentTest();\n if (currentTest) {\n reportTestEnd(currentTest);\n }\n};\n\nconst reportRemainingTests = (suite: CypressSuite, testFailData: CypressFailMessage[\"data\"]) => {\n for (const test of iterateTests(suite)) {\n // Some tests in the suite might've been already reported.\n if (!isTestReported(test)) {\n reportTestsSkippedByHookError(\n test,\n test.pending ? { ...getTestSkipData(), status: Status.SKIPPED } : testFailData,\n );\n }\n }\n};\n\nconst reportTestsSkippedByHookError = (test: CypressTest, testFailData: CypressFailMessage[\"data\"]) => {\n enqueueRuntimeMessage({\n type: \"cypress_skipped_test\",\n data: {\n ...getTestStartData(test),\n ...testFailData,\n ...getTestStopData(test),\n suites: getSuitePath(test).map((s) => s.id),\n },\n });\n markTestAsReported(test);\n};\n\nconst logAllureRootAfterError = (context: Mocha.Context, err: unknown) => {\n // We play safe and swallow errors here to keep the original 'after all' error.\n try {\n // eslint-disable-next-line no-console\n console.error(`Unexpected error when reporting the failure of ${context.test?.title ?? \"'after all'\"}`);\n // eslint-disable-next-line no-console\n console.error(err);\n } catch {}\n};\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAGA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAYoB,SAAAI,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA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pBC,IAAI,EAAE,sBAAsB;IAC5BC,IAAI,EAAAvB,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,KACC,IAAAiD,uBAAgB,EAACF,IAAI,CAAC,GACtBoB,YAAY,GACZ,IAAA0C,sBAAe,EAAC9D,IAAI,CAAC;MACxB+D,MAAM,EAAE,IAAAC,mBAAY,EAAChE,IAAI,CAAC,CAACiE,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACtF,EAAE;IAAC;EAE/C,CAAC,CAAC;EACF,IAAAuB,yBAAkB,EAACH,IAAI,CAAC;AAC1B,CAAC;AAED,IAAMiD,uBAAuB,GAAGA,CAACP,OAAsB,EAAE9B,GAAY,KAAK;EACxE;EACA,IAAI;IAAA,IAAAuD,mBAAA,EAAAC,aAAA;IACF;IACAC,OAAO,CAACC,KAAK,mDAAAC,MAAA,EAAAJ,mBAAA,IAAAC,aAAA,GAAmD1B,OAAO,CAAC1C,IAAI,cAAAoE,aAAA,uBAAZA,aAAA,CAActF,KAAK,cAAAqF,mBAAA,cAAAA,mBAAA,GAAI,aAAa,CAAE,CAAC;IACvG;IACAE,OAAO,CAACC,KAAK,CAAC1D,GAAG,CAAC;EACpB,CAAC,CAAC,OAAA4D,OAAA,EAAM,CAAC;AACX,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,11 @@ 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 }; }
|
|
13
15
|
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
16
|
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
17
|
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 +83,38 @@ class AllureCypressTestRuntime {
|
|
|
81
83
|
}
|
|
82
84
|
});
|
|
83
85
|
}
|
|
86
|
+
precondition(markdown) {
|
|
87
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
88
|
+
type: "metadata",
|
|
89
|
+
data: {
|
|
90
|
+
precondition: markdown
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
preconditionHtml(html) {
|
|
95
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
96
|
+
type: "metadata",
|
|
97
|
+
data: {
|
|
98
|
+
preconditionHtml: html
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
expectedResult(markdown) {
|
|
103
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
104
|
+
type: "metadata",
|
|
105
|
+
data: {
|
|
106
|
+
expectedResult: markdown
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
expectedResultHtml(html) {
|
|
111
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
112
|
+
type: "metadata",
|
|
113
|
+
data: {
|
|
114
|
+
expectedResultHtml: html
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
84
118
|
displayName(name) {
|
|
85
119
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
86
120
|
type: "metadata",
|
|
@@ -153,10 +187,19 @@ class AllureCypressTestRuntime {
|
|
|
153
187
|
}
|
|
154
188
|
});
|
|
155
189
|
}
|
|
156
|
-
globalError(
|
|
190
|
+
globalError() {
|
|
157
191
|
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
158
192
|
type: "global_error",
|
|
159
|
-
data:
|
|
193
|
+
data: (0, _sdk.getGlobalErrorDetails)(...arguments)
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
metrics() {
|
|
197
|
+
for (var _len3 = arguments.length, results = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
198
|
+
results[_key3] = arguments[_key3];
|
|
199
|
+
}
|
|
200
|
+
return _assertClassBrand(_AllureCypressTestRuntime_brand, this, _enqueueMessageAsync).call(this, {
|
|
201
|
+
type: "metric_result",
|
|
202
|
+
data: results
|
|
160
203
|
});
|
|
161
204
|
}
|
|
162
205
|
logStep(name) {
|
|
@@ -164,7 +207,7 @@ class AllureCypressTestRuntime {
|
|
|
164
207
|
var error = arguments.length > 2 ? arguments[2] : undefined;
|
|
165
208
|
if (_assertClassBrand(_AllureCypressTestRuntime_brand, this, _isInOriginContext).call(this)) {
|
|
166
209
|
(0, _steps.startAllureApiStep)(name);
|
|
167
|
-
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error) : undefined);
|
|
210
|
+
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default) : undefined);
|
|
168
211
|
return Cypress.Promise.resolve();
|
|
169
212
|
}
|
|
170
213
|
return cy.wrap(_steps.ALLURE_STEP_CMD_SUBJECT, {
|
|
@@ -173,7 +216,7 @@ class AllureCypressTestRuntime {
|
|
|
173
216
|
(0, _steps.startAllureApiStep)(name);
|
|
174
217
|
return Cypress.Promise.resolve();
|
|
175
218
|
}).then(() => {
|
|
176
|
-
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error) : undefined);
|
|
219
|
+
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default) : undefined);
|
|
177
220
|
return Cypress.Promise.resolve();
|
|
178
221
|
});
|
|
179
222
|
}
|
|
@@ -301,8 +344,8 @@ function _isInOriginContext() {
|
|
|
301
344
|
function _createSyncRuntime() {
|
|
302
345
|
return {
|
|
303
346
|
labels: function labels() {
|
|
304
|
-
for (var
|
|
305
|
-
_labels[
|
|
347
|
+
for (var _len4 = arguments.length, _labels = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
348
|
+
_labels[_key4] = arguments[_key4];
|
|
306
349
|
}
|
|
307
350
|
return (0, _state.enqueueRuntimeMessage)({
|
|
308
351
|
type: "metadata",
|
|
@@ -312,8 +355,8 @@ function _createSyncRuntime() {
|
|
|
312
355
|
});
|
|
313
356
|
},
|
|
314
357
|
links: function links() {
|
|
315
|
-
for (var
|
|
316
|
-
_links[
|
|
358
|
+
for (var _len5 = arguments.length, _links = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
359
|
+
_links[_key5] = arguments[_key5];
|
|
317
360
|
}
|
|
318
361
|
return (0, _state.enqueueRuntimeMessage)({
|
|
319
362
|
type: "metadata",
|
|
@@ -343,6 +386,30 @@ function _createSyncRuntime() {
|
|
|
343
386
|
descriptionHtml: html
|
|
344
387
|
}
|
|
345
388
|
}),
|
|
389
|
+
precondition: markdown => (0, _state.enqueueRuntimeMessage)({
|
|
390
|
+
type: "metadata",
|
|
391
|
+
data: {
|
|
392
|
+
precondition: markdown
|
|
393
|
+
}
|
|
394
|
+
}),
|
|
395
|
+
preconditionHtml: html => (0, _state.enqueueRuntimeMessage)({
|
|
396
|
+
type: "metadata",
|
|
397
|
+
data: {
|
|
398
|
+
preconditionHtml: html
|
|
399
|
+
}
|
|
400
|
+
}),
|
|
401
|
+
expectedResult: markdown => (0, _state.enqueueRuntimeMessage)({
|
|
402
|
+
type: "metadata",
|
|
403
|
+
data: {
|
|
404
|
+
expectedResult: markdown
|
|
405
|
+
}
|
|
406
|
+
}),
|
|
407
|
+
expectedResultHtml: html => (0, _state.enqueueRuntimeMessage)({
|
|
408
|
+
type: "metadata",
|
|
409
|
+
data: {
|
|
410
|
+
expectedResultHtml: html
|
|
411
|
+
}
|
|
412
|
+
}),
|
|
346
413
|
displayName: name => (0, _state.enqueueRuntimeMessage)({
|
|
347
414
|
type: "metadata",
|
|
348
415
|
data: {
|
|
@@ -405,15 +472,17 @@ function _createSyncRuntime() {
|
|
|
405
472
|
fileExtension: options.fileExtension
|
|
406
473
|
}
|
|
407
474
|
}),
|
|
408
|
-
globalError:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
475
|
+
globalError: function globalError() {
|
|
476
|
+
return (0, _state.enqueueRuntimeMessage)({
|
|
477
|
+
type: "global_error",
|
|
478
|
+
data: (0, _sdk.getGlobalErrorDetails)(...arguments)
|
|
479
|
+
});
|
|
480
|
+
},
|
|
412
481
|
logStep: function logStep(name) {
|
|
413
482
|
var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _allureJsCommons.Status.PASSED;
|
|
414
483
|
var error = arguments.length > 2 ? arguments[2] : undefined;
|
|
415
484
|
(0, _steps.startAllureApiStep)(name);
|
|
416
|
-
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error) : undefined);
|
|
485
|
+
(0, _steps.stopCurrentAllureApiStep)(status, error ? (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default) : undefined);
|
|
417
486
|
},
|
|
418
487
|
step: (name, body) => {
|
|
419
488
|
(0, _steps.startAllureApiStep)(name);
|
|
@@ -428,7 +497,7 @@ function _createSyncRuntime() {
|
|
|
428
497
|
return result;
|
|
429
498
|
} catch (err) {
|
|
430
499
|
var error = err;
|
|
431
|
-
(0, _steps.stopCurrentAllureApiStep)((0, _sdk.getStatusFromError)(error), (0, _sdk.getMessageAndTraceFromError)(error));
|
|
500
|
+
(0, _steps.stopCurrentAllureApiStep)((0, _sdk.getStatusFromError)(error), (0, _sdk.getMessageAndTraceFromError)(error, _serialize.default));
|
|
432
501
|
throw err;
|
|
433
502
|
}
|
|
434
503
|
},
|
|
@@ -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","details","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","_len3","_key3","_len4","_key4","isPromise","console","warn","Error","err","getStatusFromError"],"sources":["../../../src/browser/runtime.ts"],"sourcesContent":["import type { AttachmentOptions, Label, Link, ParameterMode, ParameterOptions, StatusDetails } from \"allure-js-commons\";\nimport { Status } from \"allure-js-commons\";\nimport { getMessageAndTraceFromError, getStatusFromError, isPromise } 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(details: StatusDetails) {\n return this.#enqueueMessageAsync({\n type: \"global_error\",\n data: details,\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: (details) =>\n enqueueRuntimeMessage({\n type: \"global_error\",\n data: details,\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":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEA,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,KA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ACF,CAAC,CAAC;IACJ8C,aAAa,EAAEA,CAAC9C,IAAI,EAAE1C,KAAK,EAAEyF,IAAI,KAC/B,IAAAe,4BAAqB,EAAC;MACpBpE,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACJO,UAAU,EAAE,CAAC;UAAEF,IAAI;UAAE1C,KAAK;UAAEyF;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","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","_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","precondition","preconditionHtml","expectedResult","expectedResultHtml","displayName","historyId","testCaseId","attachment","content","attachmentContent","actualEncoding","_buildAttachmentContent","encoding","contentType","fileExtension","attachmentFromPath","path","globalAttachment","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","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 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,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAD,OAAA,CAAAG,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAA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,CAAC,EAAE;UACrB;UACA+C,OAAO,CAACC,IAAI,CAAC7H,6BAA6B,CAAC;UAC3C,MAAM,IAAI8H,KAAK,CAAC9H,6BAA6B,CAAC;QAChD;QAEA,IAAAgE,+BAAwB,EAAC,CAAC;QAE1B,OAAOa,MAAM;MACf,CAAC,CAAC,OAAOkD,GAAG,EAAE;QACZ,IAAMlE,KAAK,GAAGkE,GAAY;QAE1B,IAAA/D,+BAAwB,EAAC,IAAAgE,uBAAkB,EAACnE,KAAK,CAAC,EAAE,IAAAI,gCAA2B,EAACJ,KAAK,EAAEK,kBAAc,CAAC,CAAC;QACvG,MAAM6D,GAAG;MACX;IACF,CAAC;IACDjD,eAAe,EAAGtD,IAAI,IACpB,IAAAuE,4BAAqB,EAAC;MACpB7E,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACJK;MACF;IACF,CAAC,CAAC;IACJuD,aAAa,EAAEA,CAACvD,IAAI,EAAE1C,KAAK,EAAEkG,IAAI,KAC/B,IAAAe,4BAAqB,EAAC;MACpB7E,IAAI,EAAE,eAAe;MACrBC,IAAI,EAAE;QACJO,UAAU,EAAE,CAAC;UAAEF,IAAI;UAAE1C,KAAK;UAAEkG;QAAK,CAAC;MACpC;IACF,CAAC;EACL,CAAC;AACH","ignoreList":[]}
|
|
@@ -6,9 +6,21 @@ 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 = () => {
|
|
23
|
+
// Use the same value limits for command parameters and assertion comparisons.
|
|
12
24
|
var {
|
|
13
25
|
stepsFromCommands: {
|
|
14
26
|
maxArgumentDepth: maxDepth,
|
|
@@ -18,27 +30,13 @@ var getSerializeOptions = () => {
|
|
|
18
30
|
return {
|
|
19
31
|
maxDepth,
|
|
20
32
|
maxLength,
|
|
21
|
-
|
|
33
|
+
replacer: replacerWithDomSupport
|
|
22
34
|
};
|
|
23
35
|
};
|
|
24
36
|
var isDomObject = value => typeof value === "object" && value !== null && Cypress.dom.isDom(value);
|
|
25
37
|
|
|
26
38
|
// @ts-ignore
|
|
27
39
|
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
|
-
};
|
|
40
|
+
var replacerWithDomSupport = (_, value) => isDomObject(value) ? stringifyAsDom(value) : value;
|
|
43
41
|
module.exports = exports.default;
|
|
44
42
|
//# sourceMappingURL=serialize.js.map
|