Skip to content

fix(electron): enable screenshot-on-failure for Electron apps#40058

Open
Glisa060 wants to merge 2 commits intomicrosoft:mainfrom
Glisa060:fix-electron-screenshot-on-failure
Open

fix(electron): enable screenshot-on-failure for Electron apps#40058
Glisa060 wants to merge 2 commits intomicrosoft:mainfrom
Glisa060:fix-electron-screenshot-on-failure

Conversation

@Glisa060
Copy link
Copy Markdown

@Glisa060 Glisa060 commented Apr 4, 2026

Summary

  • Track Electron contexts in Playwright._allContexts() so the test runner's SnapshotRecorder can capture screenshots from Electron windows on test failure
  • Fire runAfterCreateBrowserContext instrumentation hook for Electron contexts to enable tracing/artifact collection
  • Clean up tracking on Electron app close
  • Add e2e test verifying screenshot: 'only-on-failure' produces test-failed-1.png for Electron apps

cc @pavelfeldman

Glisa060 added 2 commits April 5, 2026 00:10
Track Electron contexts in Playwright._allContexts() so the test
runner's SnapshotRecorder can capture screenshots from Electron
windows on test failure.
Verifies that screenshot: 'only-on-failure' produces test-failed-1.png
when an Electron test fails.
@Glisa060
Copy link
Copy Markdown
Author

Glisa060 commented Apr 5, 2026

@Glisa060 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@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.

1 participant