-
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 ourterms of serviceand privacy statement.We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: [Custom Reporters] Custom IPC communication between runner process and main process possible? #31559
Comments
We have multiple ways of communicating between our workers and the reporters as of today: Stdout / Stderr: You seem to already using it as of today. You can e.g. filter out output there if you users are only using your reporter. Marking it as a feature request for now |
It might be that i do not fully understand the details of attachments, annotations and the steps. But as per my understanding they would need to be put into the test code. This is not what I would like to achieve, I want to just run a defined test as is and react in the reporter on custom events. Currently the implementation via stdout works but has the mentioned caveats. I would appreciate to have something similar like onStdout for events, something like onEvent. Looking forward to see where this is going with my feature request:) |
Where do you currently emit the events from inside your worker? |
My library internally works with events. Currently whenever an event is caught, it turns it into a message to stdout. This all happens within the worker itself. Instead of writing to std I would like to pass the message on to the IPC to main so that I can then catch it there. If it helps we could have a quick chat on the playwright discord server. |
Maybe you could offer something like sendCustomEvent (IPC) on the worker and in the reporter onCustomEvent? |
🚀 Feature Request
During runtime the main process spawns worker processes to run the actual tests. A solution is required which allows to use the playwright internal IPC communication between runner and main to forward custom messages which can be listened to when building custom reporters. The current implementation and interface options are not sufficient or rather more lack those capabilities.
Example
No response
Motivation
I am maintainer of a library which wraps playwright into screenplay pattern. (https://www.npmjs.com/package/@testla/screenplay-playwright)
Since playwright is part of the absolute core of the lib, I wanted to use its reporter capabilities to build an own report which represents all the screenplay steps executed during runtime.
This may look like the following example:
As per the Reporter interface which my custom reporter is built on I have access to stdout - so my current solution is build on stdout messages which I extract and process. Since printing to stdout is slowing down the execution quite a bit and spams a lot of messages I need an easy way to access the playwrights internal IPC to utilize it to forward custom events from worker to main so that I can get rid of the stdout solution.
The text was updated successfully, but these errors were encountered: