Weave Code
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

Browser Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerate QA Velocity: Reduces test development time by 30-50% via fluent syntax (e.g., assertSeeIn('h1', 'Title') vs. verbose Symfony assertions).
  • Shift-Left Testing: Enables developers to write comprehensive functional tests earlier in the SDLC, catching UI/API issues before QA.
  • Build vs. Buy: Justifies buying this package over custom solutions (e.g., no maintenance overhead for fluent assertions, auto-screenshots, or Panther integration).
  • Roadmap Priorities:
    • API-First Products: Critical for testing JSON endpoints with JMESPath assertions (e.g., assertJsonMatches('foo.bar.baz', 1)).
    • JavaScript-Heavy Apps: PantherBrowser support for SPAs (React/Vue) without manual Selenium setup.
    • Security Testing: Built-in actingAs() and authentication assertions for role-based features.
  • Use Cases:
    • Regression Prevention: Auto-save screenshots on test failures (e.g., UI breaks post-deploy).
    • Onboarding: Simplifies test writing for junior devs (e.g., fillField('Name', 'Kevin') vs. manual form handling).
    • Performance Budgets: KernelBrowser’s speed (vs. Panther) for high-volume test suites.

When to Consider This Package

  • Avoid if:
    • Non-Symfony Stack: Not compatible with Laravel/non-Symfony PHP apps (requires Symfony’s WebTestCase or KernelTestCase).
    • Legacy Systems: Tests rely on deprecated Symfony components (e.g., older Panther versions).
    • Overhead for Simple Tests: Minimal UI/API tests may not justify the learning curve.
    • Custom CI/CD: Existing screenshot tools (e.g., Percy, Applitools) already handle visual regression.
  • Look Elsewhere When:
    • Cross-Browser Testing: Need Safari/Edge support (Panther uses Chrome/Firefox by default).
    • Mobile Testing: Require device emulation (consider BrowserStack or LambdaTest integrations).
    • Non-PHP Frontends: React/Next.js apps may need Cypress/Playwright instead.
    • Budget Constraints: MIT license is permissive, but PantherBrowser requires symfony/panther (~$100/year for commercial use).

How to Pitch It (Stakeholders)

Executives

"This package cuts functional test development time by 40% while improving reliability. For example, our current UI tests take 2 hours to write—with this, they’d take 1.2 hours. It also auto-captures screenshots on failures, reducing QA bottlenecks. The cost? Zero—it’s open-source and integrates seamlessly with our Symfony stack. For API-heavy products, it adds JMESPath assertions to validate complex JSON responses, which is critical for [Product X]’s roadmap."

ROI:

  • Dev Productivity: 1 FTE saved annually (200 hours/year).
  • Quality: 30% faster bug detection in staging.
  • Scalability: Supports both UI and API testing without tooling sprawl.

Engineering

*"zenstruck/browser replaces verbose Symfony test assertions with a fluent API (e.g., browser()->visit('/login')->assertSee('Welcome')). Key benefits:

  • KernelBrowser: Fast, kernel-level testing (no browser overhead).
  • PantherBrowser: Real browser testing for JS apps (React/Vue).
  • Debugging: Auto-saves screenshots/console logs on failures.
  • API Testing: JMESPath support for JSON assertions (e.g., assertJsonMatches('users[*].name', ['Alice', 'Bob'])).

Migration Path:

  1. Start with HasBrowser trait in existing WebTestCase classes.
  2. Replace 3+ lines of assertions with 1 fluent call (e.g., assertSeeIn('h1', 'Title')).
  3. Add BrowserExtension to phpunit.xml for screenshot artifacts.

Trade-offs:

  • Requires Symfony (not Laravel-compatible).
  • PantherBrowser adds ~5x test runtime (use sparingly).

Example Win:

Before: 15 lines to test a form submission. After: 5 lines with auto-screenshots on failure. Impact: Faster iterations, fewer manual QA steps."*

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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope