Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Dusk Fakes Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test-strategy investment: E2E vs. feature tests. The package only matters if browser-level tests are part of your quality bar. It informs whether Dusk stays a first-class part of the pipeline or gets demoted to a thin smoke suite.
  • Flakiness and CI cost trade-offs. Laravel Dusk drives a real browser against a real app process, so fakes registered in the test process (e.g. 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.
  • Build vs. buy for internal test tooling. The underlying problem (serializing fake state across a process boundary, scoping it to a single Dusk test, cleaning it up) is a few days of fiddly work. Buying it as a dev-only MIT dependency is the cheaper default unless you have unusual requirements.
  • Third-party sandbox dependency. Teams often keep Stripe/Twilio/email/SMS sandbox accounts purely for E2E. Persistent fakes let you drop or shrink that surface, which is both a cost and a compliance/data-handling decision.
  • Migration roadmap for the browser-test layer. If there's a live proposal to move from Dusk to Playwright, Cypress, or Pest's browser testing, this package is a stopgap, not a foundation — and adopting it should be time-boxed accordingly.
  • Laravel upgrade timing. 1.10.0 adds Laravel 13 support, so the package is not a blocker if the framework upgrade lands while Dusk is still in the pipeline. That keeps the tool viable across the upgrade window rather than forcing a test-layer decision early.
  • Use cases it unlocks: asserting that a browser-driven checkout actually calls your payment provider with the right payload; testing flows that depend on a flaky upstream without mocking at the controller layer; reproducing production-like journeys in CI with zero network egress.

When to Consider This Package

Adopt when most of these hold:

  • You run Laravel Dusk in CI today, and the suite is a real gate — not a leftover skeleton.
  • Your browser-tested flows trigger outbound HTTP (payments, notifications, LLM/API calls, internal services), and you currently either hit sandboxes or skip those assertions.
  • You want hermetic, offline-capable E2E runs — no egress, no shared sandbox credentials, no cross-run state pollution.
  • You need to assert on outbound requests from code paths that only execute inside the browser request, which unit/feature tests can't reach.
  • You're on, or planning to move to, Laravel 13 — 1.10.0 explicitly adds support, so the dependency won't block the framework upgrade.
  • You're comfortable with a small, single-maintainer, dev-only dependency (Protone Media / Pascal Baljet has a solid track record in the Laravel ecosystem; MIT license; recent release cadence — the 1.10.0 cut continues that).

Look elsewhere when:

  • You're not on Dusk. Playwright's 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.
  • Feature tests cover the same ground. If the flow can be tested with $this->post(...) plus Http::fake(), Dusk is already overkill and so is this.
  • Your Dusk suite is scheduled for removal. Adopting a persistence layer for a framework you're leaving adds migration debt for zero durable value.
  • You need vendor support, an SLA, or broad community validation. Still near-zero adoption (21 stars, no dependents); 1.10.0 is a compatibility and docs release, not evidence of hardening. You are effectively an early adopter.
  • You need one narrow fake. A ~30-line custom implementation may be cheaper than a dependency you have to track.

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.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log