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

Behat Extension Driver Locator Laravel Package

bex/behat-extension-driver-locator

Dynamic driver/service loader for Behat extensions. Locates drivers by key in a namespace, enforces interfaces, builds and validates per-driver config trees, and loads services via DI container. Includes a DriverNodeBuilder to generate driver config nodes.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Modular Extension Architecture: Enables a "plugin-like" system for Behat extensions, allowing teams to dynamically load drivers (e.g., image uploaders, formatters, or custom services) without hardcoding dependencies. This aligns with a composable architecture roadmap for test automation tools.
  • Build vs. Buy: Justifies buying this lightweight package over building a custom driver loader, reducing technical debt and accelerating development for extensible Behat features.
  • Configuration Flexibility: Supports multi-environment testing (e.g., switching between AWS S3 and local storage drivers) via behat.yml without code changes.
  • Test Automation Roadmap:
    • Phase 1: Integrate into existing Behat extensions to standardize driver loading (e.g., for file uploads or reporting).
    • Phase 2: Expand to support custom Behat hooks or third-party integrations (e.g., CI/CD-specific drivers).
    • Phase 3: Leverage the package to open-source a modular Behat extension (e.g., behat-aws-s3-driver) for community adoption.
  • Use Cases:
    • Dynamic Service Injection: Load different database connectors (MySQL/PostgreSQL) for test environments.
    • Feature Flags for Drivers: Enable/disable drivers via config (e.g., active_drivers: [s3, local]).
    • Vendor-Agnostic Extensions: Build Behat extensions that work with multiple cloud providers (e.g., GCP, Azure) without forking.

When to Consider This Package

  • Adopt When:

    • Your Behat extension requires dynamic service loading (e.g., swapping implementations at runtime).
    • You need runtime validation of driver configurations (e.g., ensuring required fields are present).
    • Your team prioritizes decoupling drivers from core extension logic (e.g., for easier maintenance).
    • You’re building a reusable Behat extension intended for distribution (e.g., via Packagist).
    • Your behat.yml already uses Symfony’s config system (this package extends it).
  • Look Elsewhere If:

    • Your use case is simple (e.g., static drivers with no config validation).
    • You’re using Behat Mink or another extension with built-in driver support (e.g., mink-selenium-driver).
    • Your team lacks PHP/Symfony config expertise (steep learning curve for ArrayNodeDefinition).
    • The package’s last release (2020) is a blocker (though MIT license allows forks).
    • You need active maintenance (consider contributing or alternatives like php-di for DI-based solutions).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us future-proof our Behat test suite by enabling dynamic, configurable drivers—like swapping AWS S3 for local storage without code changes. It’s a lightweight, open-source solution that reduces technical debt and aligns with our goal of modular, scalable test automation. For example, we could use it to:

  • Cut CI/CD costs by testing with cheaper local drivers during development.
  • Accelerate onboarding for new environments (e.g., staging vs. production).
  • Open-source a reusable extension, positioning us as a leader in Behat tooling. The MIT license and Symfony integration mean low risk, and the effort to adopt is minimal compared to building this from scratch."*

For Engineering:

*"This is a batteries-included driver loader for Behat extensions. It handles:

  1. Automatic discovery of drivers in a namespace (e.g., App\Drivers).
  2. Runtime validation of configs against driver contracts (e.g., DriverInterface).
  3. Seamless DI integration—drivers get the Symfony ContainerBuilder injected.
  4. Config-driven activation via behat.yml (e.g., active_drivers: [s3]).

Why use it?

  • Save 10+ hours of boilerplate code for driver loading/validation.
  • Decouple drivers from extension logic (e.g., add a new SlackNotifierDriver without touching core code).
  • Leverage Symfony’s config system (familiar to most PHP teams).

Trade-offs:

  • Last updated in 2020, but no breaking changes since Symfony 5 support was added.
  • Requires understanding of ArrayNodeDefinition for setup.

Proposal:

  1. Pilot: Integrate into one extension (e.g., behat-file-uploader) to validate ROI.
  2. Document: Create a template for teams to add drivers (e.g., README-DRIVERS.md).
  3. Extend: Fork if needed to add modern features (e.g., PHP 8.2 support)."*
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky