playwright-slack-report-burak 3.0.16 → 3.0.17

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.
@@ -341,14 +341,48 @@ class SlackReporter {
341
341
  this.log(`🔍 MATRIX_INDEX: ${process.env.MATRIX_INDEX !== undefined ? `"${process.env.MATRIX_INDEX}"` : 'undefined'}`);
342
342
  this.log(`🔍 MATRIX_COUNT: ${process.env.MATRIX_COUNT !== undefined ? `"${process.env.MATRIX_COUNT}"` : 'undefined'}`);
343
343
 
344
+ // Check for Playwright shard environment variables (Playwright may set these)
345
+ this.log(`🔍 PLAYWRIGHT_SHARD: ${process.env.PLAYWRIGHT_SHARD !== undefined ? `"${process.env.PLAYWRIGHT_SHARD}"` : 'undefined'}`);
346
+
344
347
  // Check Playwright's shard config (highest priority for local runs)
345
348
  let playwrightShardInfo = null;
346
- if (this.fullConfig && this.fullConfig.shard) {
347
- playwrightShardInfo = {
348
- current: this.fullConfig.shard.current,
349
- total: this.fullConfig.shard.total
350
- };
351
- this.log(`🔍 [Shard Detection] Found Playwright shard config: ${playwrightShardInfo.current}/${playwrightShardInfo.total}`);
349
+ if (this.fullConfig) {
350
+ // Debug: log config structure
351
+ this.log(`🔍 [Shard Detection] Checking Playwright config for shard info...`);
352
+ this.log(`🔍 fullConfig.shard: ${this.fullConfig.shard ? JSON.stringify(this.fullConfig.shard) : 'undefined'}`);
353
+
354
+ if (this.fullConfig.shard) {
355
+ // Playwright shard can be either { current, total } or undefined
356
+ if (this.fullConfig.shard.current !== undefined && this.fullConfig.shard.total !== undefined) {
357
+ playwrightShardInfo = {
358
+ current: this.fullConfig.shard.current,
359
+ total: this.fullConfig.shard.total
360
+ };
361
+ this.log(`🔍 [Shard Detection] Found Playwright shard config: ${playwrightShardInfo.current}/${playwrightShardInfo.total}`);
362
+ } else {
363
+ this.log(`🔍 [Shard Detection] Playwright shard config exists but missing current/total properties`);
364
+ }
365
+ } else {
366
+ this.log(`🔍 [Shard Detection] No Playwright shard config found in fullConfig`);
367
+ }
368
+ } else {
369
+ this.log(`🔍 [Shard Detection] fullConfig not available`);
370
+ }
371
+
372
+ // Also check if shard info is in process.argv (command line)
373
+ // This is a fallback if config doesn't have it but --shard was passed
374
+ if (!playwrightShardInfo && process.argv) {
375
+ const shardArg = process.argv.find(arg => arg && arg.includes('--shard'));
376
+ if (shardArg) {
377
+ const shardMatch = shardArg.match(/--shard[=:]?(\d+)\/(\d+)/);
378
+ if (shardMatch) {
379
+ playwrightShardInfo = {
380
+ current: parseInt(shardMatch[1], 10),
381
+ total: parseInt(shardMatch[2], 10)
382
+ };
383
+ this.log(`🔍 [Shard Detection] Found shard in command line args: ${playwrightShardInfo.current}/${playwrightShardInfo.total}`);
384
+ }
385
+ }
352
386
  }
353
387
 
354
388
  // Step 1: Try GitHub Actions API detection (only if actually in GitHub Actions)
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.16",
35
+ "version": "3.0.17",
36
36
  "main": "index.js",
37
37
  "types": "dist/index.d.ts",
38
38
  "author": "Burak B. <burak.boluk@hotmail.com>",