[BUG] Tracing does not seem to work with `electron` support
See original GitHub issueContext:
- Playwright Version: 1.20.1
- Operating System: macOS
- Node.js version: 16.x
- Browser: Electron
Code Snippet
Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:
const { _electron: electron } = require('playwright');
(async () => {
// Launch Electron app.
const electronApp = await electron.launch({ args: ['main.js'] });
// Evaluation expression in the Electron context.
const appPath = await electronApp.evaluate(async ({ app }) => {
// This runs in the main Electron process, parameter here is always
// the result of the require('electron') in the main app script.
return app.getAppPath();
});
console.log(appPath);
// Get the first window that the app opens, wait if necessary.
const window = await electronApp.firstWindow();
await window.context().tracing.start({ name: 'ETracing', screenshots: true, snapshots: true });
// Print the title.
console.log(await window.title());
await new Promise(resolve => {
setTimeout(() => {
resolve();
}, 10000);
});
await window.context().tracing.stop({ path: '/Users/bpasero/Desktop/elec-playwright/trace.zip' });
// Direct Electron console to Node terminal.
window.on('console', console.log);
// Click button.
await window.click('text=Click me');
// Exit app.
await electronApp.close();
})();
Describe the bug
I start Electron and the window opens and I start to click around and the trace is created after 10 seconds, but it contains no screenshots.
Attaching the trace for reference:
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Bug #1944468 “Electron applications all crash upon launch”
It would be very bad if Electron apps failed to function when 21.10 is released.
Read more >Cannot make API requests with XMLHttpRequest in Electron
In my opinion, this is a bug/issue with Electron, not Bitbucket Server, and I think it's reasonable to work around it on that...
Read more >Crash when attempting to print note (Ubuntu 22.04, deb ...
So, looks like it's not an Electron's bug. It could be an environment-dependent issue. I can see it failed to initialize a sandbox...
Read more >Electron isn't Cancer but it is a Symptom of a Disease
Granted it doesn't have the performance or resource utilization of an Electron app and I'd say it's a better citizen on the platforms...
Read more >How to properly debug Electron memory issues?
Another thing to mention is that it's not necessarily a memory ... It seems to me that Electron can use an absurd amount...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I was able to revive my old branch and clean it up with latest and also verified that tracing does work (so I am fine closing this issue).
PR is up at https://github.com/microsoft/vscode/pull/146692 to verify the changes, so far I have not seen flakiness (did a test run of 7 across our platforms) 🤞 🤞
Happy to share our use of
playwrightin a meeting and get some feedback if we can improve things 👍I’d prefer to have someone with a real Electron app to test.
Let’s allocate some time and hack something together, it could be cool!