allure 3.0.0-beta.11 → 3.0.0-beta.12
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/commands/dashboard.d.ts +11 -0
- package/dist/commands/dashboard.js +68 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +1 -0
- package/dist/index.js +2 -1
- package/package.json +14 -13
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type DashboardCommandOptions = {
|
|
2
|
+
output?: string;
|
|
3
|
+
reportName?: string;
|
|
4
|
+
reportLanguage?: string;
|
|
5
|
+
logo?: string;
|
|
6
|
+
singleFile?: boolean;
|
|
7
|
+
theme?: "light" | "dark";
|
|
8
|
+
};
|
|
9
|
+
export declare const DashboardCommandAction: (resultsDir: string, options: DashboardCommandOptions) => Promise<void>;
|
|
10
|
+
export declare const DashboardCommand: (cli: import("cac").CAC) => void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { AllureReport, resolveConfig } from "@allurereport/core";
|
|
2
|
+
import * as console from "node:console";
|
|
3
|
+
import { createCommand } from "../utils/commands.js";
|
|
4
|
+
export const DashboardCommandAction = async (resultsDir, options) => {
|
|
5
|
+
const before = new Date().getTime();
|
|
6
|
+
const { output, reportName: name, ...rest } = options;
|
|
7
|
+
const config = await resolveConfig({
|
|
8
|
+
output,
|
|
9
|
+
name,
|
|
10
|
+
plugins: {
|
|
11
|
+
"@allurereport/plugin-dashboard": {
|
|
12
|
+
options: rest,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const allureReport = new AllureReport(config);
|
|
17
|
+
await allureReport.start();
|
|
18
|
+
await allureReport.readDirectory(resultsDir);
|
|
19
|
+
await allureReport.done();
|
|
20
|
+
const after = new Date().getTime();
|
|
21
|
+
console.log(`the report successfully generated (${after - before}ms)`);
|
|
22
|
+
};
|
|
23
|
+
export const DashboardCommand = createCommand({
|
|
24
|
+
name: "dashboard <resultsDir>",
|
|
25
|
+
description: "Generates Allure Dashboard report based on provided Allure Results",
|
|
26
|
+
options: [
|
|
27
|
+
[
|
|
28
|
+
"--output, -o <file>",
|
|
29
|
+
{
|
|
30
|
+
description: "The output directory name. Absolute paths are accepted as well",
|
|
31
|
+
default: "allure-report",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"--report-name, --name <string>",
|
|
36
|
+
{
|
|
37
|
+
description: "The report name",
|
|
38
|
+
default: "Allure Report",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"--single-file",
|
|
43
|
+
{
|
|
44
|
+
description: "Generate single file report",
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"--logo <string>",
|
|
50
|
+
{
|
|
51
|
+
description: "Path to the report logo which will be displayed in the header",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
"--theme <string>",
|
|
56
|
+
{
|
|
57
|
+
description: "Default theme of the report (default: OS theme)",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
"--report-language, --lang <string>",
|
|
62
|
+
{
|
|
63
|
+
description: "Default language of the report (default: OS language)",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
],
|
|
67
|
+
action: DashboardCommandAction,
|
|
68
|
+
});
|
package/dist/commands/index.d.ts
CHANGED
package/dist/commands/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cac } from "cac";
|
|
|
2
2
|
import console from "node:console";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { cwd } from "node:process";
|
|
5
|
-
import { AwesomeCommand, ClassicCommand, ClassicLegacyCommand, CsvCommand, GenerateCommand, HistoryCommand, KnownIssueCommand, LogCommand, OpenCommand, QualityGateCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, } from "./commands/index.js";
|
|
5
|
+
import { AwesomeCommand, ClassicCommand, ClassicLegacyCommand, CsvCommand, DashboardCommand, GenerateCommand, HistoryCommand, KnownIssueCommand, LogCommand, OpenCommand, QualityGateCommand, RunCommand, SlackCommand, TestPlanCommand, WatchCommand, } from "./commands/index.js";
|
|
6
6
|
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
7
7
|
const cli = cac(pkg.name).usage(pkg.description).help().version(pkg.version);
|
|
8
8
|
const commands = [
|
|
@@ -10,6 +10,7 @@ const commands = [
|
|
|
10
10
|
ClassicLegacyCommand,
|
|
11
11
|
AwesomeCommand,
|
|
12
12
|
CsvCommand,
|
|
13
|
+
DashboardCommand,
|
|
13
14
|
GenerateCommand,
|
|
14
15
|
HistoryCommand,
|
|
15
16
|
KnownIssueCommand,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "allure",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.12",
|
|
4
4
|
"description": "Allure Commandline Tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -30,18 +30,19 @@
|
|
|
30
30
|
"test": "vitest run"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@allurereport/core": "3.0.0-beta.
|
|
34
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
35
|
-
"@allurereport/directory-watcher": "3.0.0-beta.
|
|
36
|
-
"@allurereport/plugin-allure2": "3.0.0-beta.
|
|
37
|
-
"@allurereport/plugin-api": "3.0.0-beta.
|
|
38
|
-
"@allurereport/plugin-awesome": "3.0.0-beta.
|
|
39
|
-
"@allurereport/plugin-classic": "3.0.0-beta.
|
|
40
|
-
"@allurereport/plugin-
|
|
41
|
-
"@allurereport/plugin-
|
|
42
|
-
"@allurereport/plugin-
|
|
43
|
-
"@allurereport/
|
|
44
|
-
"@allurereport/
|
|
33
|
+
"@allurereport/core": "3.0.0-beta.12",
|
|
34
|
+
"@allurereport/core-api": "3.0.0-beta.12",
|
|
35
|
+
"@allurereport/directory-watcher": "3.0.0-beta.12",
|
|
36
|
+
"@allurereport/plugin-allure2": "3.0.0-beta.12",
|
|
37
|
+
"@allurereport/plugin-api": "3.0.0-beta.12",
|
|
38
|
+
"@allurereport/plugin-awesome": "3.0.0-beta.12",
|
|
39
|
+
"@allurereport/plugin-classic": "3.0.0-beta.12",
|
|
40
|
+
"@allurereport/plugin-dashboard": "3.0.0-beta.12",
|
|
41
|
+
"@allurereport/plugin-progress": "3.0.0-beta.12",
|
|
42
|
+
"@allurereport/plugin-server-reload": "3.0.0-beta.12",
|
|
43
|
+
"@allurereport/plugin-slack": "3.0.0-beta.12",
|
|
44
|
+
"@allurereport/reader-api": "3.0.0-beta.12",
|
|
45
|
+
"@allurereport/static-server": "3.0.0-beta.12",
|
|
45
46
|
"cac": "^6.7.14",
|
|
46
47
|
"lodash.omit": "^4.5.0",
|
|
47
48
|
"yoctocolors": "^2.1.1"
|