π Feature Request
Related PR: #41502 (closed β ready to reopen once this issue is accepted)
Replace the empty catch {} in ArtifactsRecorder._takePageSnapshot with a debugLogger.log call so that AI snapshot failures during error context capture are observable via DEBUG=pw:api.
Location: packages/playwright/src/index.ts:747
- } catch {}
+ } catch {
+ debugLogger.log('api', 'ariaSnapshot: failed to capture snapshot during error (may be expected)');
+ }
Example
In a large test suite (500+ tests, AI mode enabled), some failing tests produce error-context.md without an aria snapshot. Today there is no way to tell whether the snapshot was never attempted or failed silently.
After this change, running with DEBUG=pw:api would show:
pw:api ariaSnapshot: failed to capture snapshot during error (may be expected) +0ms
No change to user-facing behavior β the original test error still propagates. The debug log is purely for troubleshooting.
Motivation
_takePageSnapshot is best-effort artifact collection. When it fails, the failure should be observable. Currently the empty catch {} makes it impossible to distinguish "snapshot was never attempted" from "snapshot failed due to timeout/network/model error." A single debugLogger.log call provides this visibility without changing control flow or adding noise for regular users.
π Feature Request
Replace the empty
catch {}inArtifactsRecorder._takePageSnapshotwith adebugLogger.logcall so that AI snapshot failures during error context capture are observable viaDEBUG=pw:api.Location:
packages/playwright/src/index.ts:747Example
In a large test suite (500+ tests, AI mode enabled), some failing tests produce
error-context.mdwithout an aria snapshot. Today there is no way to tell whether the snapshot was never attempted or failed silently.After this change, running with
DEBUG=pw:apiwould show:No change to user-facing behavior β the original test error still propagates. The debug log is purely for troubleshooting.
Motivation
_takePageSnapshotis best-effort artifact collection. When it fails, the failure should be observable. Currently the emptycatch {}makes it impossible to distinguish "snapshot was never attempted" from "snapshot failed due to timeout/network/model error." A singledebugLogger.logcall provides this visibility without changing control flow or adding noise for regular users.