orchestra/testbench-browser-kit
BrowserKit Testbench component helps package developers write Laravel tests using laravel/browser-kit-testing. Swap your base TestCase for Orchestra\Testbench\BrowserKit\TestCase and use the fluent visit, see, and form APIs.
/register, fill the form, press Register, land on /dashboard, see the user's name"). That maps directly to acceptance criteria in a PRD, giving a PM a defensible answer to "how do we know this works?" beyond "the controller returns 200."Orchestra\Testbench\TestCase → Orchestra\Testbench\BrowserKit\TestCase) plus $baseUrl. That is effectively free; building an equivalent is not a good use of engineering time.visit / click / see API in a package-testing context, it lets a team defer rewriting a legacy test suite. That becomes a real roadmap trade-off: "keep the old suite green cheaply" vs. "fund a migration to modern HTTP tests."Adopt when:
visit, click, type, select, check, attach, press, seePageIs, seeRouteIs). Adoption cost is then one line plus a $baseUrl property.actingAs authentication across guards, redirects with flashed session data, old input on validation failure. The assertion table (assertRedirectedToRoute, assertSessionHasErrors, assertHasOldInput) is the differentiator.Look elsewhere when:
$this->get(), $this->post(), assertSee, assertJson*) cover most of the same ground with no extra dependency, and Dusk covers real browser behavior. Prefer the built-in path unless you specifically need the visit/click ergonomics.laravel/browser-kit-testing, a component Laravel itself stopped investing in. A zero-dependency-count signal (Dependents: 0) and a single-maintainer lineage mean the longevity risk sits with a small upstream. Verify maintenance status before you make it a hard dependency of a long-lived release pipeline.Adoption checklist: pin the version matching your Laravel major, add the dependency as --dev, mirror it in CI, confirm the upstream laravel/browser-kit-testing package is still installable for your PHP version, and record an exit plan (which tests convert to plain HTTP assertions and in which milestone).
For executives (one paragraph): This is a free, MIT-licensed, dev-only test helper maintained by the Orchestra team. It does not touch production code, ships nothing to customers, and adds no runtime dependency — it is installed as a development dependency and runs only in CI. What it buys us is confidence: it lets us write tests that behave like a real user clicking through forms, submitting uploads, and logging in, against our Laravel package, without standing up a browser. Its practical role is to protect release quality for our package line while keeping the cost of staying current with each Laravel major version visible and scheduled. It is a small line item, not a strategic bet — the main decision it informs is how much we invest in test coverage and version currency, not what we build next.
For engineering leads: Adoption is a one-line base-class change plus a $baseUrl, and version pairing is explicit (Laravel 6–12 maps to majors 4–10). You get the full fluent BrowserKit API — link traversal, form filling, file attachment, JSON structure assertions, session and auth helpers, redirect and validation-error assertions — wrapped around Testbench's package bootstrap. The headline caveat: this bridges to laravel/browser-kit-testing, an interface Laravel has de-emphasized in favor of its built-in HTTP test helpers and Dusk. So treat it as the right tool for existing suites and for packages that need HTML-level journey tests, and as a deliberate, documented choice — not a default — for greenfield tests. Suggested framing to the team: "Use it where the visit/click/press model matches the acceptance criteria; write new endpoint tests with core HTTP assertions; track the dependency in our upgrade backlog so a future Laravel major never surprises the release train."
How can I help you explore Laravel packages today?