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/dist/cjs/reporter.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.allureCypress = exports.AllureCypress = void 0;
|
|
7
7
|
var _allureJsCommons = require("allure-js-commons");
|
|
8
|
+
var _sdk = require("allure-js-commons/sdk");
|
|
8
9
|
var _reporter = require("allure-js-commons/sdk/reporter");
|
|
9
10
|
var _utils = require("./utils.js");
|
|
10
11
|
var _excluded = ["fullNameSuffix"],
|
|
@@ -13,7 +14,8 @@ var _excluded = ["fullNameSuffix"],
|
|
|
13
14
|
_excluded4 = ["id"],
|
|
14
15
|
_excluded5 = ["id", "stop"],
|
|
15
16
|
_excluded6 = ["id"],
|
|
16
|
-
_excluded7 = ["
|
|
17
|
+
_excluded7 = ["path", "name"],
|
|
18
|
+
_excluded8 = ["resultsDir", "videoOnFailOnly"];
|
|
17
19
|
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; }
|
|
18
20
|
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; }
|
|
19
21
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
@@ -26,6 +28,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
26
28
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
27
29
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
28
30
|
var _fixtureNames = /*#__PURE__*/new WeakMap();
|
|
31
|
+
var _screenshotReferencesByPath = /*#__PURE__*/new WeakMap();
|
|
29
32
|
var _endAllSpecs = /*#__PURE__*/new WeakMap();
|
|
30
33
|
var _applyAllureCypressMessages = /*#__PURE__*/new WeakMap();
|
|
31
34
|
var _startRun = /*#__PURE__*/new WeakMap();
|
|
@@ -43,7 +46,6 @@ var _skipTest = /*#__PURE__*/new WeakMap();
|
|
|
43
46
|
var _addSkippedTest = /*#__PURE__*/new WeakMap();
|
|
44
47
|
var _stopTest = /*#__PURE__*/new WeakMap();
|
|
45
48
|
var _stopExistingTestResult = /*#__PURE__*/new WeakMap();
|
|
46
|
-
var _fixTestStepStops = /*#__PURE__*/new WeakMap();
|
|
47
49
|
var _fixFixtureStepStops = /*#__PURE__*/new WeakMap();
|
|
48
50
|
var _fixStepStops = /*#__PURE__*/new WeakMap();
|
|
49
51
|
var _startStep = /*#__PURE__*/new WeakMap();
|
|
@@ -61,6 +63,7 @@ class AllureCypress {
|
|
|
61
63
|
_defineProperty(this, "allureRuntime", void 0);
|
|
62
64
|
_defineProperty(this, "specContextByAbsolutePath", new Map());
|
|
63
65
|
_classPrivateFieldInitSpec(this, _fixtureNames, new Map());
|
|
66
|
+
_classPrivateFieldInitSpec(this, _screenshotReferencesByPath, new Map());
|
|
64
67
|
_defineProperty(this, "videoOnFailOnly", false);
|
|
65
68
|
_defineProperty(this, "attachToCypress", on => {
|
|
66
69
|
on("task", {
|
|
@@ -78,6 +81,7 @@ class AllureCypress {
|
|
|
78
81
|
return null;
|
|
79
82
|
}
|
|
80
83
|
});
|
|
84
|
+
on("after:screenshot", this.onAfterScreenshot);
|
|
81
85
|
|
|
82
86
|
// Emits the remaining fixtures and writes the video of the spec.
|
|
83
87
|
// In interactive mode it's invoked through the `reportFinalAllureCypressSpecMessages` task.
|
|
@@ -87,6 +91,24 @@ class AllureCypress {
|
|
|
87
91
|
// `experimentalInteractiveRunEvents` is set.
|
|
88
92
|
on("after:run", this.onAfterRun);
|
|
89
93
|
});
|
|
94
|
+
/**
|
|
95
|
+
* Forward `after:screenshot` here if you define your own handler. Pass the
|
|
96
|
+
* final screenshot path after any changes made by your handler.
|
|
97
|
+
*/
|
|
98
|
+
_defineProperty(this, "onAfterScreenshot", _ref => {
|
|
99
|
+
var _classPrivateFieldGet2;
|
|
100
|
+
var {
|
|
101
|
+
path
|
|
102
|
+
} = _ref;
|
|
103
|
+
// Snapshot plugins can move or delete the file before the browser flushes
|
|
104
|
+
// its attachment message. Preserve each capture, including overwritten paths.
|
|
105
|
+
var reference = this.allureRuntime.emitAttachment(path, {
|
|
106
|
+
contentType: _allureJsCommons.ContentType.PNG
|
|
107
|
+
});
|
|
108
|
+
var references = (_classPrivateFieldGet2 = _classPrivateFieldGet(_screenshotReferencesByPath, this).get(path)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : [];
|
|
109
|
+
references.push(reference);
|
|
110
|
+
_classPrivateFieldGet(_screenshotReferencesByPath, this).set(path, references);
|
|
111
|
+
});
|
|
90
112
|
/**
|
|
91
113
|
* Forward the `after:spec` event into Allure Cypress using this function if
|
|
92
114
|
* you need to define your own handler or combine Allure Cypress with other
|
|
@@ -151,17 +173,18 @@ class AllureCypress {
|
|
|
151
173
|
_classPrivateFieldGet(_emitRemainingScopes, this).call(this, specContext);
|
|
152
174
|
this.specContextByAbsolutePath.delete(specAbsolutePath);
|
|
153
175
|
}
|
|
176
|
+
_classPrivateFieldGet(_screenshotReferencesByPath, this).clear();
|
|
154
177
|
});
|
|
155
178
|
_classPrivateFieldInitSpec(this, _endAllSpecs, () => {
|
|
156
179
|
for (var specAbsolutePath of this.specContextByAbsolutePath.keys()) {
|
|
157
180
|
this.endSpec(specAbsolutePath);
|
|
158
181
|
}
|
|
159
182
|
});
|
|
160
|
-
_classPrivateFieldInitSpec(this, _applyAllureCypressMessages,
|
|
183
|
+
_classPrivateFieldInitSpec(this, _applyAllureCypressMessages, _ref2 => {
|
|
161
184
|
var {
|
|
162
185
|
messages,
|
|
163
186
|
absolutePath
|
|
164
|
-
} =
|
|
187
|
+
} = _ref2;
|
|
165
188
|
messages.forEach(message => {
|
|
166
189
|
if (message.type === "cypress_run_start") {
|
|
167
190
|
_classPrivateFieldGet(_startRun, this).call(this, absolutePath);
|
|
@@ -222,14 +245,14 @@ class AllureCypress {
|
|
|
222
245
|
_classPrivateFieldGet(_initializeSpecContext, this).call(this, absolutePath);
|
|
223
246
|
}
|
|
224
247
|
});
|
|
225
|
-
_classPrivateFieldInitSpec(this, _startSuite, (context,
|
|
248
|
+
_classPrivateFieldInitSpec(this, _startSuite, (context, _ref3) => {
|
|
226
249
|
var {
|
|
227
250
|
data: {
|
|
228
251
|
id,
|
|
229
252
|
name,
|
|
230
253
|
root
|
|
231
254
|
}
|
|
232
|
-
} =
|
|
255
|
+
} = _ref3;
|
|
233
256
|
_classPrivateFieldGet(_pushNewSuiteScope, this).call(this, context, id);
|
|
234
257
|
if (!root) {
|
|
235
258
|
_classPrivateFieldGet(_emitPreviousTestScope, this).call(this, context);
|
|
@@ -243,12 +266,12 @@ class AllureCypress {
|
|
|
243
266
|
context.suiteScopeToId.set(scope, suiteId);
|
|
244
267
|
return scope;
|
|
245
268
|
});
|
|
246
|
-
_classPrivateFieldInitSpec(this, _stopSuite, (context,
|
|
269
|
+
_classPrivateFieldInitSpec(this, _stopSuite, (context, _ref4) => {
|
|
247
270
|
var {
|
|
248
271
|
data: {
|
|
249
272
|
root
|
|
250
273
|
}
|
|
251
|
-
} =
|
|
274
|
+
} = _ref4;
|
|
252
275
|
_classPrivateFieldGet(_emitPreviousTestScope, this).call(this, context);
|
|
253
276
|
if (!root) {
|
|
254
277
|
context.suiteNames.pop();
|
|
@@ -266,7 +289,7 @@ class AllureCypress {
|
|
|
266
289
|
this.allureRuntime.writeScope(scope);
|
|
267
290
|
}
|
|
268
291
|
});
|
|
269
|
-
_classPrivateFieldInitSpec(this, _startHook, (context,
|
|
292
|
+
_classPrivateFieldInitSpec(this, _startHook, (context, _ref5) => {
|
|
270
293
|
var {
|
|
271
294
|
data: {
|
|
272
295
|
name,
|
|
@@ -274,7 +297,7 @@ class AllureCypress {
|
|
|
274
297
|
position,
|
|
275
298
|
start
|
|
276
299
|
}
|
|
277
|
-
} =
|
|
300
|
+
} = _ref5;
|
|
278
301
|
var isEach = scopeType === "each";
|
|
279
302
|
var isAfterEach = position === "after" && isEach;
|
|
280
303
|
if (!isAfterEach) {
|
|
@@ -292,12 +315,12 @@ class AllureCypress {
|
|
|
292
315
|
}
|
|
293
316
|
}
|
|
294
317
|
});
|
|
295
|
-
_classPrivateFieldInitSpec(this, _stopHook, (context,
|
|
318
|
+
_classPrivateFieldInitSpec(this, _stopHook, (context, _ref6) => {
|
|
296
319
|
var {
|
|
297
320
|
data: {
|
|
298
321
|
duration
|
|
299
322
|
}
|
|
300
|
-
} =
|
|
323
|
+
} = _ref6;
|
|
301
324
|
var fixtureUuid = context.fixture;
|
|
302
325
|
if (fixtureUuid) {
|
|
303
326
|
this.allureRuntime.updateFixture(fixtureUuid, fixture => {
|
|
@@ -312,23 +335,23 @@ class AllureCypress {
|
|
|
312
335
|
context.fixture = undefined;
|
|
313
336
|
}
|
|
314
337
|
});
|
|
315
|
-
_classPrivateFieldInitSpec(this, _startTest, (context,
|
|
338
|
+
_classPrivateFieldInitSpec(this, _startTest, (context, _ref7) => {
|
|
316
339
|
var {
|
|
317
340
|
data: {
|
|
318
341
|
fullNameSuffix
|
|
319
342
|
}
|
|
320
|
-
} =
|
|
321
|
-
testResultData = _objectWithoutProperties(
|
|
343
|
+
} = _ref7,
|
|
344
|
+
testResultData = _objectWithoutProperties(_ref7.data, _excluded);
|
|
322
345
|
_classPrivateFieldGet(_emitPreviousTestScope, this).call(this, context);
|
|
323
346
|
var testScope = this.allureRuntime.startScope();
|
|
324
347
|
context.testScope = testScope;
|
|
325
348
|
context.test = _classPrivateFieldGet(_addNewTestResult, this).call(this, context, fullNameSuffix, testResultData, [context.videoScope, ...context.suiteScopes, testScope]);
|
|
326
349
|
});
|
|
327
|
-
_classPrivateFieldInitSpec(this, _addNewTestResult, (context, fullNameSuffix,
|
|
350
|
+
_classPrivateFieldInitSpec(this, _addNewTestResult, (context, fullNameSuffix, _ref8, scopes) => {
|
|
328
351
|
var {
|
|
329
352
|
labels: metadataLabels = []
|
|
330
|
-
} =
|
|
331
|
-
otherTestData = _objectWithoutProperties(
|
|
353
|
+
} = _ref8,
|
|
354
|
+
otherTestData = _objectWithoutProperties(_ref8, _excluded2);
|
|
332
355
|
var projectName = (0, _reporter.getProjectName)();
|
|
333
356
|
var posixPath = (0, _reporter.getPosixPath)(context.specPath);
|
|
334
357
|
var fullNameBase = projectName ? "".concat(projectName, ":").concat(posixPath) : posixPath;
|
|
@@ -336,27 +359,31 @@ class AllureCypress {
|
|
|
336
359
|
var titlePath = posixPath.split("/").concat(context.suiteNames);
|
|
337
360
|
return this.allureRuntime.startTest(_objectSpread({
|
|
338
361
|
stage: _allureJsCommons.Stage.RUNNING,
|
|
339
|
-
labels: [(0, _reporter.getLanguageLabel)(), (0, _reporter.getFrameworkLabel)("cypress"), ...
|
|
362
|
+
labels: [(0, _reporter.getLanguageLabel)(), (0, _reporter.getFrameworkLabel)("cypress"), ...metadataLabels, ...(0, _reporter.getEnvironmentLabels)(), (0, _reporter.getHostLabel)(), (0, _reporter.getThreadLabel)(), (0, _reporter.getPackageLabel)(context.specPath), (0, _reporter.getFallbackTestCaseIdLabel)((0, _reporter.md5)(legacyFullName))],
|
|
340
363
|
fullName: "".concat(fullNameBase, "#").concat(fullNameSuffix),
|
|
341
364
|
titlePath: projectName ? [projectName, ...titlePath] : titlePath
|
|
342
365
|
}, otherTestData), scopes);
|
|
343
366
|
});
|
|
344
|
-
_classPrivateFieldInitSpec(this, _failHookAndTest, (context,
|
|
367
|
+
_classPrivateFieldInitSpec(this, _failHookAndTest, (context, _ref9) => {
|
|
345
368
|
var {
|
|
346
369
|
data: {
|
|
347
370
|
status,
|
|
348
371
|
statusDetails
|
|
349
372
|
}
|
|
350
|
-
} =
|
|
373
|
+
} = _ref9;
|
|
351
374
|
var setError = result => Object.assign(result, {
|
|
352
375
|
status,
|
|
353
376
|
statusDetails
|
|
354
377
|
});
|
|
355
378
|
var fixtureUuid = context.fixture;
|
|
356
379
|
if (fixtureUuid) {
|
|
357
|
-
var
|
|
380
|
+
var _classPrivateFieldGet3;
|
|
358
381
|
this.allureRuntime.updateFixture(fixtureUuid, setError);
|
|
359
|
-
this.allureRuntime.applyGlobalRuntimeMessages([
|
|
382
|
+
this.allureRuntime.applyGlobalRuntimeMessages([(0, _sdk.toGlobalErrorMessage)({
|
|
383
|
+
name: (_classPrivateFieldGet3 = _classPrivateFieldGet(_fixtureNames, this).get(fixtureUuid)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : "hook",
|
|
384
|
+
details: statusDetails,
|
|
385
|
+
status
|
|
386
|
+
})]);
|
|
360
387
|
}
|
|
361
388
|
var testUuid = context.test;
|
|
362
389
|
if (testUuid) {
|
|
@@ -372,12 +399,12 @@ class AllureCypress {
|
|
|
372
399
|
});
|
|
373
400
|
}
|
|
374
401
|
});
|
|
375
|
-
_classPrivateFieldInitSpec(this, _skipTest, (context,
|
|
402
|
+
_classPrivateFieldInitSpec(this, _skipTest, (context, _ref0) => {
|
|
376
403
|
var {
|
|
377
404
|
data: {
|
|
378
405
|
statusDetails
|
|
379
406
|
}
|
|
380
|
-
} =
|
|
407
|
+
} = _ref0;
|
|
381
408
|
var testUuid = context.test;
|
|
382
409
|
if (testUuid) {
|
|
383
410
|
this.allureRuntime.updateTest(testUuid, testResult => {
|
|
@@ -388,7 +415,7 @@ class AllureCypress {
|
|
|
388
415
|
});
|
|
389
416
|
}
|
|
390
417
|
});
|
|
391
|
-
_classPrivateFieldInitSpec(this, _addSkippedTest, (context,
|
|
418
|
+
_classPrivateFieldInitSpec(this, _addSkippedTest, (context, _ref1) => {
|
|
392
419
|
var {
|
|
393
420
|
data: {
|
|
394
421
|
fullNameSuffix,
|
|
@@ -396,8 +423,8 @@ class AllureCypress {
|
|
|
396
423
|
duration,
|
|
397
424
|
retries
|
|
398
425
|
}
|
|
399
|
-
} =
|
|
400
|
-
testResultData = _objectWithoutProperties(
|
|
426
|
+
} = _ref1,
|
|
427
|
+
testResultData = _objectWithoutProperties(_ref1.data, _excluded3);
|
|
401
428
|
// Tests skipped because of a hook error may share all suites of the current context
|
|
402
429
|
// or just a part thereof (if it's from a sibling suite).
|
|
403
430
|
var scopes = suites.map(s => context.suiteIdToScope.get(s)).filter(s => Boolean(s));
|
|
@@ -405,25 +432,25 @@ class AllureCypress {
|
|
|
405
432
|
_classPrivateFieldGet(_stopExistingTestResult, this).call(this, testUuid, {
|
|
406
433
|
duration,
|
|
407
434
|
retries
|
|
408
|
-
});
|
|
435
|
+
}, context.suiteNames);
|
|
409
436
|
this.allureRuntime.writeTest(testUuid);
|
|
410
437
|
});
|
|
411
|
-
_classPrivateFieldInitSpec(this, _stopTest, (context,
|
|
438
|
+
_classPrivateFieldInitSpec(this, _stopTest, (context, _ref10) => {
|
|
412
439
|
var {
|
|
413
440
|
data
|
|
414
|
-
} =
|
|
441
|
+
} = _ref10;
|
|
415
442
|
var testUuid = context.test;
|
|
416
443
|
if (testUuid) {
|
|
417
|
-
_classPrivateFieldGet(_stopExistingTestResult, this).call(this, testUuid, data);
|
|
444
|
+
_classPrivateFieldGet(_stopExistingTestResult, this).call(this, testUuid, data, context.suiteNames);
|
|
418
445
|
this.allureRuntime.writeTest(testUuid);
|
|
419
446
|
context.test = undefined;
|
|
420
447
|
}
|
|
421
448
|
});
|
|
422
|
-
_classPrivateFieldInitSpec(this, _stopExistingTestResult, (testUuid,
|
|
449
|
+
_classPrivateFieldInitSpec(this, _stopExistingTestResult, (testUuid, _ref11, suiteNames) => {
|
|
423
450
|
var {
|
|
424
451
|
retries,
|
|
425
452
|
duration
|
|
426
|
-
} =
|
|
453
|
+
} = _ref11;
|
|
427
454
|
this.allureRuntime.updateTest(testUuid, testResult => {
|
|
428
455
|
if (retries > 0) {
|
|
429
456
|
testResult.parameters.push({
|
|
@@ -437,19 +464,20 @@ class AllureCypress {
|
|
|
437
464
|
this.allureRuntime.stopTest(testUuid, {
|
|
438
465
|
duration
|
|
439
466
|
});
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
467
|
+
// Hook metadata is merged by stopTest, so apply defaults only after it.
|
|
468
|
+
this.allureRuntime.updateTest(testUuid, testResult => {
|
|
469
|
+
testResult.labels.push(...(0, _reporter.getDefaultSuiteLabels)(testResult, suiteNames));
|
|
470
|
+
_classPrivateFieldGet(_fixStepStops, this).call(this, testResult);
|
|
471
|
+
});
|
|
444
472
|
});
|
|
445
473
|
_classPrivateFieldInitSpec(this, _fixFixtureStepStops, fixtureUuid => {
|
|
446
474
|
this.allureRuntime.updateFixture(fixtureUuid, _classPrivateFieldGet(_fixStepStops, this));
|
|
447
475
|
});
|
|
448
|
-
_classPrivateFieldInitSpec(this, _fixStepStops,
|
|
476
|
+
_classPrivateFieldInitSpec(this, _fixStepStops, _ref12 => {
|
|
449
477
|
var {
|
|
450
478
|
stop,
|
|
451
479
|
steps = []
|
|
452
|
-
} =
|
|
480
|
+
} = _ref12;
|
|
453
481
|
if (stop) {
|
|
454
482
|
// In some circumstances, steps becomes dangling and are stopped at the test end/hook end events, which happen
|
|
455
483
|
// chronologically after the test or fixture ends. This leads to the steps' stop time being greater than the one
|
|
@@ -465,11 +493,11 @@ class AllureCypress {
|
|
|
465
493
|
}
|
|
466
494
|
}
|
|
467
495
|
});
|
|
468
|
-
_classPrivateFieldInitSpec(this, _startStep, (context,
|
|
496
|
+
_classPrivateFieldInitSpec(this, _startStep, (context, _ref13) => {
|
|
469
497
|
var {
|
|
470
498
|
id
|
|
471
|
-
} =
|
|
472
|
-
properties = _objectWithoutProperties(
|
|
499
|
+
} = _ref13,
|
|
500
|
+
properties = _objectWithoutProperties(_ref13, _excluded4);
|
|
473
501
|
var rootUuid = _classPrivateFieldGet(_resolveRootUuid, this).call(this, context);
|
|
474
502
|
if (rootUuid) {
|
|
475
503
|
var stepUuid = this.allureRuntime.startStep(rootUuid, undefined, properties);
|
|
@@ -478,12 +506,12 @@ class AllureCypress {
|
|
|
478
506
|
}
|
|
479
507
|
}
|
|
480
508
|
});
|
|
481
|
-
_classPrivateFieldInitSpec(this, _stopStep, (context,
|
|
509
|
+
_classPrivateFieldInitSpec(this, _stopStep, (context, _ref14) => {
|
|
482
510
|
var {
|
|
483
511
|
id,
|
|
484
512
|
stop
|
|
485
|
-
} =
|
|
486
|
-
properties = _objectWithoutProperties(
|
|
513
|
+
} = _ref14,
|
|
514
|
+
properties = _objectWithoutProperties(_ref14, _excluded5);
|
|
487
515
|
var stepUuid = context.stepsByFrontEndId.get(id);
|
|
488
516
|
if (stepUuid) {
|
|
489
517
|
this.allureRuntime.updateStep(stepUuid, r => {
|
|
@@ -494,11 +522,11 @@ class AllureCypress {
|
|
|
494
522
|
});
|
|
495
523
|
}
|
|
496
524
|
});
|
|
497
|
-
_classPrivateFieldInitSpec(this, _finalizeStep, (context,
|
|
525
|
+
_classPrivateFieldInitSpec(this, _finalizeStep, (context, _ref15) => {
|
|
498
526
|
var {
|
|
499
527
|
id
|
|
500
|
-
} =
|
|
501
|
-
properties = _objectWithoutProperties(
|
|
528
|
+
} = _ref15,
|
|
529
|
+
properties = _objectWithoutProperties(_ref15, _excluded6);
|
|
502
530
|
var stepUuid = context.stepsByFrontEndId.get(id);
|
|
503
531
|
if (stepUuid) {
|
|
504
532
|
this.allureRuntime.updateStep(stepUuid, r => {
|
|
@@ -509,6 +537,25 @@ class AllureCypress {
|
|
|
509
537
|
});
|
|
510
538
|
_classPrivateFieldInitSpec(this, _applyRuntimeApiMessages, (context, message) => {
|
|
511
539
|
var rootUuid = _classPrivateFieldGet(_resolveRootUuid, this).call(this, context);
|
|
540
|
+
if (message.type === "attachment_path") {
|
|
541
|
+
var _message$data = message.data,
|
|
542
|
+
{
|
|
543
|
+
path,
|
|
544
|
+
name
|
|
545
|
+
} = _message$data,
|
|
546
|
+
options = _objectWithoutProperties(_message$data, _excluded7);
|
|
547
|
+
var references = _classPrivateFieldGet(_screenshotReferencesByPath, this).get(path);
|
|
548
|
+
var reference = references === null || references === void 0 ? void 0 : references.shift();
|
|
549
|
+
if (reference) {
|
|
550
|
+
if (!(references !== null && references !== void 0 && references.length)) {
|
|
551
|
+
_classPrivateFieldGet(_screenshotReferencesByPath, this).delete(path);
|
|
552
|
+
}
|
|
553
|
+
if (rootUuid) {
|
|
554
|
+
this.allureRuntime.writeAttachment(rootUuid, undefined, name, reference, options);
|
|
555
|
+
}
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
512
559
|
if (rootUuid) {
|
|
513
560
|
this.allureRuntime.applyRuntimeMessages(rootUuid, [message]);
|
|
514
561
|
} else {
|
|
@@ -582,7 +629,7 @@ class AllureCypress {
|
|
|
582
629
|
resultsDir,
|
|
583
630
|
videoOnFailOnly = false
|
|
584
631
|
} = config,
|
|
585
|
-
rest = _objectWithoutProperties(config,
|
|
632
|
+
rest = _objectWithoutProperties(config, _excluded8);
|
|
586
633
|
this.videoOnFailOnly = videoOnFailOnly;
|
|
587
634
|
this.allureRuntime = new _reporter.ReporterRuntime(_objectSpread({
|
|
588
635
|
writer: (0, _reporter.createDefaultWriter)({
|
|
@@ -667,10 +714,4 @@ var allureCypress = (on, cypressConfig, allureConfig) => {
|
|
|
667
714
|
return allureCypressReporter;
|
|
668
715
|
};
|
|
669
716
|
exports.allureCypress = allureCypress;
|
|
670
|
-
var toGlobalErrorMessage = (name, details) => ({
|
|
671
|
-
type: "global_error",
|
|
672
|
-
data: _objectSpread(_objectSpread({}, details), {}, {
|
|
673
|
-
message: details.message ? "".concat(name, " failed: ").concat(details.message) : "".concat(name, " failed")
|
|
674
|
-
})
|
|
675
|
-
});
|
|
676
717
|
//# sourceMappingURL=reporter.js.map
|