@allurereport/reader 3.4.1 → 3.6.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.
@@ -111,7 +111,8 @@ export const allure2 = {
111
111
  return false;
112
112
  }
113
113
  }
114
- return false;
114
+ await visitor.visitAttachmentFile(data, { readerId });
115
+ return true;
115
116
  },
116
117
  readerId: () => readerId,
117
118
  };
@@ -231,8 +232,10 @@ const processTestResultContainer = async (visitor, result) => {
231
232
  const processGlobals = async (visitor, globals) => {
232
233
  const { attachments = [], errors = [] } = globals;
233
234
  await visitor.visitGlobals({
234
- attachments: Array.isArray(attachments) ? attachments.map((attachment) => convertAttachment(attachment)) : [],
235
- errors: isStringAnyRecordArray(errors) ? errors : [],
235
+ attachments: Array.isArray(attachments)
236
+ ? attachments.map((attachment) => convertGlobalAttachment(attachment))
237
+ : [],
238
+ errors: isStringAnyRecordArray(errors) ? errors.map((error) => convertGlobalError(error)) : [],
236
239
  }, { readerId });
237
240
  };
238
241
  const convertStatus = (status) => {
@@ -308,6 +311,21 @@ const convertAttachment = ({ name, type, source }) => {
308
311
  type: "attachment",
309
312
  };
310
313
  };
314
+ const convertGlobalAttachment = ({ environment, ...attachment }) => {
315
+ return {
316
+ ...convertAttachment(attachment),
317
+ environment: ensureString(environment),
318
+ };
319
+ };
320
+ const convertGlobalError = ({ environment, ...error }) => {
321
+ return {
322
+ message: ensureString(error.message),
323
+ trace: ensureString(error.trace),
324
+ expected: ensureString(error.expected),
325
+ actual: ensureString(error.actual),
326
+ environment: ensureString(environment),
327
+ };
328
+ };
311
329
  const convertLabel = ({ name, value }) => {
312
330
  return {
313
331
  name: ensureString(name),
@@ -3,6 +3,9 @@ export interface Attachment {
3
3
  type?: string;
4
4
  source?: string;
5
5
  }
6
+ export interface GlobalAttachment extends Attachment {
7
+ environment?: string;
8
+ }
6
9
  export declare enum Status {
7
10
  FAILED = "failed",
8
11
  BROKEN = "broken",
@@ -45,6 +48,9 @@ export interface StatusDetails {
45
48
  actual?: string;
46
49
  expected?: string;
47
50
  }
51
+ export interface GlobalStatusDetails extends StatusDetails {
52
+ environment?: string;
53
+ }
48
54
  interface ExecutableItem {
49
55
  name?: string;
50
56
  status?: Status;
@@ -77,7 +83,7 @@ export interface TestResultContainer {
77
83
  afters?: FixtureResult[];
78
84
  }
79
85
  export interface Globals {
80
- attachments: Attachment[];
81
- errors: StatusDetails[];
86
+ attachments: GlobalAttachment[];
87
+ errors: GlobalStatusDetails[];
82
88
  }
83
89
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/reader",
3
- "version": "3.4.1",
3
+ "version": "3.6.0",
4
4
  "description": "Collection of utilities which helps to process different kind of test results as Allure Results",
5
5
  "keywords": [
6
6
  "allure",
@@ -26,9 +26,9 @@
26
26
  "lint:fix": "oxlint --import-plugin --fix src test features stories"
27
27
  },
28
28
  "dependencies": {
29
- "@allurereport/core-api": "3.4.1",
30
- "@allurereport/plugin-api": "3.4.1",
31
- "@allurereport/reader-api": "3.4.1",
29
+ "@allurereport/core-api": "3.6.0",
30
+ "@allurereport/plugin-api": "3.6.0",
31
+ "@allurereport/reader-api": "3.6.0",
32
32
  "fast-xml-parser": "^5.5.7"
33
33
  },
34
34
  "devDependencies": {