@arghajit/dummy 0.3.41 → 0.3.42
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.
|
@@ -601,7 +601,8 @@ class PlaywrightPulseReporter {
|
|
|
601
601
|
else {
|
|
602
602
|
// Logic for appending/merging reports
|
|
603
603
|
const pulseResultsDir = path.join(this.outputDir, this.individualReportsSubDir);
|
|
604
|
-
const
|
|
604
|
+
const shardPrefix = this.baseOutputFile.replace(".json", "-");
|
|
605
|
+
const individualReportPath = path.join(pulseResultsDir, `${shardPrefix}${Date.now()}.json`);
|
|
605
606
|
try {
|
|
606
607
|
await this._ensureDirExists(pulseResultsDir);
|
|
607
608
|
await fs.writeFile(individualReportPath, JSON.stringify(finalReport, jsonReplacer, 2));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arghajit/dummy",
|
|
3
3
|
"author": "Arghajit Singha",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.42",
|
|
5
5
|
"description": "A Playwright reporter and dashboard for visualizing test results.",
|
|
6
6
|
"homepage": "https://arghajit47.github.io/playwright-pulse/",
|
|
7
7
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"bin": {
|
|
38
|
-
"logo": "
|
|
38
|
+
"logo": "scripts/terminal-logo.mjs",
|
|
39
39
|
"generate-pulse-report": "scripts/generate-static-report.mjs",
|
|
40
40
|
"generate-report": "scripts/generate-report.mjs",
|
|
41
41
|
"merge-pulse-report": "scripts/merge-pulse-report.mjs",
|
|
@@ -36,7 +36,7 @@ async function extractReporterOptionsFromConfig(configPath) {
|
|
|
36
36
|
try {
|
|
37
37
|
// Find the Pulse/Dummy reporter block
|
|
38
38
|
// It usually looks like ["@arghajit/playwright-pulse-report", { ... }] or ["playwright-pulse-report", { ... }]
|
|
39
|
-
const reporterBlockRegex = /\[\s*["'](?:@arghajit\/)?(?:playwright-pulse-report|dummy)["']\s*,\s*(\{[\s\S]*?\})\s*\]/g;
|
|
39
|
+
const reporterBlockRegex = /\[\s*["'](?:@arghajit\/)?(?:playwright-pulse-report|dummy)["']\s*,\s*(\{[\s\S]*?\})\s*,?\s*\]/g;
|
|
40
40
|
let match;
|
|
41
41
|
while ((match = reporterBlockRegex.exec(fileContent)) !== null) {
|
|
42
42
|
const block = match[1];
|
|
@@ -4,8 +4,8 @@ import * as path from "path";
|
|
|
4
4
|
import { getReporterConfig } from "./config-reader.mjs";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Reads all
|
|
8
|
-
* and merges them into a single
|
|
7
|
+
* Reads all `<outputFile>-*.json` files in the `pulse-results` directory
|
|
8
|
+
* and merges them into a single `<outputFile>.json`.
|
|
9
9
|
* It resolves duplicate tests using exactly the same logic as the reporter.
|
|
10
10
|
*
|
|
11
11
|
* @param {string} customOutputDir The base report directory override (from CLI).
|
|
@@ -25,12 +25,15 @@ export async function mergeSequentialReportsIfNeeded(customOutputDir) {
|
|
|
25
25
|
const pulseResultsDir = path.join(outputDir, individualReportsSubDir);
|
|
26
26
|
const finalOutputPath = path.join(outputDir, baseOutputFile);
|
|
27
27
|
|
|
28
|
+
// Use the actual outputFile name as seed for shard files (e.g. "results.json" -> "results-")
|
|
29
|
+
const shardPrefix = baseOutputFile.replace(".json", "-");
|
|
30
|
+
|
|
28
31
|
let reportFiles;
|
|
29
32
|
try {
|
|
30
33
|
const allFiles = await fs.readdir(pulseResultsDir);
|
|
31
34
|
reportFiles = allFiles.filter(
|
|
32
35
|
(file) =>
|
|
33
|
-
file.startsWith(
|
|
36
|
+
file.startsWith(shardPrefix) && file.endsWith(".json"),
|
|
34
37
|
);
|
|
35
38
|
} catch (error) {
|
|
36
39
|
if (error.code === "ENOENT") {
|
|
@@ -64,7 +67,7 @@ export async function mergeSequentialReportsIfNeeded(customOutputDir) {
|
|
|
64
67
|
const content = await fs.readFile(filePath, "utf-8");
|
|
65
68
|
const json = JSON.parse(content);
|
|
66
69
|
|
|
67
|
-
let currentRunId = `run-${Date.now()}
|
|
70
|
+
let currentRunId = `run-${Date.now()}`;
|
|
68
71
|
if (json.run) {
|
|
69
72
|
if (json.run.id) currentRunId = json.run.id;
|
|
70
73
|
|
|
@@ -99,7 +102,7 @@ export async function mergeSequentialReportsIfNeeded(customOutputDir) {
|
|
|
99
102
|
);
|
|
100
103
|
|
|
101
104
|
const combinedRun = {
|
|
102
|
-
id: `run-${Date.now()}
|
|
105
|
+
id: `run-${Date.now()}`,
|
|
103
106
|
timestamp: latestTimestamp.toISOString(),
|
|
104
107
|
environment: lastRunEnvironment,
|
|
105
108
|
totalTests: finalMergedResults.length,
|