@allurereport/reader 3.4.0 → 3.5.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/dist/allure2/index.js
CHANGED
|
@@ -111,7 +111,8 @@ export const allure2 = {
|
|
|
111
111
|
return false;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
|
|
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)
|
|
235
|
-
|
|
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),
|
package/dist/allure2/model.d.ts
CHANGED
|
@@ -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:
|
|
81
|
-
errors:
|
|
86
|
+
attachments: GlobalAttachment[];
|
|
87
|
+
errors: GlobalStatusDetails[];
|
|
82
88
|
}
|
|
83
89
|
export {};
|
package/dist/xcresult/index.d.ts
CHANGED
package/dist/xcresult/index.js
CHANGED
|
@@ -18,6 +18,15 @@ export const readXcResultBundle = async (visitor, directory) => {
|
|
|
18
18
|
}
|
|
19
19
|
return false;
|
|
20
20
|
};
|
|
21
|
+
export const isXcResultToolAvailable = async () => {
|
|
22
|
+
try {
|
|
23
|
+
await version();
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
21
30
|
const maybeGetXcResultToolVersion = async () => {
|
|
22
31
|
try {
|
|
23
32
|
return await version();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AttachmentFileFactory } from "./model.js";
|
|
2
2
|
export declare const parseWithExportedAttachments: (xcResultPath: string, fn: (createAttachmentFile: AttachmentFileFactory) => Promise<void>) => Promise<void>;
|
|
3
3
|
export declare const mapWellKnownAttachmentName: (name: string | undefined, timestamp: number | undefined) => string | undefined;
|
|
4
|
+
export declare const createAttachmentFileFactory: (attachmentsDir: string) => AttachmentFileFactory;
|
|
@@ -11,7 +11,7 @@ export const parseWithExportedAttachments = async (xcResultPath, fn) => {
|
|
|
11
11
|
try {
|
|
12
12
|
attachmentsDir = await mkdtemp(path.join(tmpdir(), "allure-reader-xcresult-"));
|
|
13
13
|
await exportAttachments(xcResultPath, attachmentsDir);
|
|
14
|
-
await fn(
|
|
14
|
+
await fn(createAttachmentFileFactory(attachmentsDir));
|
|
15
15
|
}
|
|
16
16
|
finally {
|
|
17
17
|
if (attachmentsDir) {
|
|
@@ -46,7 +46,7 @@ const timestampToString = (timestamp) => {
|
|
|
46
46
|
fractionalSecondDigits: 3,
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
export const createAttachmentFileFactory = (attachmentsDir) => async (attachmentUuid, uniqueFileName) => {
|
|
50
50
|
const fileExtension = path.extname(uniqueFileName);
|
|
51
51
|
const attachmentFilePath = path.join(attachmentsDir, attachmentUuid);
|
|
52
52
|
const [firstAttemptOk, firstAttemptResult] = await tryReadFile(attachmentFilePath, uniqueFileName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/reader",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.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.
|
|
30
|
-
"@allurereport/plugin-api": "3.
|
|
31
|
-
"@allurereport/reader-api": "3.
|
|
29
|
+
"@allurereport/core-api": "3.5.0",
|
|
30
|
+
"@allurereport/plugin-api": "3.5.0",
|
|
31
|
+
"@allurereport/reader-api": "3.5.0",
|
|
32
32
|
"fast-xml-parser": "^5.5.7"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|