saucebase/laravel-playwright
Integrate Playwright browser testing into Laravel applications with ease. This package provides helpers, configuration, and test utilities for running end-to-end browser tests against your app, streamlining UI testing within your existing PHP workflow.
Architecture fit. The package follows a sidecar-bridge pattern: a Laravel-side surface (routes/service provider registered only in local/testing) that the Node/Playwright process calls over HTTP to create factory records, run artisan commands, query the database, and control the clock. This is the right shape for a Laravel app. It avoids Selenium/ChromeDriver, reuses the app's own PHP runtime for state setup, and lets the browser layer stay pure Playwright. Prior art (Cypress-for-Laravel style bridges, Pest browser testing) confirms the pattern is viable; the differentiator here is the bundled ergonomics — factories, DB queries, artisan, and time travel as first-class test primitives rather than hand-rolled HTTP calls.
Where the value actually is. Raw Playwright is weak at exactly the things Laravel teams need: deterministic seeding, asserting persisted state, triggering queued/scheduled work, and freezing time so date-sensitive UI is stable. Time travel in particular is a capability Dusk handles awkwardly and plain Playwright cannot do at all. That is the strongest argument for the package, not the browser automation itself.
What v1.1.0 changes. The release is a single line — "Upgrade to Laravel 13" (PR #11) — with no migration notes, no deprecation statement, and no compatibility matrix in the notes. Two things follow from that:
v1.0.3 tag, so the earlier read of "a single release" was already stale; there is now a patch line plus a minor bump. That materially softens — but does not eliminate — the abandonment concern.Carbon::setTestNow cannot support a framework major for free. "Upgrade to Laravel 13" may mean added support (10/11/12/13) or moved to Laravel 13 (10/11 dropped). The notes do not say, and that distinction determines whether this is a low-risk minor or a forced-upgrade coupling. Treat it as unresolved until the CI matrix is inspected.Integration feasibility. Low effort to spike: composer dev dependency, an npm/TS companion, a base URL, and a running app server in CI. A single critical journey (auth + one write path) can be validated in a day or two by one engineer. No schema changes, no production runtime dependency. The one new precondition is version alignment: our app's Laravel line must fall inside whatever v1.1.0 actually supports, and both the composer and npm sides must be pinned together.
Technical risk. Maturity remains the dominant risk rather than architecture, but the profile has shifted. Still true: zero dependents, low stars, mid-band opportunity score, and a contributor base that reads as single-maintainer. Newly relevant:
Carbon::setTestNow are internals-adjacent. The v1.1.0 bump is evidence the maintainer keeps up, but also evidence that a framework major requires a package release — so there is always a window after each Laravel major where this package is behind.Key questions to answer before committing:
Stack fit. Targets a Laravel application with Node 20+ and current Playwright. The supported Laravel range is now the gating question rather than a footnote: if v1.1.0 is Laravel 13-only, this package is only viable for teams already on 13 or planning to be within the pilot window; if it is additive across 10–13, it fits the standard stack as previously assessed. It fits best where a Playwright or Cypress practice already exists — typically because the front end is JS/TS — or where QA engineers write TypeScript rather than PHP. In a PHP-only test culture with no Node tooling, the adoption cost rises materially.
Positioning against alternatives. Do not frame this as a replacement for PHPUnit/Pest feature tests; those stay. It is not a like-for-like Dusk swap either — Dusk is first-party and stable, this is not. The realistic pitch is unchanged: "the glue that makes Playwright viable for Laravel E2E," adopted incrementally for new tests. v1.1.0 improves the pitch slightly on liveness and weakens it slightly on predictability.
Migration path.
composer.json and the CI workflow on the v1.1.0 tag before writing any code. This now precedes the spike.Compatibility work. Pin exact versions of both the composer and npm sides and upgrade them together — this is now non-negotiable, since the package's version numbers and Laravel's are coupled by design. Verify behavior under the specific database driver in use (transactional truncation behaves differently on MySQL vs Postgres vs SQLite), and under the queue, session, cache, and mail drivers configured for the test environment. Artisan commands invoked through the bridge inherit whatever side effects those drivers produce. Keep a record of which package version we validated against which Laravel/PHP/Node combination; it is our only support matrix until upstream publishes one.
Sequencing. Support-matrix verification and security gating are blocking prerequisites, not parallel tasks. Parallelization is last — get correctness on a single worker first, because flaky isolation will otherwise be indistinguishable from bridge bugs.
Maintenance. A dev-only dependency with an outsized ownership tail. Budget one to two days per quarter for version bumps and compatibility fixes, plus a named owner in test infrastructure — and expect that estimate to spike in the quarter after each Laravel major, when this package ships its matching release and we must validate it. Because upstream is small, assume you may eventually fork; keep any local patches as a thin wrapper rather than edits to vendor code so a fork stays cheap.
Support and knowledge spread. The bridge is invisible infrastructure — a well-meaning "unused route" cleanup in the app can silently break the entire E2E suite. Document it in the app's testing README and add a code comment at the route registration. QA owns day-to-day usage; application engineers need only awareness, not expertise.
Scaling. Each Playwright worker needs an isolated database (N databases, or schema-per-worker plus a reset hook). App boot cost per worker and browser startup dominate CI time; expect CI minutes to rise even as test reliability improves. Time-travel and factory state must reset on every test boundary or parallel runs will interfere.
Failure modes, ranked by severity.
Ramp-up. A TypeScript-fluent QA engineer is productive in two to three days; the bridge API is small. A PHP-only engineer needs about a week for Playwright fundamentals — locators, auto-waiting, fixtures, trace viewer — which is the real cost, not this package.
Recommendation. Conditional pilot, unchanged in direction but with a revised first gate. v1.1.0 is a net positive signal — the project is maintained, has a patch line, and keeps pace with framework majors — and it should be read as evidence against the "likely abandoned" hypothesis. It does not clear the bar on its own: the release is a one-line note on a change that can break the bridge's coupling points, and it leaves the supported Laravel range unspecified. Promote to team standard only if four gates clear: (a) the v1.1.0 diff and CI matrix are reviewed and our Laravel/PHP versions are confirmed supported, (b) security gating reviewed and proven inert outside test envs, (c) 20+ tests green and stable for four consecutive weeks in CI, (d) a documented ownership and fork contingency exists. If (a) fails — i.e. we are on a Laravel line v1.1.0 no longer covers — fall back to the v1.0.x line if it is still patched, or to Pest 4 browser testing / a minimal in-house bridge, which is likely cheaper than carrying a dependency that dictates our framework upgrade cadence.
How can I help you explore Laravel packages today?