playwright-slack-report-burak 2.2.0 → 2.2.2

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.
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const fs = require('fs');
10
10
  const path = require('path');
11
11
  const axios = require('axios');
12
- const { execSync } = require('child_process');
12
+ const { exec } = require('child_process');
13
13
 
14
14
  class ResultsParser {
15
15
  result;
@@ -116,10 +116,8 @@ class ResultsParser {
116
116
  }
117
117
  }
118
118
  this.mergeReports();
119
- return summary;
120
- } else {
121
- return { stopReporter: true, currentShardIndex: this.shardIndex, totalShardCount: this.totalShardCount };
122
119
  }
120
+ return summary;
123
121
  }
124
122
  async getFailures() {
125
123
  const failures = [];
@@ -333,8 +331,12 @@ class ResultsParser {
333
331
  mergeReports() {
334
332
  try {
335
333
  // Execute the command to merge reports
336
- execSync(`npx playwright merge-reports --reporter html -c ./playwright-report playwright-report`);
337
- //new Promise(resolve => setTimeout(resolve, 5000));
334
+ exec(`npx playwright merge-reports --reporter html -c ./playwright-report playwright-report`);
335
+ // Wait until index.html exists
336
+ while (!fs.existsSync(path.join('./playwright-report', 'index.html'))) {
337
+ console.log('Waiting for merged html report to be generated...');
338
+ setTimeout(() => {}, 3000);
339
+ }
338
340
  console.log('Reports merged successfully.');
339
341
  console.log('Contents of playwright-report:', fs.readdirSync('./playwright-report'));
340
342
  } catch (error) {
package/package.json CHANGED
@@ -30,7 +30,7 @@
30
30
  "lint-fix": "npx eslint . --ext .ts --fix"
31
31
  },
32
32
  "name": "playwright-slack-report-burak",
33
- "version": "2.2.0",
33
+ "version": "2.2.2",
34
34
  "main": "index.js",
35
35
  "types": "dist/index.d.ts",
36
36
  "repository": "git@github.com:ryanrosello-og/playwright-slack-report.git",