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.
@@ -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
- // Extract blob files before merging (Playwright merge-reports expects extracted blob directories)
485
- // We'll extract them temporarily for merging, then extract again for resource copying
486
- const tempMergeDir = path.join(NODE_ARTIFACTS_DIR, 'temp-merge');
487
- if (!fs.existsSync(tempMergeDir)) {
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 zip = new AdmZip(blobZipFile);
502
- zip.extractAllTo(tempMergeDir, true);
503
- console.log(`Extracted blob-report-node-${i}.zip for merging`);
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 extract blob-report-node-${i}.zip for merging:`, error.message);
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 tempMergeDir INTO finalOutput
511
- exec(`npx playwright merge-reports --reporter html ${tempMergeDir} ${FINAL_OUTPUT_DIR}`);
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
@@ -32,7 +32,7 @@
32
32
  "lint-fix": "npx eslint . --ext .ts --fix"
33
33
  },
34
34
  "name": "playwright-slack-report-burak",
35
- "version": "3.0.34",
35
+ "version": "3.0.35",
36
36
  "main": "index.js",
37
37
  "types": "dist/index.d.ts",
38
38
  "author": "Burak B. <burak.boluk@hotmail.com>",