Skip to content

feat(test-runner): log aria snapshot failures during error context capture#41626

Open
pradapjackie wants to merge 1 commit into
microsoft:mainfrom
pradapjackie:feat/aria-snapshot-debug-log
Open

feat(test-runner): log aria snapshot failures during error context capture#41626
pradapjackie wants to merge 1 commit into
microsoft:mainfrom
pradapjackie:feat/aria-snapshot-debug-log

Conversation

@pradapjackie

Copy link
Copy Markdown

Fixes #41536.

Summary

  • Replace empty catch {} in ArtifactsRecorder._takePageSnapshot with debugLogger.log('api', ...)
  • Include the caught error in the log message so snapshot failures are easier to diagnose
  • Add a test that verifies the log appears when running with DEBUG=pw:api

Motivation

When a test fails, Playwright best-effort captures an AI aria snapshot for error-context.md. If that capture fails (timeout, page closing, etc.), the failure was previously swallowed silently. With DEBUG=pw:api, it is now observable.

No change to user-facing behavior for normal runs.

Test plan

  • npm run eslint -- packages/playwright/src/index.ts tests/playwright-test/playwright.spec.ts
  • npm run ttest -- tests/playwright-test/playwright.spec.ts -g "should log aria snapshot failures"

…pture

Replace empty catch in _takePageSnapshot with debugLogger.log under pw:api
so best-effort snapshot failures are observable when debugging.
Fixes microsoft#41536.
@pradapjackie pradapjackie force-pushed the feat/aria-snapshot-debug-log branch from 76f1e0d to 18ccdc5 Compare July 5, 2026 14:23
@pradapjackie

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add debug logging to _takePageSnapshot catch block

1 participant