@arghajit/dummy 0.1.2-beta-6 → 0.1.2-beta-7
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.
|
@@ -23,7 +23,7 @@ export declare class PlaywrightPulseReporter implements Reporter {
|
|
|
23
23
|
private _getBaseTestId;
|
|
24
24
|
private _getStatusOrder;
|
|
25
25
|
/**
|
|
26
|
-
* Modified: Groups all run attempts for a single logical test case.
|
|
26
|
+
* Modified: Groups all run attempts for a single logical test case and updates flaky status.
|
|
27
27
|
* This ensures that tests with multiple retries are counted as single test case
|
|
28
28
|
* while preserving all retry data in the JSON report.
|
|
29
29
|
* @param allAttempts An array of all individual test run attempts.
|
|
@@ -328,7 +328,7 @@ class PlaywrightPulseReporter {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
/**
|
|
331
|
-
* Modified: Groups all run attempts for a single logical test case.
|
|
331
|
+
* Modified: Groups all run attempts for a single logical test case and updates flaky status.
|
|
332
332
|
* This ensures that tests with multiple retries are counted as single test case
|
|
333
333
|
* while preserving all retry data in the JSON report.
|
|
334
334
|
* @param allAttempts An array of all individual test run attempts.
|
|
@@ -345,17 +345,31 @@ class PlaywrightPulseReporter {
|
|
|
345
345
|
}
|
|
346
346
|
const finalResults = [];
|
|
347
347
|
for (const [baseId, runs] of groupedResults.entries()) {
|
|
348
|
-
|
|
349
|
-
runs.sort((a, b) => this._getStatusOrder(a.status) - this._getStatusOrder(b.status));
|
|
350
|
-
const bestRun = runs[0];
|
|
351
|
-
let overallStatus = bestRun.status;
|
|
348
|
+
let overallStatus = "passed";
|
|
352
349
|
if (runs.length > 1) {
|
|
353
|
-
const hasPassedRun = runs.some(
|
|
354
|
-
const hasFailedRun = runs.some(
|
|
350
|
+
const hasPassedRun = runs.some(run => run.status === "passed");
|
|
351
|
+
const hasFailedRun = runs.some(run => run.status === "failed");
|
|
355
352
|
if (hasPassedRun && hasFailedRun) {
|
|
356
353
|
overallStatus = "flaky";
|
|
354
|
+
runs.forEach(run => {
|
|
355
|
+
if (run.status === "passed" || run.status === "failed") {
|
|
356
|
+
run.status = "flaky";
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
else if (hasFailedRun) {
|
|
361
|
+
overallStatus = "failed";
|
|
357
362
|
}
|
|
363
|
+
else if (runs.some(run => run.status === "skipped")) {
|
|
364
|
+
overallStatus = "skipped";
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
overallStatus = runs[0].status;
|
|
358
369
|
}
|
|
370
|
+
// Sort runs to find the best representative run for metadata
|
|
371
|
+
runs.sort((a, b) => this._getStatusOrder(a.status) - this._getStatusOrder(b.status));
|
|
372
|
+
const bestRun = runs[0];
|
|
359
373
|
// Calculate total duration from the earliest start to the latest end time of all runs
|
|
360
374
|
const startTimes = runs.map((run) => run.startTime.getTime());
|
|
361
375
|
const endTimes = runs.map((run) => run.endTime.getTime());
|
package/package.json
CHANGED