playwright-slack-report-burak 3.0.34 → 3.0.35
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/src/ResultsParser.js +12 -17
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ try {
|
|
|
21
21
|
const SUMMARIES_DIR = path.join('./', 'playwright-report');
|
|
22
22
|
const NODE_ARTIFACTS_DIR = path.join(SUMMARIES_DIR, 'nodeArtifacts');
|
|
23
23
|
const FINAL_OUTPUT_DIR = path.join(SUMMARIES_DIR, 'finalOutput');
|
|
24
|
+
const TEMP_MERGE_DIR = path.join(NODE_ARTIFACTS_DIR, 'temp-merge');
|
|
24
25
|
|
|
25
26
|
class ResultsParser {
|
|
26
27
|
result;
|
|
@@ -481,34 +482,28 @@ class ResultsParser {
|
|
|
481
482
|
fs.mkdirSync(FINAL_OUTPUT_DIR, { recursive: true });
|
|
482
483
|
}
|
|
483
484
|
|
|
484
|
-
//
|
|
485
|
-
// We'll
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
fs.mkdirSync(tempMergeDir, { recursive: true });
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
// Extract all blob zip files to temp directory for merging
|
|
492
|
-
if (!AdmZip) {
|
|
493
|
-
console.error('adm-zip is required for blob extraction. Please install it: npm install adm-zip');
|
|
494
|
-
return;
|
|
485
|
+
// Copy blob files before merging (Playwright merge-reports expects blob files)
|
|
486
|
+
// We'll copy them temporarily for merging, then extract later for resource copying
|
|
487
|
+
if (!fs.existsSync(TEMP_MERGE_DIR)) {
|
|
488
|
+
fs.mkdirSync(TEMP_MERGE_DIR, { recursive: true });
|
|
495
489
|
}
|
|
496
490
|
|
|
491
|
+
// Copy all blob zip files to temp directory for merging
|
|
497
492
|
for (let i = 1; i <= this.totalShardCount; i++) {
|
|
498
493
|
const blobZipFile = path.join(NODE_ARTIFACTS_DIR, `blob-report-node-${i}.zip`);
|
|
499
494
|
if (fs.existsSync(blobZipFile)) {
|
|
500
495
|
try {
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
console.log(`
|
|
496
|
+
const destFile = path.join(TEMP_MERGE_DIR, `blob-report-node-${i}.zip`);
|
|
497
|
+
fs.copyFileSync(blobZipFile, destFile);
|
|
498
|
+
console.log(`Copied blob-report-node-${i}.zip for merging`);
|
|
504
499
|
} catch (error) {
|
|
505
|
-
console.warn(`Failed to
|
|
500
|
+
console.warn(`Failed to copy blob-report-node-${i}.zip for merging:`, error.message);
|
|
506
501
|
}
|
|
507
502
|
}
|
|
508
503
|
}
|
|
509
504
|
|
|
510
|
-
// Execute the command to merge reports FROM
|
|
511
|
-
exec(`npx playwright merge-reports --reporter html ${
|
|
505
|
+
// Execute the command to merge reports FROM TEMP_MERGE_DIR INTO finalOutput
|
|
506
|
+
exec(`npx playwright merge-reports --reporter html ${TEMP_MERGE_DIR} ${FINAL_OUTPUT_DIR}`);
|
|
512
507
|
|
|
513
508
|
// Wait until index.html exists in finalOutput
|
|
514
509
|
while (!fs.existsSync(path.join(FINAL_OUTPUT_DIR, 'index.html'))) {
|
package/package.json
CHANGED