allure-playwright 2.15.0 → 3.0.0-beta.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.
Files changed (45) hide show
  1. package/README.md +138 -66
  2. package/dist/cjs/autoconfig.js +6 -0
  3. package/dist/cjs/autoconfig.js.map +1 -0
  4. package/dist/cjs/index.js +572 -0
  5. package/dist/cjs/index.js.map +1 -0
  6. package/dist/cjs/legacy.js +176 -0
  7. package/dist/cjs/legacy.js.map +1 -0
  8. package/dist/cjs/model.js +2 -0
  9. package/dist/cjs/model.js.map +1 -0
  10. package/dist/cjs/runtime.js +58 -0
  11. package/dist/cjs/runtime.js.map +1 -0
  12. package/dist/cjs/testplan.js +18 -0
  13. package/dist/cjs/testplan.js.map +1 -0
  14. package/dist/cjs/utils.js +20 -0
  15. package/dist/cjs/utils.js.map +1 -0
  16. package/dist/esm/autoconfig.js +4 -0
  17. package/dist/esm/autoconfig.js.map +1 -0
  18. package/dist/esm/index.js +556 -0
  19. package/dist/esm/index.js.map +1 -0
  20. package/dist/esm/legacy.js +168 -0
  21. package/dist/esm/legacy.js.map +1 -0
  22. package/dist/esm/model.js +2 -0
  23. package/dist/esm/model.js.map +1 -0
  24. package/dist/esm/runtime.js +51 -0
  25. package/dist/esm/runtime.js.map +1 -0
  26. package/dist/esm/testplan.js +12 -0
  27. package/dist/esm/testplan.js.map +1 -0
  28. package/dist/esm/utils.js +14 -0
  29. package/dist/esm/utils.js.map +1 -0
  30. package/dist/types/autoconfig.d.ts +1 -0
  31. package/dist/types/index.d.ts +51 -0
  32. package/dist/types/legacy.d.ts +34 -0
  33. package/dist/types/model.d.ts +7 -0
  34. package/dist/types/runtime.d.ts +6 -0
  35. package/dist/types/utils.d.ts +3 -0
  36. package/package.json +42 -13
  37. package/dist/helpers.d.ts +0 -30
  38. package/dist/helpers.js +0 -112
  39. package/dist/helpers.js.map +0 -1
  40. package/dist/index.d.ts +0 -41
  41. package/dist/index.js +0 -316
  42. package/dist/index.js.map +0 -1
  43. package/dist/testplan.js +0 -16
  44. package/dist/testplan.js.map +0 -1
  45. /package/dist/{testplan.d.ts → types/testplan.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure-playwright",
3
- "version": "2.15.0",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "Allure Playwright integration",
5
5
  "keywords": [
6
6
  "playwright",
@@ -18,38 +18,67 @@
18
18
  "email": "allure@qameta.io",
19
19
  "url": "https://qameta.io/"
20
20
  },
21
- "main": "./dist/index.js",
22
- "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "require": "./dist/cjs/index.js",
24
+ "types": "./dist/types/index.d.ts",
25
+ "default": "./dist/cjs/index.js"
26
+ },
27
+ "./testplan": {
28
+ "require": "./dist/cjs/testplan.js",
29
+ "types": "./dist/types/testplan.d.ts",
30
+ "default": "./dist/cjs/testplan.js"
31
+ },
32
+ "./autoconfig": {
33
+ "require": "./dist/cjs/autoconfig.js",
34
+ "types": "./dist/types/autoconfig.d.ts",
35
+ "default": "./dist/cjs/autoconfig.js"
36
+ }
37
+ },
38
+ "main": "./dist/cjs/index.js",
39
+ "types": "./dist/types/index.d.ts",
23
40
  "files": [
24
41
  "dist"
25
42
  ],
26
43
  "scripts": {
27
44
  "allure-report": "allure serve ./out/allure-results",
28
45
  "clean": "rimraf ./dist ./out",
29
- "compile": "tsc",
46
+ "compile": "run-p 'compile:*'",
47
+ "compile:esm": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions '.ts' --source-maps",
48
+ "compile:cjs": "babel --config-file ./babel.cjs.json ./src --out-dir ./dist/cjs --extensions '.ts' --source-maps",
49
+ "compile:types": "tsc",
30
50
  "generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean",
31
- "lint": "eslint ./src --ext .ts",
32
- "lint:fix": "eslint ./src --ext .ts --fix",
51
+ "lint": "eslint ./src ./test --ext .ts",
52
+ "lint:fix": "eslint ./src ./test --ext .ts --fix",
33
53
  "pretest": "run compile",
34
- "test": "playwright test -c test"
54
+ "test": "vitest run test/spec"
35
55
  },
36
56
  "dependencies": {
37
- "allure-js-commons": "2.15.0"
57
+ "allure-js-commons": "3.0.0-beta.1"
38
58
  },
39
59
  "devDependencies": {
60
+ "@babel/cli": "^7.24.6",
61
+ "@babel/core": "^7.24.6",
62
+ "@babel/plugin-transform-modules-commonjs": "^7.24.6",
63
+ "@babel/preset-env": "^7.24.6",
64
+ "@babel/preset-typescript": "^7.24.6",
40
65
  "@playwright/test": "^1.34.1",
66
+ "@types/babel__core": "^7",
67
+ "@types/babel__preset-env": "^7",
41
68
  "@types/eslint": "^8",
42
69
  "@types/node": "^20.6.3",
43
- "@typescript-eslint/eslint-plugin": "^6.7.0",
44
- "@typescript-eslint/parser": "^6.7.0",
45
- "eslint": "^8.49.0",
70
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
71
+ "@typescript-eslint/parser": "^7.0.0",
72
+ "eslint": "^8.57.0",
46
73
  "eslint-config-prettier": "^9.0.0",
47
74
  "eslint-plugin-import": "^2.28.1",
48
75
  "eslint-plugin-jsdoc": "^48.0.0",
76
+ "eslint-plugin-n": "^17.0.0",
49
77
  "eslint-plugin-no-null": "^1.0.2",
50
78
  "eslint-plugin-prefer-arrow": "^1.2.3",
51
- "properties": "^1.2.1",
79
+ "npm-run-all2": "^6.1.2",
52
80
  "rimraf": "^5.0.1",
53
- "typescript": "^5.2.2"
81
+ "typescript": "^5.2.2",
82
+ "vitest": "^1.5.0"
54
83
  }
55
84
  }
package/dist/helpers.d.ts DELETED
@@ -1,30 +0,0 @@
1
- /// <reference types="node" />
2
- import { AttachmentOptions, ContentType, Label, Link, MetadataMessage, ParameterOptions } from "allure-js-commons";
3
- export declare class allure {
4
- static logStep(name: string): Promise<void>;
5
- static step<T>(name: string, body: () => Promise<T>): Promise<T>;
6
- static attachment(name: string, content: Buffer | string, options: ContentType | string | Pick<AttachmentOptions, "contentType">): Promise<void>;
7
- static addMetadataAttachment(metadata: MetadataMessage): Promise<void>;
8
- static label(label: string, value: string): Promise<void>;
9
- static labels(...values: Label[]): void;
10
- static description(value: string): Promise<void>;
11
- static link(url: string, name?: string, type?: string): Promise<void>;
12
- static links(...values: Link[]): void;
13
- static id(id: string): Promise<void>;
14
- static epic(epic: string): Promise<void>;
15
- static feature(epic: string): Promise<void>;
16
- static story(story: string): Promise<void>;
17
- static suite(name: string): Promise<void>;
18
- static parentSuite(name: string): Promise<void>;
19
- static layer(layerName: string): Promise<void>;
20
- static subSuite(name: string): Promise<void>;
21
- static owner(owner: string): Promise<void>;
22
- static severity(severity: string): Promise<void>;
23
- static tag(tag: string): Promise<void>;
24
- static tags(...values: string[]): Promise<void>;
25
- static issue(name: string, url: string): Promise<void>;
26
- static tms(name: string, url: string): Promise<void>;
27
- static parameter(name: string, value: any, options?: ParameterOptions): Promise<void>;
28
- static addParameter(name: string, value: string, options?: ParameterOptions): Promise<void>;
29
- }
30
- export { LabelName } from "allure-js-commons";
package/dist/helpers.js DELETED
@@ -1,112 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LabelName = exports.allure = void 0;
7
- const test_1 = __importDefault(require("@playwright/test"));
8
- const crypto_1 = require("crypto");
9
- const allure_js_commons_1 = require("allure-js-commons");
10
- const internal_1 = require("allure-js-commons/internal");
11
- class allure {
12
- static async logStep(name) {
13
- await this.step(name, async () => { });
14
- }
15
- static step(name, body) {
16
- return test_1.default.step(name, body);
17
- }
18
- static async attachment(name, content, options) {
19
- const stepName = `allureattach_${(0, crypto_1.randomUUID)()}_${name}`;
20
- const contentType = typeof options === "string" ? options : options.contentType;
21
- await this.step(stepName, async () => {
22
- await test_1.default.info().attach(stepName, {
23
- body: content,
24
- contentType,
25
- });
26
- });
27
- }
28
- static async addMetadataAttachment(metadata) {
29
- await test_1.default.info().attach("allure-metadata.json", {
30
- contentType: internal_1.ALLURE_METADATA_CONTENT_TYPE,
31
- body: Buffer.from(JSON.stringify(metadata), "utf8"),
32
- });
33
- }
34
- static async label(label, value) {
35
- await this.addMetadataAttachment({
36
- labels: [{ name: label, value }],
37
- });
38
- }
39
- static labels(...values) {
40
- values.forEach(({ name, value }) => this.label(name, value));
41
- }
42
- static async description(value) {
43
- await this.addMetadataAttachment({
44
- description: value,
45
- });
46
- }
47
- static async link(url, name, type) {
48
- await this.addMetadataAttachment({
49
- links: [{ url, name, type }],
50
- });
51
- }
52
- static links(...values) {
53
- values.forEach(({ url, name, type }) => this.link(url, name, type));
54
- }
55
- static async id(id) {
56
- await this.label(allure_js_commons_1.LabelName.ALLURE_ID, id);
57
- }
58
- static async epic(epic) {
59
- await this.label(allure_js_commons_1.LabelName.EPIC, epic);
60
- }
61
- static async feature(epic) {
62
- await this.label(allure_js_commons_1.LabelName.FEATURE, epic);
63
- }
64
- static async story(story) {
65
- await this.label(allure_js_commons_1.LabelName.STORY, story);
66
- }
67
- static async suite(name) {
68
- await this.label(allure_js_commons_1.LabelName.SUITE, name);
69
- }
70
- static async parentSuite(name) {
71
- await this.label(allure_js_commons_1.LabelName.PARENT_SUITE, name);
72
- }
73
- static async layer(layerName) {
74
- await this.label(allure_js_commons_1.LabelName.LAYER, layerName);
75
- }
76
- static async subSuite(name) {
77
- await this.label(allure_js_commons_1.LabelName.SUB_SUITE, name);
78
- }
79
- static async owner(owner) {
80
- await this.label(allure_js_commons_1.LabelName.OWNER, owner);
81
- }
82
- static async severity(severity) {
83
- await this.label(allure_js_commons_1.LabelName.SEVERITY, severity);
84
- }
85
- static async tag(tag) {
86
- await this.label(allure_js_commons_1.LabelName.TAG, tag);
87
- }
88
- static async tags(...values) {
89
- await Promise.allSettled(values.map(async (value) => await this.tag(value)));
90
- }
91
- static async issue(name, url) {
92
- await this.link(url, name, allure_js_commons_1.LinkType.ISSUE);
93
- }
94
- static async tms(name, url) {
95
- await this.link(url, name, allure_js_commons_1.LinkType.TMS);
96
- }
97
- static async parameter(name, value, options) {
98
- await this.addMetadataAttachment({
99
- parameter: [
100
- Object.assign({ name,
101
- value }, options),
102
- ],
103
- });
104
- }
105
- static async addParameter(name, value, options) {
106
- await this.parameter(name, value, options);
107
- }
108
- }
109
- exports.allure = allure;
110
- var allure_js_commons_2 = require("allure-js-commons");
111
- Object.defineProperty(exports, "LabelName", { enumerable: true, get: function () { return allure_js_commons_2.LabelName; } });
112
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AACpC,mCAAoC;AACpC,yDAS2B;AAC3B,yDAA0E;AAE1E,MAAa,MAAM;IACjB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAY;QAC/B,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,CAAC,IAAI,CAAI,IAAY,EAAE,IAAsB;QACjD,OAAO,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,UAAU,CACrB,IAAY,EACZ,OAAwB,EACxB,OAAsE;QAEtE,MAAM,QAAQ,GAAG,gBAAgB,IAAA,mBAAU,GAAE,IAAI,IAAI,EAAE,CAAC;QAExD,MAAM,WAAW,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QAChF,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;YACnC,MAAM,cAAI,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACjC,IAAI,EAAE,OAAO;gBACb,WAAW;aACZ,CAAC,C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AC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AApID,wBAoIC;AAED,uDAA8C;AAArC,8GAAA,SAAS,OAAA"}
package/dist/index.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import { FullConfig } from "@playwright/test";
2
- import { Reporter, Suite, TestCase, TestResult, TestStep } from "@playwright/test/reporter";
3
- import { Category } from "allure-js-commons";
4
- export type AllureReporterOptions = {
5
- detail?: boolean;
6
- outputFolder?: string;
7
- suiteTitle?: boolean;
8
- categories?: Category[];
9
- environmentInfo?: Record<string, string>;
10
- };
11
- declare class AllureReporter implements Reporter {
12
- config: FullConfig;
13
- suite: Suite;
14
- resultsDir: string;
15
- options: AllureReporterOptions;
16
- private allureWriter;
17
- private allureRuntime;
18
- private allureGroupCache;
19
- private allureTestCache;
20
- private allureStepCache;
21
- private allureAttachmentSteps;
22
- private hostname;
23
- private globalStartTime;
24
- private processedDiffs;
25
- constructor(options: AllureReporterOptions);
26
- onBegin(config: FullConfig, suite: Suite): void;
27
- onTestBegin(test: TestCase): void;
28
- onStepBegin(test: TestCase, _result: TestResult, step: TestStep): void;
29
- onStepEnd(_test: TestCase, _result: TestResult, step: TestStep): void;
30
- onTestEnd(test: TestCase, result: TestResult): Promise<void>;
31
- addSkippedResults(): void;
32
- onEnd(): void;
33
- printsToStdio(): boolean;
34
- private getAllureRuntime;
35
- private ensureAllureGroupCreated;
36
- private ensureAllureStepCreated;
37
- private findStep;
38
- private processAttachment;
39
- }
40
- export default AllureReporter;
41
- export * from "./helpers";
package/dist/index.js DELETED
@@ -1,316 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- const fs_1 = __importDefault(require("fs"));
21
- const os_1 = __importDefault(require("os"));
22
- const path_1 = __importDefault(require("path"));
23
- const process_1 = __importDefault(require("process"));
24
- const allure_js_commons_1 = require("allure-js-commons");
25
- const internal_1 = require("allure-js-commons/internal");
26
- const diffEndRegexp = /-((expected)|(diff)|(actual))\.png$/;
27
- const stepAttachRegexp = /^allureattach_(\w{8}-\w{4}-\w{4}-\w{4}-\w{12})_/i;
28
- const stepAttachPrefixLength = 50;
29
- class AllureReporter {
30
- constructor(options) {
31
- this.allureWriter = process_1.default.env.PW_ALLURE_POST_PROCESSOR_FOR_TEST ? new allure_js_commons_1.MessageAllureWriter() : undefined;
32
- this.allureGroupCache = new Map();
33
- this.allureTestCache = new Map();
34
- this.allureStepCache = new Map();
35
- this.allureAttachmentSteps = new Map();
36
- this.hostname = process_1.default.env.ALLURE_HOST_NAME || os_1.default.hostname();
37
- this.globalStartTime = new Date();
38
- this.processedDiffs = [];
39
- this.options = Object.assign({ suiteTitle: true, detail: true }, options);
40
- }
41
- onBegin(config, suite) {
42
- this.config = config;
43
- this.suite = suite;
44
- this.resultsDir = (0, allure_js_commons_1.allureReportFolder)(this.options.outputFolder);
45
- this.allureRuntime = new allure_js_commons_1.AllureRuntime({
46
- resultsDir: this.resultsDir,
47
- writer: this.allureWriter,
48
- });
49
- }
50
- onTestBegin(test) {
51
- const suite = test.parent;
52
- const group = this.ensureAllureGroupCreated(suite);
53
- const titleMetadata = (0, allure_js_commons_1.extractMetadataFromString)(test.title);
54
- const allureTest = group.startTest(titleMetadata.cleanTitle);
55
- allureTest.addLabel(allure_js_commons_1.LabelName.LANGUAGE, "JavaScript");
56
- allureTest.addLabel(allure_js_commons_1.LabelName.FRAMEWORK, "Playwright");
57
- titleMetadata.labels.forEach((label) => allureTest.addLabel(label.name, label.value));
58
- const [, , , ...suiteTitles] = suite.titlePath();
59
- allureTest.addLabel("titlePath", suite.titlePath().join(" > "));
60
- const project = suite.project();
61
- if (project === null || project === void 0 ? void 0 : project.name) {
62
- allureTest.parameter("Project", project.name);
63
- }
64
- if (project.repeatEach > 1) {
65
- allureTest.parameter("Repetition", `${test.repeatEachIndex + 1}`);
66
- }
67
- const relativeFile = path_1.default.relative(project === null || project === void 0 ? void 0 : project.testDir, test.location.file).split(path_1.default.sep).join("/");
68
- const nameSuites = suiteTitles.length > 0 ? `${suiteTitles.join(" ")} ` : "";
69
- const fullName = `${relativeFile}#${nameSuites}${test.title}`;
70
- allureTest.fullName = fullName;
71
- allureTest.testCaseId = (0, allure_js_commons_1.md5)(fullName);
72
- this.allureTestCache.set(test, allureTest);
73
- }
74
- onStepBegin(test, _result, step) {
75
- var _a;
76
- const allureTest = this.allureTestCache.get(test);
77
- if (!allureTest) {
78
- return;
79
- }
80
- if (!this.options.detail && step.category !== "test.step") {
81
- return;
82
- }
83
- if (step.category === "attach") {
84
- return;
85
- }
86
- const allureStep = this.ensureAllureStepCreated(step, allureTest);
87
- const name = (_a = allureStep.wrappedItem) === null || _a === void 0 ? void 0 : _a.name;
88
- if (name === null || name === void 0 ? void 0 : name.match(stepAttachRegexp)) {
89
- allureStep.name = name.substring(stepAttachPrefixLength);
90
- this.allureAttachmentSteps.set(name, allureStep);
91
- }
92
- }
93
- onStepEnd(_test, _result, step) {
94
- const allureStep = this.allureStepCache.get(step);
95
- if (!allureStep) {
96
- return;
97
- }
98
- if (!this.options.detail && step.category !== "test.step") {
99
- return;
100
- }
101
- allureStep.endStep();
102
- allureStep.status = step.error ? allure_js_commons_1.Status.FAILED : allure_js_commons_1.Status.PASSED;
103
- if (step.error) {
104
- allureStep.statusDetails = getStatusDetails(step.error);
105
- }
106
- }
107
- async onTestEnd(test, result) {
108
- const runtime = this.getAllureRuntime();
109
- const allureTest = this.allureTestCache.get(test);
110
- if (!allureTest) {
111
- return;
112
- }
113
- const threadId = result.parallelIndex !== undefined ? result.parallelIndex : result.workerIndex;
114
- const thread = process_1.default.env.ALLURE_THREAD_NAME || `${this.hostname}-${process_1.default.pid}-playwright-worker-${threadId}`;
115
- allureTest.addLabel(allure_js_commons_1.LabelName.HOST, this.hostname);
116
- allureTest.addLabel(allure_js_commons_1.LabelName.THREAD, thread);
117
- allureTest.status = statusToAllureStats(result.status, test.expectedStatus);
118
- const error = result.error;
119
- if (error) {
120
- allureTest.statusDetails = getStatusDetails(error);
121
- }
122
- for (const attachment of result.attachments) {
123
- await this.processAttachment(attachment, allureTest, runtime);
124
- }
125
- if (result.stdout.length > 0) {
126
- allureTest.addAttachment("stdout", "text/plain", runtime.writeAttachment((0, allure_js_commons_1.stripAscii)(result.stdout.join("")), "text/plain"));
127
- }
128
- if (result.stderr.length > 0) {
129
- allureTest.addAttachment("stderr", "text/plain", runtime.writeAttachment((0, allure_js_commons_1.stripAscii)(result.stderr.join("")), "text/plain"));
130
- }
131
- const [, projectSuiteTitle, fileSuiteTitle, ...suiteTitles] = test.parent.titlePath();
132
- if (projectSuiteTitle && !hasLabel(allureTest, allure_js_commons_1.LabelName.PARENT_SUITE)) {
133
- allureTest.addLabel(allure_js_commons_1.LabelName.PARENT_SUITE, projectSuiteTitle);
134
- }
135
- if (this.options.suiteTitle && fileSuiteTitle && !hasLabel(allureTest, allure_js_commons_1.LabelName.SUITE)) {
136
- allureTest.addLabel(allure_js_commons_1.LabelName.SUITE, fileSuiteTitle);
137
- }
138
- if (suiteTitles.length > 0 && !hasLabel(allureTest, allure_js_commons_1.LabelName.SUB_SUITE)) {
139
- allureTest.addLabel(allure_js_commons_1.LabelName.SUB_SUITE, suiteTitles.join(" > "));
140
- }
141
- allureTest.calculateHistoryId();
142
- allureTest.endTest();
143
- }
144
- addSkippedResults() {
145
- const unprocessedCases = this.suite.allTests().filter((testCase) => !this.allureTestCache.has(testCase));
146
- unprocessedCases.forEach((testCase) => {
147
- this.onTestBegin(testCase);
148
- const allureTest = this.allureTestCache.get(testCase);
149
- if (allureTest) {
150
- allureTest.addLabel(allure_js_commons_1.LabelName.ALLURE_ID, "-1");
151
- allureTest.detailsMessage =
152
- "This test was skipped due to test setup error. Check you setup scripts to fix the issue.";
153
- }
154
- this.onTestEnd(testCase, {
155
- status: allure_js_commons_1.Status.SKIPPED,
156
- attachments: [],
157
- duration: 0,
158
- errors: [],
159
- parallelIndex: 0,
160
- workerIndex: 0,
161
- retry: 0,
162
- steps: [],
163
- stderr: [],
164
- stdout: [],
165
- startTime: this.globalStartTime,
166
- });
167
- });
168
- }
169
- onEnd() {
170
- var _a, _b, _c;
171
- this.addSkippedResults();
172
- for (const group of this.allureGroupCache.values()) {
173
- group.endGroup();
174
- }
175
- if (this.options.environmentInfo) {
176
- (_a = this.allureRuntime) === null || _a === void 0 ? void 0 : _a.writeEnvironmentInfo((_b = this.options) === null || _b === void 0 ? void 0 : _b.environmentInfo);
177
- }
178
- if (this.options.categories) {
179
- (_c = this.allureRuntime) === null || _c === void 0 ? void 0 : _c.writeCategoriesDefinitions(this.options.categories);
180
- }
181
- }
182
- printsToStdio() {
183
- return false;
184
- }
185
- getAllureRuntime() {
186
- if (!this.allureRuntime) {
187
- throw new Error("Unexpected state: `allureRuntime` is not initialized");
188
- }
189
- return this.allureRuntime;
190
- }
191
- ensureAllureGroupCreated(suite) {
192
- let group = this.allureGroupCache.get(suite);
193
- if (!group) {
194
- const parent = suite.parent ? this.ensureAllureGroupCreated(suite.parent) : this.getAllureRuntime();
195
- group = parent.startGroup(suite.title);
196
- this.allureGroupCache.set(suite, group);
197
- }
198
- return group;
199
- }
200
- ensureAllureStepCreated(step, allureTest) {
201
- let allureStep = this.allureStepCache.get(step);
202
- if (!allureStep) {
203
- const parent = step.parent ? this.ensureAllureStepCreated(step.parent, allureTest) : allureTest;
204
- allureStep = parent.startStep(step.title);
205
- this.allureStepCache.set(step, allureStep);
206
- }
207
- return allureStep;
208
- }
209
- findStep(stepName) {
210
- return this.allureAttachmentSteps.get(stepName);
211
- }
212
- async processAttachment(attachment, allureTest, runtime) {
213
- var _a, _b, _c, _d;
214
- if (!attachment.body && !attachment.path) {
215
- return;
216
- }
217
- if (attachment.contentType === internal_1.ALLURE_METADATA_CONTENT_TYPE) {
218
- if (!attachment.body) {
219
- return;
220
- }
221
- const metadata = JSON.parse(attachment.body.toString());
222
- (_a = metadata.links) === null || _a === void 0 ? void 0 : _a.forEach((val) => allureTest.addLink(val.url, val.name, val.type));
223
- (_b = metadata.labels) === null || _b === void 0 ? void 0 : _b.forEach((val) => allureTest.addLabel(val.name, val.value));
224
- (_c = metadata.parameter) === null || _c === void 0 ? void 0 : _c.forEach((val) => allureTest.parameter(val.name, val.value, {
225
- excluded: val.excluded,
226
- mode: val.mode,
227
- }));
228
- if (metadata.description) {
229
- allureTest.description = metadata.description;
230
- }
231
- return;
232
- }
233
- let fileName;
234
- if (attachment.body) {
235
- fileName = runtime.writeAttachment(attachment.body, attachment.contentType);
236
- }
237
- else {
238
- if (!fs_1.default.existsSync(attachment.path)) {
239
- return;
240
- }
241
- fileName = runtime.writeAttachmentFromPath(attachment.path, attachment.contentType);
242
- }
243
- let name;
244
- let attachmentContext;
245
- if (attachment.name.match(stepAttachRegexp)) {
246
- name = attachment.name.substring(stepAttachPrefixLength);
247
- const maybeStep = this.findStep(attachment.name);
248
- attachmentContext = maybeStep || allureTest;
249
- }
250
- else {
251
- name = attachment.name;
252
- attachmentContext = allureTest;
253
- }
254
- if (name.match(diffEndRegexp)) {
255
- const pathWithoutEnd = attachment.path.replace(diffEndRegexp, "");
256
- if (this.processedDiffs.includes(pathWithoutEnd)) {
257
- return;
258
- }
259
- const actualBase64 = await (0, allure_js_commons_1.readImageAsBase64)(`${pathWithoutEnd}-actual.png`), expectedBase64 = await (0, allure_js_commons_1.readImageAsBase64)(`${pathWithoutEnd}-expected.png`), diffBase64 = await (0, allure_js_commons_1.readImageAsBase64)(`${pathWithoutEnd}-diff.png`);
260
- const diffName = name.replace(diffEndRegexp, "");
261
- const res = (_d = this.allureRuntime) === null || _d === void 0 ? void 0 : _d.writeAttachment(JSON.stringify({
262
- expected: expectedBase64,
263
- actual: actualBase64,
264
- diff: diffBase64,
265
- name: diffName,
266
- }), { contentType: internal_1.ALLURE_IMAGEDIFF_CONTENT_TYPE, fileExtension: "imagediff" });
267
- attachmentContext.addAttachment(diffName, { contentType: internal_1.ALLURE_IMAGEDIFF_CONTENT_TYPE }, res);
268
- this.processedDiffs.push(pathWithoutEnd);
269
- }
270
- else {
271
- attachmentContext.addAttachment(name, attachment.contentType, fileName);
272
- }
273
- }
274
- }
275
- const statusToAllureStats = (status, expectedStatus) => {
276
- if (status === "skipped") {
277
- return allure_js_commons_1.Status.SKIPPED;
278
- }
279
- if (status === "timedOut") {
280
- return allure_js_commons_1.Status.BROKEN;
281
- }
282
- if (status === expectedStatus) {
283
- return allure_js_commons_1.Status.PASSED;
284
- }
285
- return allure_js_commons_1.Status.FAILED;
286
- };
287
- exports.default = AllureReporter;
288
- const appendStep = (parent, step) => {
289
- const allureStep = parent.startStep(step.title, step.startTime.getTime());
290
- allureStep.endStep(step.startTime.getTime() + step.duration);
291
- allureStep.status = step.error ? allure_js_commons_1.Status.FAILED : allure_js_commons_1.Status.PASSED;
292
- for (const child of step.steps || []) {
293
- appendStep(allureStep, child);
294
- }
295
- };
296
- const getStatusDetails = (error) => {
297
- const message = error.message && (0, allure_js_commons_1.stripAscii)(error.message);
298
- let trace = error.stack && (0, allure_js_commons_1.stripAscii)(error.stack);
299
- if (trace && message && trace.startsWith(`Error: ${message}`)) {
300
- trace = trace.substr(message.length + "Error: ".length);
301
- }
302
- return {
303
- message,
304
- trace,
305
- };
306
- };
307
- const hasLabel = (test, labelName) => {
308
- var _a;
309
- const wrappedItem = test.wrappedItem;
310
- if ("labels" in wrappedItem) {
311
- return ((_a = wrappedItem.labels) === null || _a === void 0 ? void 0 : _a.find((l) => l.name === labelName)) !== undefined;
312
- }
313
- return false;
314
- };
315
- __exportStar(require("./helpers"), exports);
316
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,4CAAoB;AACpB,4CAAoB;AACpB,gDAAwB;AACxB,sDAA8B;AAC9B,yDAkB2B;AAC3B,yDAAyG;AAEzG,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,MAAM,gBAAgB,GAAG,kDAAkD,CAAC;AAE5E,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAUlC,MAAM,cAAc;IAkBlB,YAAY,OAA8B;QAZlC,iBAAY,GAAG,iBAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC,IAAI,uCAAmB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAGrG,qBAAgB,GAAG,IAAI,GAAG,EAAsB,CAAC;QACjD,oBAAe,GAAG,IAAI,GAAG,EAAwB,CAAC;QAClD,oBAAe,GAAG,IAAI,GAAG,EAAwB,CAAC;QAClD,0BAAqB,GAAG,IAAI,GAAG,EAAsB,CAAC;QACtD,aAAQ,GAAW,iBAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,YAAE,CAAC,QAAQ,EAAE,CAAC;QACjE,oBAAe,GAAG,IAAI,IAAI,EAAE,CAAC;QAE7B,mBAAc,GAAa,EAAE,CAAC;QAGpC,IAAI,CAAC,OAAO,mBAAK,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,IAAK,OAAO,CAAE,CAAC;IAChE,CAAC;IAED,OAAO,CAAC,MAAkB,EAAE,KAAY;QACtC,IAAI,CAAC,MAAM,GAAG,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AAO,CAAA,MAAA,WAAW,CAAC,MAAM,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,MAAK,SAAS,CAAC;IAC7E,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,4CAA0B"}
package/dist/testplan.js DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.testPlanFilter = void 0;
4
- const allure_js_commons_1 = require("allure-js-commons");
5
- const testPlanFilter = () => {
6
- const testPlan = (0, allure_js_commons_1.parseTestPlan)();
7
- if (!testPlan) {
8
- return undefined;
9
- }
10
- return testPlan.tests.map((testInfo) => {
11
- const pattern = testInfo.selector.replace("#", " ");
12
- return new RegExp(`\\s${(0, allure_js_commons_1.escapeRegExp)(pattern)}$`);
13
- });
14
- };
15
- exports.testPlanFilter = testPlanFilter;
16
- //# sourceMappingURL=testplan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testplan.js","sourceRoot":"","sources":["../src/testplan.ts"],"names":[],"mappings":";;;AAAA,yDAAgE;AAEzD,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,QAAQ,GAAG,IAAA,iCAAa,GAAE,CAAC;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACpD,OAAO,IAAI,MAAM,CAAC,MAAM,IAAA,gCAAY,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAVW,QAAA,cAAc,kBAUzB"}
File without changes