playwright-ctrf-json-reporter 0.0.21 → 0.0.22
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/generate-report.js +14 -0
- package/package.json +1 -1
package/dist/generate-report.js
CHANGED
|
@@ -142,6 +142,20 @@ class GenerateCtrfReport {
|
|
|
142
142
|
if (this.reporterConfigOptions.annotations !== undefined) {
|
|
143
143
|
test.extra = { annotations: testCase.annotations };
|
|
144
144
|
}
|
|
145
|
+
if (testCase.results.length > 1) {
|
|
146
|
+
const retryResults = testCase.results.slice(0, -1);
|
|
147
|
+
test.retryAttempts = [];
|
|
148
|
+
for (const retryResult of retryResults) {
|
|
149
|
+
const retryAttempt = {
|
|
150
|
+
status: this.mapPlaywrightStatusToCtrf(retryResult.status),
|
|
151
|
+
duration: retryResult.duration,
|
|
152
|
+
message: this.extractFailureDetails(retryResult).message,
|
|
153
|
+
trace: this.extractFailureDetails(retryResult).trace,
|
|
154
|
+
snippet: this.extractFailureDetails(retryResult).snippet,
|
|
155
|
+
};
|
|
156
|
+
test.retryAttempts.push(retryAttempt);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
145
159
|
}
|
|
146
160
|
ctrfReport.results.tests.push(test);
|
|
147
161
|
}
|