playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
2.17k stars 160 forks source link

[Feature]: Better support for CI and local development #502

Open cedric-appdirect opened 4 days ago

cedric-appdirect commented 4 days ago

Does the upstream have similar features? playwright-go is just a community-driven client for playwright. For feature requests, please refer to other officially supported clients first. Nodejs / Java / .Net / Python

Upstream doesn't have such feature, but implementing it in playwright-go might be easier due to the golang ecosystem.

Is your feature request related to a problem? Please describe. When doing development with playwright-go and testing screenshot difference between CI (usually Linux) and local environment (usually Windows and MacOS). Solution to this is to setup a remote browser solution, but this create additional complexity. It is usually assumed that if things render in one OS, they will render close enough on any other OS.

Describe the solution you'd like Automate the creation of a browser in a docker container locally and proxy all communication to enable local and CI tests to have the same result. I do have the code to do exactly that using testcontainer-go and goproxy, but before starting a PR, knowing if there is interest and how to shape it would be best.

Additional context So how it work:

Overall it is maybe around 100 lines of code, but there is a lot of quirks to know about to get this working. It would be better if this is included in playwright-go directly.

Benefit, 100% pixels match between CI and local as they run in exactly the same environment.

canstand commented 1 day ago

I prefer to do this in a new repo, since it doesn't matter whether the client is playwright-go or playwright-python.

And might it evolve into a community alternative to some of the features of the Playwright Testing Service?