- What is saucebase/laravel-playwright used for?
- It integrates Playwright browser E2E tests with Laravel by exposing a Laravel-side bridge for factories, database queries, artisan commands, and time travel. The Node/Playwright process calls these helpers over HTTP so browser tests can set up deterministic Laravel state. It is intended for end-to-end UI testing inside an existing PHP and Laravel workflow.
- How do I install and set up saucebase/laravel-playwright in a Laravel app?
- Install it as a Composer dev dependency and add the npm/TypeScript companion, then point Playwright at a base URL for a running Laravel app. The package registers its Laravel-side routes and service provider only in local/testing environments. Plan to pin the Composer and npm sides together and run the app server in CI.
- Does saucebase/laravel-playwright support Laravel 13?
- Version 1.1.0 is described only as 'Upgrade to Laravel 13', with no migration notes or compatibility matrix. That wording could mean Laravel 13 support was added alongside older versions, or that the package moved to Laravel 13 and dropped earlier majors. Check the CI matrix and the diff before assuming your Laravel line is supported.
- Is laravel-playwright safe to run in production?
- Its bridge endpoints can create records and run artisan commands, which is effectively remote code execution if reachable outside test environments. The package's Laravel-side surface is registered only in local/testing, but you should still review the routes and environment guards before any pilot. Keep it out of production runtime and treat the security surface as the highest-severity item to validate.
- How does laravel-playwright handle time travel and date-sensitive UI tests?
- It exposes time travel as a first-class test primitive, letting Playwright tests control the clock for stable date-sensitive UI. This is a key differentiator because plain Playwright cannot freeze Laravel time and Dusk handles it awkwardly. It relies on Laravel and Carbon test-time control behind the bridge.
- Can I create factory records and query the database from Playwright tests with this package?
- Yes, the package provides helpers for creating factory records and querying the database from the Node/Playwright side. The Laravel-side bridge runs these operations inside your app's PHP runtime, which gives deterministic seeding and persisted-state assertions. This avoids hand-rolled HTTP calls for common test setup.
- How do I run artisan commands or trigger queued work from a Playwright test?
- The bridge exposes artisan command execution as a test primitive, so Playwright tests can trigger Laravel commands and related work. That helps with scenarios such as queued or scheduled jobs that affect the UI. Confirm the exact helper API in the package docs and keep the bridge local/testing-only.
- What are the alternatives to saucebase/laravel-playwright for Laravel browser testing?
- Laravel Dusk, Pest browser testing, and Cypress-for-Laravel-style bridges are prior art for browser testing with Laravel state setup. This package's differentiator is bundled ergonomics for factories, database queries, artisan commands, and time travel as first-class primitives. Plain Playwright is strong at browser automation but weak at deterministic Laravel seeding and time control.
- Is saucebase/laravel-playwright actively maintained?
- The project is alive: there is a v1.0.3 tag and a v1.1.0 release, so it is not a single-release project. However, it has low stars, zero dependents, and a contributor base that reads as single-maintainer. Release hygiene is thin, as shown by a framework-major bump with a one-line changelog.
- What are the main risks of adopting laravel-playwright in a Laravel project?
- The dominant risk is maturity and maintenance rather than architecture, with version-support ambiguity added by v1.1.0. Because it touches factory resolution, container bindings, and Carbon::setTestNow, a Laravel major usually requires a package release, leaving a window where it lags. Validate the CI matrix, review the diff, and pin Composer and npm versions together.