@arghajit/dummy 0.1.2-beta-5 → 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
- // Sort runs to find the best status (passed > flaky > failed > skipped)
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((run) => run.status === "passed");
354
- const hasFailedRun = runs.some((run) => run.status === "failed");
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());
@@ -441,10 +455,10 @@ class PlaywrightPulseReporter {
441
455
  }
442
456
  return value;
443
457
  };
444
- const properlyTypedResults = JSON.parse(JSON.stringify(finalResultsList), reviveDates);
458
+ const properlyTypedResults = JSON.parse(JSON.stringify(allShardRawResults), reviveDates);
445
459
  return {
446
460
  run: finalRunData,
447
- results: properlyTypedResults,
461
+ results: properlyTypedResults, // Fixed: Include ALL retry attempts
448
462
  metadata: { generatedAt: new Date().toISOString() },
449
463
  };
450
464
  }
@@ -606,7 +620,7 @@ class PlaywrightPulseReporter {
606
620
  }
607
621
  }
608
622
  const finalMergedResults = this._getFinalizedResults(allResultsFromAllFiles);
609
- for (const res of finalMergedResults) {
623
+ for (const res of allResultsFromAllFiles) {
610
624
  if (res.startTime.getTime() < earliestStartTime)
611
625
  earliestStartTime = res.startTime.getTime();
612
626
  if (res.endTime.getTime() > latestEndTime)
@@ -626,7 +640,7 @@ class PlaywrightPulseReporter {
626
640
  };
627
641
  const finalReport = {
628
642
  run: combinedRun,
629
- results: finalMergedResults,
643
+ results: allResultsFromAllFiles, // Fixed: Include ALL retry attempts
630
644
  metadata: {
631
645
  generatedAt: new Date().toISOString(),
632
646
  },
@@ -638,7 +652,7 @@ class PlaywrightPulseReporter {
638
652
  return value;
639
653
  }, 2));
640
654
  if (this.printsToStdio()) {
641
- console.log(`PlaywrightPulseReporter: ✅ Merged report with ${finalMergedResults.length} total results saved to ${finalOutputPath}`);
655
+ console.log(`PlaywrightPulseReporter: ✅ Merged report with ${allResultsFromAllFiles.length} total retry attempts (${finalMergedResults.length} unique tests) saved to ${finalOutputPath}`);
642
656
  }
643
657
  }
644
658
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arghajit/dummy",
3
- "version": "0.1.2-beta-5",
3
+ "version": "0.1.2-beta-7",
4
4
  "description": "A Playwright reporter and dashboard for visualizing test results.",
5
5
  "homepage": "https://playwright-pulse-report.netlify.app/",
6
6
  "keywords": [