Repository navigation
Support remote Playwright server - #307
Propaganistas wants to merge 5 commits into
Conversation
|
Putting in draft; it works for regular remote connections but not yet for containerized servers (the container can't reach the Laravel server yet) |
|
Putting back to ready for review. Had to expose http server config as well to allow the service container be able to connect to the local Laravel http server. The Playwright server version should match the installed version Pest will use. Here’s a run that consciously had a mismatch, causing the tests to fail with a clear error indicating that Pest uses the remote connection correctly: I’ve also extended the workflow to 3 jobs covering all possibilities: a default job (Pest spins up Playwright), a job using an isolated Playwright server, and a job using a job-level service container: https://github.com/Propaganistas/pest-remote-playwright-poc/blob/master/.github/workflows/test.yml https://github.com/Propaganistas/pest-remote-playwright-poc/actions/runs/42473688800 |
This PR enables the plugin to use remote Playwright servers instead of always spinning up a local one.
On a server / in a Docker container / ... :
In Pest.php:
OR using CLI
My envisioned use case: leveraging the pre-built
mcr.microsoft.com/playwrightcontainer and configure it as a service container in a GitHub workflow. This greatly reduces action minutes because browsers don't need to be downloaded in each run anymore; Github’s container cache is getting addressed instead. Below is a simplified example:Disclaimer: this PR was fully coded by AI per explicit instructions. Code quality might be off, but it serves as a proof of concept. I've also deliberately chosen to avoid breaking changes in public methods. Happy to refine the code when interested.