microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
65.6k stars 3.57k forks source link

[Feature] Ability to test printing #2236

Closed aslushnikov closed 4 years ago

aslushnikov commented 4 years ago

As of today (Playwright v1.0.1), Chromium's page.pdf() method does not work in headful mode. This is an upstream issue and might require investment from our side, if it proves to be bothering our users.

pavelfeldman commented 4 years ago

Side note: I can see that the original issue wanted to test printing, not generate pdfs.

shirshak55 commented 4 years ago

blocked by https://bugs.chromium.org/p/chromium/issues/detail?id=706008 ?

shirshak55 commented 4 years ago

@aslushnikov I guess this is not going to be fixed at upstream.

https://bugs.chromium.org/p/chromium/issues/detail?id=753118

It was reported on Aug 8, 2017 and there is no activity or intention to fix it so i think patching would be good solution atm?

pavelfeldman commented 4 years ago

so i think patching would be good solution atm

@shirshak55: could you elaborate on what 'patching' you have in mind?

shirshak55 commented 4 years ago

"In this case we can intercept IPCs in content instead of headless, or expose API between content/ and components/printing, or inject a protocol-based handler (through components/printing API) from ChromeDevToolsManagerDelegate" ?

You submitted this patch right? https://chromium-review.googlesource.com/c/chromium/src/+/592608

Cannot we patch similar to this for printing also?

pavelfeldman commented 4 years ago

@shirshak Yes, the patch is mine and the comment belongs to another Playwright team member, so sure we can do that. But it is a sizeable effort with the limited impact, so we will prioritize based on the user feedback!

aslushnikov commented 4 years ago

This feature didn't accumulate a lot of excitement in the 3 months of its existence 🤷‍♂️ Definitely not enough to justify the required upstream work.

Closing for now.