playwright-ctrf-json-reporter 0.0.23 → 0.0.24
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 +4 -3
- package/dist/generate-report.d.ts +0 -1
- package/dist/generate-report.js +9 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,11 +21,12 @@ A Playwright JSON test reporter to create test reports that follow the CTRF stan
|
|
|
21
21
|
</a>
|
|
22
22
|
</div>
|
|
23
23
|
</div>
|
|
24
|
-
|
|
25
24
|
<p style="font-size: 14px; margin: 1rem 0;">
|
|
26
|
-
|
|
25
|
+
|
|
27
26
|
Contributions are very welcome! <br/>
|
|
28
|
-
Explore more <a href="https://www.ctrf.io/integrations">integrations</a>
|
|
27
|
+
Explore more <a href="https://www.ctrf.io/integrations">integrations</a> <br/>
|
|
28
|
+
We’d love your feedback, share it anonymously <a href="https://app.formbricks.com/s/cmefs524mhlh1tl01gkpvefrb">here</a>.
|
|
29
|
+
|
|
29
30
|
</p>
|
|
30
31
|
</div>
|
|
31
32
|
|
|
@@ -45,7 +45,6 @@ declare class GenerateCtrfReport implements Reporter {
|
|
|
45
45
|
updateStart(startTime: Date): number;
|
|
46
46
|
calculateStopTime(startTime: Date, duration: number): number;
|
|
47
47
|
buildSuitePath(test: TestCase): string;
|
|
48
|
-
extractTagsFromTitle(title: string): string[];
|
|
49
48
|
extractScreenshotBase64(testResult: TestResult): string | undefined;
|
|
50
49
|
extractFailureDetails(testResult: TestResult): Partial<CtrfTest>;
|
|
51
50
|
countSuites(suite: Suite): number;
|
package/dist/generate-report.js
CHANGED
|
@@ -111,10 +111,12 @@ class GenerateCtrfReport {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
updateCtrfTestResultsFromTestResult(testCase, testResult, ctrfReport) {
|
|
114
|
-
var _a, _b, _c, _d, _e;
|
|
114
|
+
var _a, _b, _c, _d, _e, _f;
|
|
115
115
|
const test = {
|
|
116
116
|
name: testCase.title,
|
|
117
|
-
status:
|
|
117
|
+
status: testResult.status === testCase.expectedStatus
|
|
118
|
+
? 'passed'
|
|
119
|
+
: this.mapPlaywrightStatusToCtrf(testResult.status),
|
|
118
120
|
duration: testResult.duration,
|
|
119
121
|
};
|
|
120
122
|
if (this.reporterConfigOptions.minimal === false) {
|
|
@@ -124,8 +126,8 @@ class GenerateCtrfReport {
|
|
|
124
126
|
test.trace = this.extractFailureDetails(testResult).trace;
|
|
125
127
|
test.snippet = this.extractFailureDetails(testResult).snippet;
|
|
126
128
|
test.rawStatus = testResult.status;
|
|
127
|
-
test.tags =
|
|
128
|
-
test.type = (
|
|
129
|
+
test.tags = (_a = testCase.tags) !== null && _a !== void 0 ? _a : [];
|
|
130
|
+
test.type = (_b = this.reporterConfigOptions.testType) !== null && _b !== void 0 ? _b : 'e2e';
|
|
129
131
|
test.filePath = testCase.location.file;
|
|
130
132
|
test.retries = testResult.retry;
|
|
131
133
|
test.flaky = testResult.status === 'passed' && testResult.retry > 0;
|
|
@@ -139,9 +141,9 @@ class GenerateCtrfReport {
|
|
|
139
141
|
test.screenshot = this.extractScreenshotBase64(testResult);
|
|
140
142
|
}
|
|
141
143
|
test.suite = this.buildSuitePath(testCase);
|
|
142
|
-
if (((
|
|
143
|
-
((
|
|
144
|
-
test.browser = `${(
|
|
144
|
+
if (((_c = this.extractMetadata(testResult)) === null || _c === void 0 ? void 0 : _c.name) !== undefined ||
|
|
145
|
+
((_d = this.extractMetadata(testResult)) === null || _d === void 0 ? void 0 : _d.version) !== undefined)
|
|
146
|
+
test.browser = `${(_e = this.extractMetadata(testResult)) === null || _e === void 0 ? void 0 : _e.name} ${(_f = this.extractMetadata(testResult)) === null || _f === void 0 ? void 0 : _f.version}`;
|
|
145
147
|
test.attachments = this.filterValidAttachments(testResult.attachments);
|
|
146
148
|
test.stdout = testResult.stdout.map((item) => Buffer.isBuffer(item) ? item.toString() : String(item));
|
|
147
149
|
test.stderr = testResult.stderr.map((item) => Buffer.isBuffer(item) ? item.toString() : String(item));
|
|
@@ -273,11 +275,6 @@ class GenerateCtrfReport {
|
|
|
273
275
|
}
|
|
274
276
|
return pathComponents.join(' > ');
|
|
275
277
|
}
|
|
276
|
-
extractTagsFromTitle(title) {
|
|
277
|
-
const tagPattern = /@\w+/g;
|
|
278
|
-
const tags = title.match(tagPattern);
|
|
279
|
-
return tags !== null && tags !== void 0 ? tags : [];
|
|
280
|
-
}
|
|
281
278
|
extractScreenshotBase64(testResult) {
|
|
282
279
|
var _a;
|
|
283
280
|
const screenshotAttachment = testResult.attachments.find((attachment) => attachment.name === 'screenshot' &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-ctrf-json-reporter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "A Playwright JSON test reporter to create test results reports",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"author": "Matthew Thomas",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@playwright/test": "^1.
|
|
23
|
+
"@playwright/test": "^1.55.0",
|
|
24
24
|
"@types/jest": "^29.5.6",
|
|
25
25
|
"@types/node": "^20.8.7",
|
|
26
26
|
"@typescript-eslint/eslint-plugin": "^6.12.0",
|