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
66.98k stars 3.68k forks source link

[Feature]: Show webserver logs #32626

Open Skn0tt opened 2 months ago

Skn0tt commented 2 months ago

🚀 Feature Request

We should be showing the logs emitted by the webServer process somewhere.

Example

See the foo log line:

Screenshot 2024-09-14 at 10 37 59

Motivation

As the pendulum swings back to server-side, the webserver becomes more important in debugging. Showing the log output is great for introspection.

Skn0tt commented 2 months ago

I've demo'd this yesterday at our team meeting, and folks liked it. My demo was nothing but a hack, and i've spiked at actually implementing it now. Hit some open questions:

Skn0tt commented 2 months ago

Also some more thoughts around the potential of this: If Playwright attached some sort of correlation token to each of the executed actions, and that was passed through all the way to the webserver (this part needs framework support), then we could show which server logs were emitted by what actions. Pavel said there's already a spec for this from the Chrome folks, but it didn't get picked up widely.