zenstruck/browser
A Laravel-friendly browser testing toolkit built on Symfony BrowserKit and Panther. Easily crawl pages, click links, submit forms, assert on HTML, and drive real headless browsers—great for end-to-end tests and fluent, expressive UI assertions.
Install via Composer: composer require --dev zenstruck/browser. Begin by creating a functional test that uses the browser: extend WebTestCase and inject Browser via static::createBrowser(). The first use case is typically clicking links, filling forms, and asserting page content with an intuitive, chainable API — e.g., $browser->visit('/login')->fillField('username', 'admin')->submit()->assertPathIs('/dashboard').
LoginPage) to promote reuse and readability.Browser::fromUri() or static::createClient() to simulate authenticated sessions with preloaded fixtures.waitFor() with assertXpath() or assertDomContains() for SPA or AJAX-heavy UIs.browser() helper; chain expectations like ->assertTitleContains('Welcome').Browser::configure() with custom timeout() or slowMotion() for debugging.<body> (e.g., Turbolinks), use assertDomContains() after waitFor() instead of assertDomNotFound().fillField() with form field names over IDs or CSS selectors; use fillFieldWith() for inputs without labels.Browser::mink() callback to inject custom behaviors (e.g., viewport resizing or request headers).dumpPage() or savePageSnapshot() to inspect rendered HTML in failure cases; run tests with --keep-browser to inspect sessions interactively.How can I help you explore Laravel packages today?