-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] console events for electron app #5905
Comments
We are actually thinking about going the other way around elsewhere. How do you use the sink? Does DEBUG= not work for you? |
Hey @pavelfeldman I would like to use logger in order to assert things within tests, so I would push the logs in an array and assert that the expected string exists in that array, The DEBUG flag won't help me with this |
Issue is that currently we can only get the logs from renderer with the |
@sirtimid: would it work if you had something like page.on('console') on the electronApp object? |
@pavelfeldman yeah, for sure, it would be even better TBH! |
Is there any way to get at electron main logs from the launched process? It seems like otherwise it'd be hard to debug fails on headless tests |
I also need this API to retrieve logs from the main process, for the same reasons as @sirtimid. Are there any timelines for this? |
It does seem to collect the stdout and stderr of the launched electron process, but I can't work out how to access them via the public APIs. |
To safe anyone from going through the same rabbit hole I just did, this works with the latest playwright 1.24.1: const app = await electron.launch({ args: ['main.js'] });
app.process().stdout.on('data', (data) => console.log(`stdout: ${data}`));
app.process().stderr.on('data', (error) => console.log`stderr: ${error}`)); From #13267 (comment) and #13280 |
@Prinzhorn This doesn't seems to be working in |
Thanks so much for mentioning this new feature! Unfortunately, this doesn't output all
You can only access the |
Is there any progress on this one? Has someone maybe found a workaround? I experience the same issue as @fcastilloec, where logs before loading are not accessible. edit: I would also like to get the logs of the renderer process, not only the main process. |
It would be great if we could use the the pluggable logger sink for Electron tests as well. :)
The text was updated successfully, but these errors were encountered: