protonemedia/laravel-dusk-fakes
Laravel Dusk Fakes lets you replace real Dusk browser sessions with fakes in your tests. It offers a fluent API to simulate browser interactions and assert Dusk calls, so you can test Dusk-dependent code quickly without launching a real browser.
Http::fake()) don't reach the code handling the browser's request. Persistent fakes make outbound calls deterministic and hermetic — a direct lever on CI flake rate, retry counts, and pipeline minutes.Adopt when most of these hold:
Look elsewhere when:
page.route() / network interception, Cypress cy.intercept(), or MSW solve this natively and better. Don't add a Laravel-specific shim to a non-Laravel-native runner.$this->post(...) plus Http::fake(), Dusk is already overkill and so is this.Adoption guardrails: spike it in one or two test files before committing; pin the version; confirm it composes with your existing Dusk setup (parallel runs, database transactions, CI caching); and keep the fallback fork path open — the surface area is small enough that forking is a realistic escape hatch.
For executives: This is a small, free, MIT-licensed developer tool that makes our browser-based end-to-end tests deterministic. Today those tests occasionally hit real third-party services, which makes them slow, flaky, and dependent on external sandbox accounts — that shows up as retried pipelines and engineers debugging tests instead of shipping. This package removes the network dependency from those tests. It is dev-only: it never ships to production, adds no runtime footprint, and can be removed in an afternoon. The cost is effectively zero; the risk is that it's a young, single-maintainer open-source project, which we mitigate by pinning the version and keeping the code small enough to fork. The latest release adds support for Laravel 13, so the tool won't hold up our framework upgrade path. Recommendation: time-boxed pilot on our flakiest Dusk specs, with a go/no-go based on measured flake reduction and CI minutes saved.
For engineering: Laravel Dusk runs the app in a separate process from the test, so Http::fake() and friends never reach the code handling the browser's request — the classic reason Dusk suites end up talking to real sandboxes. protonemedia/laravel-dusk-fakes persists fake definitions across that process boundary and scopes them per test, so you get Http::fake()-style determinism and assertion inside browser-driven flows. It's small, MIT, actively released, and from a maintainer with a good track record in the Laravel ecosystem. What's new in 1.10.0: Laravel 13 compatibility plus an Inertia Modal docs link — no API or behavior changes, so it's a drop-in bump, but also not a maturity signal. Caveats stand: near-zero adoption (21 stars, no dependents), so treat it as unproven — pilot it, pin it, and be prepared to vendor a fork. If you're already planning a move to Playwright or Pest's browser testing, skip this; those runners intercept traffic natively.
How can I help you explore Laravel packages today?