Skip to content
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] a hook mechanism to augment cross-cutting logic #4390

Closed
devalex88 opened this issue Nov 10, 2020 · 6 comments
Closed

[Feature] a hook mechanism to augment cross-cutting logic #4390

devalex88 opened this issue Nov 10, 2020 · 6 comments

Comments

@devalex88
Copy link

Hi Playwright developers. Thank you so much for this great framework. One thing I would love to see in Playwright is the ability to intercept commands send to browsers for handling some cross-cutting concerns such as logging. Is it currently available or in the roadmap?

@pavelfeldman
Copy link
Member

Could you share more about your goal?

@devalex88
Copy link
Author

@pavelfeldman I'm looking for something like this https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/support/events/WebDriverEventListener.html. As an example I would be able to capture the screenshots after every page.click().

@pavelfeldman
Copy link
Member

Got it. For screenshots to work, you need async hooks that we await for and we don't have those. It is a fine idea though, so I'm leaving this open as a feature request.

@pavelfeldman pavelfeldman changed the title [Question] Is there any hook mechanism to intercept commands sent to browsers? [Feature] a hook mechanism to augment cross-cutting logic Nov 12, 2020
@devalex88
Copy link
Author

Thank you @pavelfeldman. Just to clarify, did you mean that non-async hooks were available?

@pavelfeldman
Copy link
Member

No, I just meant to say that we would need hooks to be async as we are implementing them.

@pavelfeldman
Copy link
Member

Closing this as a part of the triage, please feel free to file a new issue with additional details. Given the limited resource and a lot of requests, we need to fulfill most popular requests and at the same time keep our issue database manageable.

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

No branches or pull requests

2 participants