allure-playwright 2.0.0-beta.14 → 2.0.0-beta.17

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/README.md CHANGED
@@ -7,7 +7,9 @@ This project implements Allure integration with [Playwright Test](https://playwr
7
7
  ```bash
8
8
  npm i -D @playwright/test allure-playwright
9
9
  ```
10
+
10
11
  or via yarn:
12
+
11
13
  ```bash
12
14
  yarn add @playwright/test allure-playwright --dev
13
15
  ```
@@ -18,7 +20,15 @@ Either add **allure-playwright** into **playwright.config.ts**:
18
20
 
19
21
  ```js
20
22
  {
21
- reporter: 'allure-playwright'
23
+ reporter: "allure-playwright";
24
+ }
25
+ ```
26
+
27
+ Or pass the same value via config file:
28
+
29
+ ```js
30
+ {
31
+ reporter: [['line'], ['allure-playwright']]
22
32
  }
23
33
  ```
24
34
 
@@ -31,12 +41,123 @@ npx playwright test --reporter=line,allure-playwright
31
41
  Specify location for allure results:
32
42
 
33
43
  Mac / Linux
44
+
34
45
  ```bash
35
46
  ALLURE_RESULTS_DIR=my-allure-results npx playwright test --reporter=line,allure-playwright
36
47
  ```
37
48
 
38
49
  Windows
50
+
39
51
  ```bash
40
52
  set ALLURE_RESULTS_DIR=my-allure-results
41
53
  npx playwright test --reporter=line,allure-playwright
42
54
  ```
55
+
56
+ or inside the config via:
57
+
58
+ ```js
59
+ const config = {
60
+ reporter: [ ['allure-playwright', { outputFolder: 'my-allure-results' }] ],
61
+ };
62
+ ```
63
+
64
+ Generate Allure Report:
65
+ ```bash
66
+ allure generate my-allure-results -o allure-report --clean
67
+ ```
68
+
69
+ Open Allure Report:
70
+ ```bash
71
+ allure open allure-report
72
+ ```
73
+
74
+ ## Proving extra information
75
+
76
+ You can use allure labels to provide extra information about tests such via
77
+
78
+ - label
79
+ - link
80
+ - id
81
+ - epic
82
+ - feature
83
+ - story
84
+ - suite
85
+ - parentSuite
86
+ - subSuite
87
+ - owner
88
+ - severity
89
+ - tag
90
+ - issue
91
+ - tms
92
+
93
+ ### Labels Usage
94
+
95
+ ```js
96
+ import { test, expect } from "@playwright/test";
97
+ import { allure, LabelName } from "allure-playwright";
98
+
99
+ test("basic test", async ({ page }, testInfo) => {
100
+ allure.label({ name: LabelName.LANGUAGE, value: "typescript" });
101
+ });
102
+ ```
103
+ ### Links Usage
104
+
105
+ ```js
106
+ import { test, expect } from "@playwright/test";
107
+ import { allure } from "allure-playwright";
108
+
109
+ test("basic test", async ({ page }, testInfo) => {
110
+ allure.link({ url: "https://playwright.dev", name: "playwright-site" });
111
+ allure.issue({
112
+ url: "https://github.com/allure-framework/allure-js/issues/352",
113
+ name: "Target issue",
114
+ });
115
+ });
116
+ ```
117
+
118
+ ### Id Usage
119
+
120
+ ```js
121
+ import { test, expect } from "@playwright/test";
122
+ import { allure, LabelName } from "allure-playwright";
123
+
124
+ test("basic test", async ({ page }, testInfo) => {
125
+ allure.id("Some id");
126
+ });
127
+ ```
128
+
129
+ ### Epics Usage
130
+
131
+ ```js
132
+ import { test, expect } from "@playwright/test";
133
+ import { allure } from "allure-playwright";
134
+
135
+ test("basic test", async ({ page }, testInfo) => {
136
+ allure.epic("Some Epic");
137
+ });
138
+ ```
139
+
140
+ ### Stories Usage
141
+
142
+ ```js
143
+ import { test, expect } from "@playwright/test";
144
+ import { allure } from "allure-playwright";
145
+
146
+ test("basic test", async ({ page }, testInfo) => {
147
+ allure.story("Some Story");
148
+ });
149
+ ```
150
+
151
+
152
+
153
+ ### Attachments Usage
154
+
155
+ ```js
156
+ import { test, expect } from "@playwright/test";
157
+
158
+ test("basic test", async ({ page }, testInfo) => {
159
+ const path = testInfo.outputPath("screenshot.png");
160
+ await page.screenshot({ path });
161
+ testInfo.attachments.push({ name: "screenshot", path, contentType: "image/png" });
162
+ });
163
+ ```
@@ -0,0 +1,26 @@
1
+ import { Label, Link } from "allure-js-commons";
2
+ export declare const ALLURE_METADATA_CONTENT_TYPE = "application/vnd.allure.metadata+json";
3
+ export interface Metadata {
4
+ labels?: Label[];
5
+ links?: Link[];
6
+ description?: string;
7
+ }
8
+ export declare class allure {
9
+ static addMetadataAttachment(metadata: Metadata): void;
10
+ static label(label: Label | Label[]): void;
11
+ static description(value: string): void;
12
+ static link(link: Link): void;
13
+ static id(id: string): void;
14
+ static epic(epic: string): void;
15
+ static feature(epic: string): void;
16
+ static story(story: string): void;
17
+ static suite(name: string): void;
18
+ static parentSuite(name: string): void;
19
+ static subSuite(name: string): void;
20
+ static owner(owner: string): void;
21
+ static severity(severity: string): void;
22
+ static tag(...tags: string[]): void;
23
+ static issue(issueData: Omit<Link, "type">): void;
24
+ static tms(issueData: Omit<Link, "type">): void;
25
+ }
26
+ export { LabelName } from "allure-js-commons";
@@ -0,0 +1,112 @@
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 = exports.ALLURE_METADATA_CONTENT_TYPE = void 0;
7
+ const test_1 = __importDefault(require("@playwright/test"));
8
+ const allure_js_commons_1 = require("allure-js-commons");
9
+ exports.ALLURE_METADATA_CONTENT_TYPE = "application/vnd.allure.metadata+json";
10
+ class allure {
11
+ static addMetadataAttachment(metadata) {
12
+ test_1.default.info().attach("allure-metadata.json", {
13
+ contentType: exports.ALLURE_METADATA_CONTENT_TYPE,
14
+ body: Buffer.from(JSON.stringify(metadata), "utf8"),
15
+ });
16
+ }
17
+ static label(label) {
18
+ this.addMetadataAttachment({
19
+ labels: Array.isArray(label) ? label : [label],
20
+ });
21
+ }
22
+ static description(value) {
23
+ this.addMetadataAttachment({
24
+ description: value,
25
+ });
26
+ }
27
+ static link(link) {
28
+ this.addMetadataAttachment({
29
+ links: Array.isArray(link) ? link : [link],
30
+ });
31
+ }
32
+ static id(id) {
33
+ this.label({
34
+ value: id,
35
+ name: allure_js_commons_1.LabelName.AS_ID,
36
+ });
37
+ }
38
+ static epic(epic) {
39
+ this.label({
40
+ name: allure_js_commons_1.LabelName.EPIC,
41
+ value: epic,
42
+ });
43
+ }
44
+ static feature(epic) {
45
+ this.label({
46
+ name: allure_js_commons_1.LabelName.FEATURE,
47
+ value: epic,
48
+ });
49
+ }
50
+ static story(story) {
51
+ this.label({
52
+ name: allure_js_commons_1.LabelName.STORY,
53
+ value: story,
54
+ });
55
+ }
56
+ static suite(name) {
57
+ this.label({
58
+ name: allure_js_commons_1.LabelName.SUITE,
59
+ value: name,
60
+ });
61
+ }
62
+ static parentSuite(name) {
63
+ this.label({
64
+ name: allure_js_commons_1.LabelName.PARENT_SUITE,
65
+ value: name,
66
+ });
67
+ }
68
+ static subSuite(name) {
69
+ this.label({
70
+ name: allure_js_commons_1.LabelName.SUB_SUITE,
71
+ value: name,
72
+ });
73
+ }
74
+ static owner(owner) {
75
+ this.label({
76
+ name: allure_js_commons_1.LabelName.OWNER,
77
+ value: owner,
78
+ });
79
+ }
80
+ static severity(severity) {
81
+ this.label({
82
+ name: allure_js_commons_1.LabelName.SEVERITY,
83
+ value: severity,
84
+ });
85
+ }
86
+ static tag(...tags) {
87
+ for (const tag of tags) {
88
+ this.label({
89
+ name: allure_js_commons_1.LabelName.TAG,
90
+ value: tag,
91
+ });
92
+ }
93
+ }
94
+ static issue(issueData) {
95
+ this.link({
96
+ url: issueData.url,
97
+ name: issueData.name,
98
+ type: allure_js_commons_1.LinkType.ISSUE,
99
+ });
100
+ }
101
+ static tms(issueData) {
102
+ this.link({
103
+ url: issueData.url,
104
+ name: issueData.name,
105
+ type: allure_js_commons_1.LinkType.TMS,
106
+ });
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;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;aACX,CAAC,CAAC;SACJ;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,SAA6B;QACxC,IAAI,CAAC,IAAI,CAAC;YACR,GAAG,EAAE,SAAS,CAAC,GAAG;YAClB,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,IAAI,EAAE,4BAAQ,CAAC,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,SAA6B;QACtC,IAAI,CAAC,IAAI,CAAC;YACR,GAAG,EAAE,SAAS,CAAC,GAAG;YAClB,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,IAAI,EAAE,4BAAQ,CAAC,GAAG;SACnB,CAAC,CAAC;IACL,CAAC;CACF;AAjHD,wBAiHC;AAED,uDAA8C;AAArC,8GAAA,SAAS,OAAA"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,28 @@
1
1
  import { FullConfig } from "@playwright/test";
2
- import { Reporter, Suite } from "@playwright/test/reporter";
2
+ import { Reporter, Suite, TestCase, TestResult, TestStep } from "@playwright/test/reporter";
3
+ declare type AllureReporterOptions = {
4
+ outputFolder?: string;
5
+ };
3
6
  declare class AllureReporter implements Reporter {
4
7
  config: FullConfig;
5
8
  suite: Suite;
9
+ resultsDir: string;
10
+ options: AllureReporterOptions;
11
+ private allureWriter;
12
+ private allureRuntime;
13
+ private allureGroupCache;
14
+ private allureTestCache;
15
+ private allureStepCache;
16
+ constructor(options?: AllureReporterOptions);
6
17
  onBegin(config: FullConfig, suite: Suite): void;
7
- onTimeout(): void;
18
+ onTestBegin(test: TestCase): void;
19
+ onStepBegin(test: TestCase, _result: TestResult, step: TestStep): void;
20
+ onStepEnd(_test: TestCase, _result: TestResult, step: TestStep): void;
21
+ onTestEnd(test: TestCase, result: TestResult): void;
8
22
  onEnd(): void;
23
+ private getAllureRuntime;
24
+ private ensureAllureGroupCreated;
25
+ private ensureAllureStepCreated;
9
26
  }
10
27
  export default AllureReporter;
28
+ export * from "./helpers";
package/dist/index.js CHANGED
@@ -1,4 +1,14 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
2
12
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
14
  };
@@ -6,101 +16,174 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
16
  const fs_1 = __importDefault(require("fs"));
7
17
  const path_1 = __importDefault(require("path"));
8
18
  const allure_js_commons_1 = require("allure-js-commons");
19
+ const helpers_1 = require("./helpers");
9
20
  class AllureReporter {
21
+ constructor(options = {}) {
22
+ this.allureWriter = process.env.PW_ALLURE_POST_PROCESSOR_FOR_TEST
23
+ ? new allure_js_commons_1.InMemoryAllureWriter()
24
+ : undefined;
25
+ this.allureGroupCache = new Map();
26
+ this.allureTestCache = new Map();
27
+ this.allureStepCache = new Map();
28
+ this.options = options;
29
+ }
10
30
  onBegin(config, suite) {
11
31
  this.config = config;
12
32
  this.suite = suite;
33
+ this.resultsDir = allureReportFolder(this.options.outputFolder);
34
+ this.allureRuntime = new allure_js_commons_1.AllureRuntime({
35
+ resultsDir: this.resultsDir,
36
+ writer: this.allureWriter,
37
+ });
13
38
  }
14
- onTimeout() {
15
- this.onEnd();
39
+ onTestBegin(test) {
40
+ const suite = test.parent;
41
+ const group = this.ensureAllureGroupCreated(suite);
42
+ const allureTest = group.startTest(test.title);
43
+ allureTest.addLabel(allure_js_commons_1.LabelName.LANGUAGE, "JavaScript");
44
+ allureTest.addLabel(allure_js_commons_1.LabelName.FRAMEWORK, "Playwright");
45
+ const [, projectSuiteTitle, fileSuiteTitle, ...suiteTitles] = suite.titlePath();
46
+ if (projectSuiteTitle) {
47
+ allureTest.addLabel(allure_js_commons_1.LabelName.PARENT_SUITE, projectSuiteTitle);
48
+ }
49
+ if (fileSuiteTitle) {
50
+ allureTest.addLabel(allure_js_commons_1.LabelName.SUITE, fileSuiteTitle);
51
+ }
52
+ if (suiteTitles.length > 0) {
53
+ allureTest.addLabel(allure_js_commons_1.LabelName.SUB_SUITE, suiteTitles.join(" > "));
54
+ }
55
+ allureTest.historyId = test.titlePath().slice(1).join(" ");
56
+ allureTest.fullName = test.title;
57
+ this.allureTestCache.set(test, allureTest);
16
58
  }
17
- onEnd() {
18
- const writerForTest = process.env.PW_ALLURE_POST_PROCESSOR_FOR_TEST
19
- ? new allure_js_commons_1.InMemoryAllureWriter()
20
- : undefined;
21
- const resultsDir = process.env.ALLURE_RESULTS_DIR || path_1.default.join(process.cwd(), "allure-results");
22
- const runtime = new allure_js_commons_1.AllureRuntime({ resultsDir, writer: writerForTest });
23
- const processSuite = (suite, parent) => {
24
- const groupName = "Root";
25
- const group = parent.startGroup(groupName);
26
- for (const test of suite.tests) {
27
- for (const result of test.results) {
28
- const startTime = result.startTime.getTime();
29
- const endTime = startTime + result.duration;
30
- const allureTest = group.startTest(test.title, startTime);
31
- allureTest.addLabel(allure_js_commons_1.LabelName.LANGUAGE, "JavaScript");
32
- allureTest.addLabel(allure_js_commons_1.LabelName.FRAMEWORK, "Playwright");
33
- const [, projectSuiteTitle, fileSuiteTitle, ...suiteTitles] = suite.titlePath();
34
- if (projectSuiteTitle) {
35
- allureTest.addLabel(allure_js_commons_1.LabelName.PARENT_SUITE, projectSuiteTitle);
36
- }
37
- if (fileSuiteTitle) {
38
- allureTest.addLabel(allure_js_commons_1.LabelName.SUITE, fileSuiteTitle);
39
- }
40
- if (suiteTitles.length > 0) {
41
- allureTest.addLabel(allure_js_commons_1.LabelName.SUB_SUITE, suiteTitles.join(" > "));
42
- }
43
- allureTest.historyId = test.titlePath().slice(1).join(" ");
44
- allureTest.fullName = test.title;
45
- allureTest.status = statusToAllureStats(result.status, test.expectedStatus);
46
- if (result.error) {
47
- const message = result.error.message && stripAscii(result.error.message);
48
- let trace = result.error.stack && stripAscii(result.error.stack);
49
- if (trace && message && trace.startsWith(`Error: ${message}`)) {
50
- trace = trace.substr(message.length + "Error: ".length);
51
- }
52
- allureTest.statusDetails = {
53
- message,
54
- trace,
55
- };
56
- }
57
- for (const step of result.steps) {
58
- appendStep(allureTest, step);
59
- }
60
- for (const attachment of result.attachments) {
61
- if (!attachment.body && !attachment.path) {
62
- continue;
63
- }
64
- let fileName;
65
- if (attachment.body) {
66
- fileName = runtime.writeAttachment(attachment.body, attachment.contentType);
67
- }
68
- else {
69
- if (!fs_1.default.existsSync(attachment.path)) {
70
- continue;
71
- }
72
- fileName = runtime.writeAttachmentFromPath(attachment.path, attachment.contentType);
73
- }
74
- allureTest.addAttachment(attachment.name, attachment.contentType, fileName);
75
- if (attachment.name === "diff") {
76
- allureTest.addLabel("testType", "screenshotDiff");
77
- }
78
- }
79
- for (const stdout of result.stdout) {
80
- allureTest.addAttachment("stdout", "text/plain", runtime.writeAttachment(stdout, "text/plain"));
81
- }
82
- for (const stderr of result.stderr) {
83
- allureTest.addAttachment("stderr", "text/plain", runtime.writeAttachment(stderr, "text/plain"));
84
- }
85
- allureTest.endTest(endTime);
59
+ onStepBegin(test, _result, step) {
60
+ const allureTest = this.allureTestCache.get(test);
61
+ if (!allureTest) {
62
+ return;
63
+ }
64
+ this.ensureAllureStepCreated(step, allureTest);
65
+ }
66
+ onStepEnd(_test, _result, step) {
67
+ const allureStep = this.allureStepCache.get(step);
68
+ if (!allureStep) {
69
+ return;
70
+ }
71
+ allureStep.endStep();
72
+ allureStep.status = step.error ? allure_js_commons_1.Status.FAILED : allure_js_commons_1.Status.PASSED;
73
+ }
74
+ onTestEnd(test, result) {
75
+ var _a, _b;
76
+ const runtime = this.getAllureRuntime();
77
+ const allureTest = this.allureTestCache.get(test);
78
+ if (!allureTest) {
79
+ return;
80
+ }
81
+ allureTest.status = statusToAllureStats(result.status, test.expectedStatus);
82
+ if (result.error) {
83
+ const message = result.error.message && stripAscii(result.error.message);
84
+ let trace = result.error.stack && stripAscii(result.error.stack);
85
+ if (trace && message && trace.startsWith(`Error: ${message}`)) {
86
+ trace = trace.substr(message.length + "Error: ".length);
87
+ }
88
+ allureTest.statusDetails = {
89
+ message,
90
+ trace,
91
+ };
92
+ }
93
+ for (const attachment of result.attachments) {
94
+ if (!attachment.body && !attachment.path) {
95
+ continue;
96
+ }
97
+ if (attachment.contentType === helpers_1.ALLURE_METADATA_CONTENT_TYPE) {
98
+ if (!attachment.body) {
99
+ continue;
100
+ }
101
+ const metadata = JSON.parse(attachment.body.toString());
102
+ (_a = metadata.links) === null || _a === void 0 ? void 0 : _a.forEach((val) => allureTest.addLink(val.url, val.name, val.type));
103
+ (_b = metadata.labels) === null || _b === void 0 ? void 0 : _b.forEach((val) => allureTest.addLabel(val.name, val.value));
104
+ if (metadata.description) {
105
+ allureTest.description = metadata.description;
106
+ }
107
+ continue;
108
+ }
109
+ let fileName;
110
+ if (attachment.body) {
111
+ fileName = runtime.writeAttachment(attachment.body, attachment.contentType);
112
+ }
113
+ else {
114
+ if (!fs_1.default.existsSync(attachment.path)) {
115
+ continue;
86
116
  }
117
+ fileName = runtime.writeAttachmentFromPath(attachment.path, attachment.contentType);
118
+ }
119
+ if (attachment.name.endsWith("-expected.png")) {
120
+ allureTest.addAttachment("expected", attachment.contentType, fileName);
121
+ }
122
+ else if (attachment.name.endsWith("-actual.png")) {
123
+ allureTest.addAttachment("actual", attachment.contentType, fileName);
87
124
  }
88
- for (const child of suite.suites) {
89
- processSuite(child, group);
125
+ else if (attachment.name.endsWith("-diff.png")) {
126
+ allureTest.addAttachment("diff", attachment.contentType, fileName);
90
127
  }
128
+ else {
129
+ allureTest.addAttachment(attachment.name, attachment.contentType, fileName);
130
+ }
131
+ if (attachment.name === "diff" || attachment.name.endsWith("-diff.png")) {
132
+ allureTest.addLabel("testType", "screenshotDiff");
133
+ }
134
+ }
135
+ for (const stdout of result.stdout) {
136
+ allureTest.addAttachment("stdout", "text/plain", runtime.writeAttachment(stdout, "text/plain"));
137
+ }
138
+ for (const stderr of result.stderr) {
139
+ allureTest.addAttachment("stderr", "text/plain", runtime.writeAttachment(stderr, "text/plain"));
140
+ }
141
+ allureTest.endTest();
142
+ }
143
+ onEnd() {
144
+ for (const group of this.allureGroupCache.values()) {
91
145
  group.endGroup();
92
- };
93
- processSuite(this.suite, runtime);
146
+ }
94
147
  if (process.env.PW_ALLURE_POST_PROCESSOR_FOR_TEST) {
95
148
  try {
149
+ const writer = this.allureWriter;
150
+ void writer;
96
151
  const postProcess = eval(process.env.PW_ALLURE_POST_PROCESSOR_FOR_TEST);
97
- console.log(JSON.stringify(postProcess(writerForTest)));
152
+ console.log(JSON.stringify(postProcess(this.allureWriter)));
98
153
  }
99
154
  catch (e) {
100
- console.log(JSON.stringify({ error: e.toString() }));
155
+ console.log(JSON.stringify({ error: e.stack || String(e) }));
101
156
  }
102
157
  }
103
158
  }
159
+ getAllureRuntime() {
160
+ if (!this.allureRuntime) {
161
+ throw new Error("Unexpected state: `allureRuntime` is not initialized");
162
+ }
163
+ return this.allureRuntime;
164
+ }
165
+ ensureAllureGroupCreated(suite) {
166
+ let group = this.allureGroupCache.get(suite);
167
+ if (!group) {
168
+ const parent = suite.parent
169
+ ? this.ensureAllureGroupCreated(suite.parent)
170
+ : this.getAllureRuntime();
171
+ group = parent.startGroup(suite.title);
172
+ this.allureGroupCache.set(suite, group);
173
+ }
174
+ return group;
175
+ }
176
+ ensureAllureStepCreated(step, allureTest) {
177
+ let allureStep = this.allureStepCache.get(step);
178
+ if (!allureStep) {
179
+ const parent = step.parent
180
+ ? this.ensureAllureStepCreated(step.parent, allureTest)
181
+ : allureTest;
182
+ allureStep = parent.startStep(step.title);
183
+ this.allureStepCache.set(step, allureStep);
184
+ }
185
+ return allureStep;
186
+ }
104
187
  }
105
188
  const statusToAllureStats = (status, expectedStatus) => {
106
189
  if (status === "skipped") {
@@ -127,4 +210,17 @@ const appendStep = (parent, step) => {
127
210
  appendStep(allureStep, child);
128
211
  }
129
212
  };
213
+ const allureReportFolder = (outputFolder) => {
214
+ if (process.env.ALLURE_RESULTS_DIR) {
215
+ return path_1.default.resolve(process.cwd(), process.env.ALLURE_RESULTS_DIR);
216
+ }
217
+ if (outputFolder) {
218
+ return outputFolder;
219
+ }
220
+ return defaultReportFolder();
221
+ };
222
+ const defaultReportFolder = () => {
223
+ return path_1.default.resolve(process.cwd(), "allure-results");
224
+ };
225
+ __exportStar(require("./helpers"), exports);
130
226
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAgBA,4CAAoB;AACpB,gDAAwB;AAGxB,yDAQ2B;AAE3B,MAAM,cAAc;IAIlB,OAAO,CAAC,MAAkB,EAAE,KAAY;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,SAAS;QACP,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,KAAK;QACH,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iCAAiC;YACjE,CAAC,CAAC,IAAI,wCAAoB,EAAE;YAC5B,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;QAChG,MAAM,OAAO,GAAG,IAAI,iCAAa,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;QACzE,MAAM,YAAY,GAAG,CAAC,KAAY,EAAE,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,CAAC,MAAM,CAAC;IAC/D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE;QACpC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;KAC/B;AACH,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,YAAqB,EAAU,EAAE;IAC3D,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE;QAClC,OAAO,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;KACpE;IACD,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAC;KACrB;IACD,OAAO,mBAAmB,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,GAAW,EAAE;IACvC,OAAO,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,4CAA0B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allure-playwright",
3
- "version": "2.0.0-beta.14",
3
+ "version": "2.0.0-beta.17",
4
4
  "description": "Allure Playwright integration",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -23,14 +23,14 @@
23
23
  "lint:fix": "eslint ./src --ext .ts --fix"
24
24
  },
25
25
  "devDependencies": {
26
- "@playwright/test": "=1.14.1",
26
+ "@playwright/test": "^1.22.0",
27
27
  "eslint": "^7.32.0",
28
28
  "prettier": "^2.3.2",
29
29
  "rimraf": "^3.0.2",
30
30
  "typescript": "^4.4.2"
31
31
  },
32
32
  "dependencies": {
33
- "allure-js-commons": "2.0.0-beta.14"
33
+ "allure-js-commons": "2.0.0-beta.17"
34
34
  },
35
35
  "files": [
36
36
  "dist"