@testsmith/testblocks 0.8.5 → 0.8.6

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.
@@ -544,6 +544,18 @@ class TestExecutor {
544
544
  stack: err.stack,
545
545
  };
546
546
  }
547
+ // Capture screenshot on failure if page is available
548
+ let screenshot;
549
+ if (status === 'failed' && this.page) {
550
+ try {
551
+ const buffer = await this.page.screenshot({ type: 'png' });
552
+ screenshot = `data:image/png;base64,${buffer.toString('base64')}`;
553
+ }
554
+ catch (screenshotError) {
555
+ // Silently ignore screenshot errors
556
+ console.debug('Failed to capture screenshot:', screenshotError);
557
+ }
558
+ }
547
559
  const result = {
548
560
  stepId: step.id,
549
561
  stepType: step.type,
@@ -551,6 +563,7 @@ class TestExecutor {
551
563
  duration: Date.now() - startTime,
552
564
  output,
553
565
  error,
566
+ screenshot,
554
567
  };
555
568
  for (const plugin of this.plugins.values()) {
556
569
  if (plugin.hooks?.afterStep) {
package/dist/cli/index.js CHANGED
@@ -443,7 +443,7 @@ program
443
443
  'test:ci': 'testblocks run tests/**/*.testblocks.json -r console,html,junit -o reports',
444
444
  },
445
445
  devDependencies: {
446
- '@testsmith/testblocks': '^0.8.5',
446
+ '@testsmith/testblocks': '^0.8.6',
447
447
  },
448
448
  };
449
449
  fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testsmith/testblocks",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Visual test automation tool with Blockly - API and Playwright testing",
5
5
  "author": "Roy de Kleijn",
6
6
  "license": "MIT",