@allurereport/plugin-classic 3.21.0 → 3.22.1
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/categories.js +1 -1
- package/dist/converters.d.ts +2 -4
- package/dist/converters.js +2 -21
- package/dist/generators.d.ts +1 -3
- package/dist/generators.js +2 -19
- package/dist/model.d.ts +0 -1
- package/dist/plugin.js +2 -1
- package/dist/static/report.tar +0 -0
- package/dist/writer.d.ts +0 -9
- package/dist/writer.js +1 -47
- package/package.json +15 -13
package/dist/categories.js
CHANGED
package/dist/converters.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
1
|
+
import { type TestResult } from "@allurereport/core-api";
|
|
2
|
+
import type { ReportTestResult } from "@allurereport/plugin-api";
|
|
3
3
|
export declare const convertTestResult: (tr: TestResult) => ReportTestResult;
|
|
4
|
-
export declare const convertTestStepResult: (tsr: TestStepResult) => ReportTestStepResult;
|
|
5
|
-
export declare const convertFixtureResult: (fr: TestFixtureResult) => ReportFixtureResult;
|
package/dist/converters.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { redactParameters } from "@allurereport/core-api";
|
|
2
|
+
import { convertTestStepResult } from "@allurereport/plugin-api/internal/report";
|
|
2
3
|
import MarkdownIt from "markdown-it";
|
|
3
4
|
const md = new MarkdownIt();
|
|
4
5
|
const markdownToHtml = (value) => (value ? md.render(value) : undefined);
|
|
@@ -46,23 +47,3 @@ export const convertTestResult = (tr) => {
|
|
|
46
47
|
transition: tr.transition,
|
|
47
48
|
};
|
|
48
49
|
};
|
|
49
|
-
export const convertTestStepResult = (tsr) => {
|
|
50
|
-
if (isStep(tsr)) {
|
|
51
|
-
return {
|
|
52
|
-
...tsr,
|
|
53
|
-
parameters: redactParameters(tsr.parameters),
|
|
54
|
-
steps: (tsr.steps ?? []).map(convertTestStepResult),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
return tsr;
|
|
58
|
-
};
|
|
59
|
-
export const convertFixtureResult = (fr) => {
|
|
60
|
-
return {
|
|
61
|
-
id: fr.id,
|
|
62
|
-
type: fr.type,
|
|
63
|
-
name: fr.name,
|
|
64
|
-
status: fr.status,
|
|
65
|
-
steps: fr.steps.map(convertTestStepResult),
|
|
66
|
-
duration: fr.duration,
|
|
67
|
-
};
|
|
68
|
-
};
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type AttachmentLink, type EnvironmentItem, type Statistic } from "@allurereport/core-api";
|
|
2
2
|
import { type AllureStore, type ReportTestResult, type PluginContext, type ReportFiles, type ResultFile } from "@allurereport/plugin-api";
|
|
3
|
-
import type { ClassicOptions
|
|
3
|
+
import type { ClassicOptions } from "./model.js";
|
|
4
4
|
import type { ClassicDataWriter, ReportFile } from "./writer.js";
|
|
5
|
-
export declare const readTemplateManifest: (_singleFileMode?: boolean) => Promise<TemplateManifest>;
|
|
6
5
|
export declare const generateTestResults: (writer: ClassicDataWriter, store: AllureStore) => Promise<ReportTestResult[]>;
|
|
7
6
|
export declare const generateTree: (writer: ClassicDataWriter, treeName: string, labels: string[], tests: ReportTestResult[]) => Promise<void>;
|
|
8
7
|
export declare const generateEnvironmentJson: (writer: ClassicDataWriter, env: EnvironmentItem[]) => Promise<void>;
|
|
@@ -10,7 +9,6 @@ export declare const generateStatistic: (writer: ClassicDataWriter, statistic: S
|
|
|
10
9
|
export declare const generatePieChart: (writer: ClassicDataWriter, statistic: Statistic) => Promise<void>;
|
|
11
10
|
export declare const generateAllCharts: (writer: ClassicDataWriter, store: AllureStore, options: ClassicOptions, context: PluginContext) => Promise<void>;
|
|
12
11
|
export declare const generateAttachmentsFiles: (writer: ClassicDataWriter, attachmentLinks: AttachmentLink[], contentFunction: (id: string) => Promise<ResultFile | undefined>) => Promise<Map<string, string>>;
|
|
13
|
-
export declare const generateHistoryDataPoints: (writer: ClassicDataWriter, store: AllureStore) => Promise<Map<string, string>>;
|
|
14
12
|
export declare const generateStaticFiles: (payload: ClassicOptions & {
|
|
15
13
|
allureVersion: string;
|
|
16
14
|
reportFiles: ReportFiles;
|
package/dist/generators.js
CHANGED
|
@@ -2,11 +2,12 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { defaultChartsConfig } from "@allurereport/charts-api";
|
|
3
3
|
import { compareBy, createBaseUrlScript, createFontLinkTag, injectReportDataScript, reportDataScriptPlaceholder, stringifyForInlineScript, createScriptTag, createStylesLinkTag, incrementStatistic, nullsLast, ordinal, } from "@allurereport/core-api";
|
|
4
4
|
import { createTreeByCategories, createTreeByLabels, processTree, } from "@allurereport/plugin-api";
|
|
5
|
+
import { convertFixtureResult, writeConcurrently } from "@allurereport/plugin-api/internal/report";
|
|
5
6
|
import { copyReportStaticAssets, getReportStaticAsset, readReportStaticAssets, } from "@allurereport/plugin-api/static-assets";
|
|
6
7
|
import { generateCharts, getPieChartValues } from "@allurereport/web-commons";
|
|
7
8
|
import Handlebars from "handlebars";
|
|
8
9
|
import { matchCategories } from "./categories.js";
|
|
9
|
-
import {
|
|
10
|
+
import { convertTestResult } from "./converters.js";
|
|
10
11
|
const reportStaticArchive = new URL("../dist/static/report.tar", import.meta.url);
|
|
11
12
|
const template = `<!DOCTYPE html>
|
|
12
13
|
<html dir="ltr" lang="en">
|
|
@@ -45,15 +46,6 @@ const template = `<!DOCTYPE html>
|
|
|
45
46
|
</html>
|
|
46
47
|
`;
|
|
47
48
|
const compiledTemplate = Handlebars.compile(template);
|
|
48
|
-
const writeConcurrently = async (items, write, concurrency = 64) => {
|
|
49
|
-
for (let i = 0; i < items.length; i += concurrency) {
|
|
50
|
-
await Promise.all(items.slice(i, i + concurrency).map(write));
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
export const readTemplateManifest = async (_singleFileMode) => {
|
|
54
|
-
const { manifest } = await readReportStaticAssets(reportStaticArchive);
|
|
55
|
-
return manifest;
|
|
56
|
-
};
|
|
57
49
|
const createBreadcrumbs = (convertedTr) => {
|
|
58
50
|
const labelsByType = convertedTr.labels.reduce((acc, label) => {
|
|
59
51
|
if (!acc[label.name]) {
|
|
@@ -174,15 +166,6 @@ export const generateAttachmentsFiles = async (writer, attachmentLinks, contentF
|
|
|
174
166
|
}
|
|
175
167
|
return result;
|
|
176
168
|
};
|
|
177
|
-
export const generateHistoryDataPoints = async (writer, store) => {
|
|
178
|
-
const result = new Map();
|
|
179
|
-
const allHistoryPoints = await store.allHistoryDataPoints();
|
|
180
|
-
for (const historyPoint of allHistoryPoints.slice(0, 6)) {
|
|
181
|
-
const src = `history/${historyPoint.uuid}.json`;
|
|
182
|
-
await writer.writeData(src, historyPoint);
|
|
183
|
-
}
|
|
184
|
-
return result;
|
|
185
|
-
};
|
|
186
169
|
export const generateStaticFiles = async (payload) => {
|
|
187
170
|
const { reportName = "Allure Report", reportLanguage = "en", logo = "", theme = "auto", groupBy, reportFiles, reportDataFiles, reportUuid, allureVersion, overviewHref, } = payload;
|
|
188
171
|
const staticAssets = await readReportStaticAssets(reportStaticArchive);
|
package/dist/model.d.ts
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -12,7 +12,8 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
12
12
|
var _ClassicPlugin_writer, _ClassicPlugin_generate;
|
|
13
13
|
import { createPluginSummary, } from "@allurereport/plugin-api";
|
|
14
14
|
import { preciseTreeLabels } from "@allurereport/plugin-api";
|
|
15
|
-
import {
|
|
15
|
+
import { generateHistoryDataPoints } from "@allurereport/plugin-api/internal/report";
|
|
16
|
+
import { generateAllCharts, generateAttachmentsFiles, generateEnvironmentJson, generatePieChart, generateStaticFiles, generateStatistic, generateTestResults, generateTree, generateTreeByCategories, } from "./generators.js";
|
|
16
17
|
import { InMemoryReportDataWriter, ReportFileDataWriter } from "./writer.js";
|
|
17
18
|
export class ClassicPlugin {
|
|
18
19
|
constructor(options = {}) {
|
package/dist/static/report.tar
CHANGED
|
Binary file
|
package/dist/writer.d.ts
CHANGED
|
@@ -9,15 +9,6 @@ export interface ClassicDataWriter {
|
|
|
9
9
|
writeTestCase(test: ReportTestResult): Promise<void>;
|
|
10
10
|
writeAttachment(source: string, file: ResultFile): Promise<void>;
|
|
11
11
|
}
|
|
12
|
-
export declare class FileSystemReportDataWriter implements ClassicDataWriter {
|
|
13
|
-
#private;
|
|
14
|
-
private readonly output;
|
|
15
|
-
constructor(output: string);
|
|
16
|
-
writeData(fileName: string, data: any): Promise<void>;
|
|
17
|
-
writeWidget(fileName: string, data: any): Promise<void>;
|
|
18
|
-
writeTestCase(test: ReportTestResult): Promise<void>;
|
|
19
|
-
writeAttachment(source: string, file: ResultFile): Promise<void>;
|
|
20
|
-
}
|
|
21
12
|
export declare class InMemoryReportDataWriter implements ClassicDataWriter {
|
|
22
13
|
#private;
|
|
23
14
|
writeData(fileName: string, data: any): Promise<void>;
|
package/dist/writer.js
CHANGED
|
@@ -1,56 +1,10 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
5
|
};
|
|
12
|
-
var
|
|
13
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
14
|
-
import { resolve } from "node:path";
|
|
6
|
+
var _InMemoryReportDataWriter_data;
|
|
15
7
|
import { joinPosixPath } from "@allurereport/core-api";
|
|
16
|
-
export class FileSystemReportDataWriter {
|
|
17
|
-
constructor(output) {
|
|
18
|
-
this.output = output;
|
|
19
|
-
_FileSystemReportDataWriter_dataDir.set(this, void 0);
|
|
20
|
-
_FileSystemReportDataWriter_widgetsDir.set(this, void 0);
|
|
21
|
-
_FileSystemReportDataWriter_testResultsDir.set(this, void 0);
|
|
22
|
-
_FileSystemReportDataWriter_attachmentsDir.set(this, void 0);
|
|
23
|
-
_FileSystemReportDataWriter_dataDirReady.set(this, void 0);
|
|
24
|
-
_FileSystemReportDataWriter_widgetsDirReady.set(this, void 0);
|
|
25
|
-
_FileSystemReportDataWriter_testResultsDirReady.set(this, void 0);
|
|
26
|
-
_FileSystemReportDataWriter_attachmentsDirReady.set(this, void 0);
|
|
27
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_dataDir, resolve(this.output, "data"), "f");
|
|
28
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_widgetsDir, resolve(this.output, "widgets"), "f");
|
|
29
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_testResultsDir, resolve(this.output, "data", "test-results"), "f");
|
|
30
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_attachmentsDir, resolve(this.output, "data", "attachments"), "f");
|
|
31
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_dataDirReady, mkdir(__classPrivateFieldGet(this, _FileSystemReportDataWriter_dataDir, "f"), { recursive: true }), "f");
|
|
32
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_widgetsDirReady, mkdir(__classPrivateFieldGet(this, _FileSystemReportDataWriter_widgetsDir, "f"), { recursive: true }), "f");
|
|
33
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_testResultsDirReady, mkdir(__classPrivateFieldGet(this, _FileSystemReportDataWriter_testResultsDir, "f"), { recursive: true }), "f");
|
|
34
|
-
__classPrivateFieldSet(this, _FileSystemReportDataWriter_attachmentsDirReady, mkdir(__classPrivateFieldGet(this, _FileSystemReportDataWriter_attachmentsDir, "f"), { recursive: true }), "f");
|
|
35
|
-
}
|
|
36
|
-
async writeData(fileName, data) {
|
|
37
|
-
await __classPrivateFieldGet(this, _FileSystemReportDataWriter_dataDirReady, "f");
|
|
38
|
-
await writeFile(resolve(__classPrivateFieldGet(this, _FileSystemReportDataWriter_dataDir, "f"), fileName), JSON.stringify(data), { encoding: "utf-8" });
|
|
39
|
-
}
|
|
40
|
-
async writeWidget(fileName, data) {
|
|
41
|
-
await __classPrivateFieldGet(this, _FileSystemReportDataWriter_widgetsDirReady, "f");
|
|
42
|
-
await writeFile(resolve(__classPrivateFieldGet(this, _FileSystemReportDataWriter_widgetsDir, "f"), fileName), JSON.stringify(data), { encoding: "utf-8" });
|
|
43
|
-
}
|
|
44
|
-
async writeTestCase(test) {
|
|
45
|
-
await __classPrivateFieldGet(this, _FileSystemReportDataWriter_testResultsDirReady, "f");
|
|
46
|
-
await writeFile(resolve(__classPrivateFieldGet(this, _FileSystemReportDataWriter_testResultsDir, "f"), `${test.id}.json`), JSON.stringify(test), { encoding: "utf-8" });
|
|
47
|
-
}
|
|
48
|
-
async writeAttachment(source, file) {
|
|
49
|
-
await __classPrivateFieldGet(this, _FileSystemReportDataWriter_attachmentsDirReady, "f");
|
|
50
|
-
await file.writeTo(resolve(__classPrivateFieldGet(this, _FileSystemReportDataWriter_attachmentsDir, "f"), source));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
_FileSystemReportDataWriter_dataDir = new WeakMap(), _FileSystemReportDataWriter_widgetsDir = new WeakMap(), _FileSystemReportDataWriter_testResultsDir = new WeakMap(), _FileSystemReportDataWriter_attachmentsDir = new WeakMap(), _FileSystemReportDataWriter_dataDirReady = new WeakMap(), _FileSystemReportDataWriter_widgetsDirReady = new WeakMap(), _FileSystemReportDataWriter_testResultsDirReady = new WeakMap(), _FileSystemReportDataWriter_attachmentsDirReady = new WeakMap();
|
|
54
8
|
export class InMemoryReportDataWriter {
|
|
55
9
|
constructor() {
|
|
56
10
|
_InMemoryReportDataWriter_data.set(this, {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-classic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.1",
|
|
4
4
|
"description": "The classic version of Allure HTML report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -25,32 +25,34 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "run clean && tsc --project ./tsconfig.json && node ../../scripts/pack-report-static.mjs ../web-classic/dist/multi ./dist/static/report.tar",
|
|
27
27
|
"clean": "rimraf ./dist",
|
|
28
|
-
"test": "rimraf
|
|
28
|
+
"test": "rimraf out && vp test run",
|
|
29
29
|
"test:unit": "yarn test",
|
|
30
|
-
"lint": "
|
|
31
|
-
"lint:fix": "
|
|
30
|
+
"lint": "vp lint --import-plugin src test features stories",
|
|
31
|
+
"lint:fix": "vp lint --import-plugin --fix src test features stories"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@allurereport/charts-api": "3.
|
|
35
|
-
"@allurereport/core-api": "3.
|
|
36
|
-
"@allurereport/plugin-api": "3.
|
|
37
|
-
"@allurereport/web-commons": "3.
|
|
34
|
+
"@allurereport/charts-api": "3.22.1",
|
|
35
|
+
"@allurereport/core-api": "3.22.1",
|
|
36
|
+
"@allurereport/plugin-api": "3.22.1",
|
|
37
|
+
"@allurereport/web-commons": "3.22.1",
|
|
38
38
|
"d3-shape": "^3.2.0",
|
|
39
39
|
"handlebars": "4.7.10",
|
|
40
|
-
"markdown-it": "^15.0.
|
|
40
|
+
"markdown-it": "^15.0.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@allurereport/
|
|
44
|
-
"@allurereport/web-classic": "3.
|
|
43
|
+
"@allurereport/common-config": "3.22.1",
|
|
44
|
+
"@allurereport/web-classic": "3.22.1",
|
|
45
45
|
"@types/d3-shape": "^3.1.8",
|
|
46
46
|
"@types/markdown-it": "^14.1.2",
|
|
47
47
|
"@types/node": "^20",
|
|
48
|
-
"@vitest/coverage-istanbul": "
|
|
48
|
+
"@vitest/coverage-istanbul": "5.0.4",
|
|
49
49
|
"@vitest/runner": "^2",
|
|
50
50
|
"allure-js-commons": "^3",
|
|
51
51
|
"allure-vitest": "^3",
|
|
52
52
|
"rimraf": "^6",
|
|
53
53
|
"typescript": "^5",
|
|
54
|
-
"
|
|
54
|
+
"vite": "@voidzero-dev/vite-plus-core@1.2.0",
|
|
55
|
+
"vite-plus": "1.2.0",
|
|
56
|
+
"vitest": "5.0.4"
|
|
55
57
|
}
|
|
56
58
|
}
|