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

Sylius Behat Pack Laravel Package

setono/sylius-behat-pack

Dev pack for running Behat tests in Sylius apps and plugins. Pulls in common Behat/Mink tooling and documents a JS-enabled setup using Chromedriver, Selenium, and the Symfony CLI web server for test environments.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Sylius-Specific Overhead: The package is tightly coupled with Sylius, making it a poor fit for vanilla Laravel apps unless extending Sylius functionality. For Laravel projects, the Behat + Mink/Selenium stack adds unnecessary complexity compared to native tools like Pest or Dusk.
  • Testing Paradigm Mismatch: Laravel’s ecosystem favors unit/feature testing (Pest, PHPUnit) and JS testing (Dusk), while this package enforces BDD-style Behat tests, which may not align with team workflows.
  • Laravel Compatibility: While technically possible to integrate, the package assumes Sylius-specific Behat contexts, fixtures, and project structure, requiring significant adaptation for Laravel. Example:
    • Sylius uses sylius-fixtures for test data; Laravel uses factories/seeding.
    • Sylius Behat contexts (e.g., sylius/behat-contexts) may conflict with Laravel’s service container.

Integration Feasibility

  • Composer Dependency Conflicts: The package pulls in Sylius and Symfony dependencies (e.g., sylius/sylius, symfony/*@4.4), which may conflict with Laravel’s Symfony 5/6 or Laravel-specific packages.
  • Environment Dependencies: Mandates external tools (Chromedriver, Selenium, Symfony CLI) that must be manually installed and configured, increasing CI/CD complexity. Example:
    • Docker not assumed: Teams must either:
      • Manually install Selenium/Chromedriver locally/on CI.
      • Build a custom Docker image (e.g., with selenium/standalone-chrome).
    • Symfony CLI dependency: Adds friction for Laravel teams accustomed to laravel artisan.
  • Configuration Complexity: Requires adapting behat.yml, Behat contexts, and project structure to work with Laravel. Example:
    • Sylius expects a tests/Application directory; Laravel may need a custom structure.
    • Fixtures: Sylius’s sylius-fixtures must be replaced with Laravel’s factories or a hybrid approach.

Technical Risk

  • Stagnant Maintenance: Last release in 2021, no dependents, and no active development. Risk of:
    • Breaking changes if Sylius/Behat/Symfony updates.
    • Unsupported features (e.g., Sylius 2.x/3.x, PHP 8.2+).
  • Flaky JS Testing: Selenium/Chromedriver 3.4 is outdated and unreliable in CI. Modern alternatives (e.g., Playwright, Cypress, or Laravel Dusk) offer better stability.
  • Laravel-Sylius Integration Gaps:
    • Service Container Conflicts: Sylius and Laravel use different autowiring and service providers.
    • Event System: Sylius’s event-driven architecture may not map cleanly to Laravel’s event system.
  • Performance Overhead: Behat + JS tests are slow (minutes per suite) and resource-intensive, which may bloat CI pipelines.

Key Questions

  1. Is Sylius a Core Dependency?
    • If yes, this package reduces setup time for Behat.
    • If no, is the Behat overhead justified compared to Pest/Dusk?
  2. What is the CI/CD Maturity?
    • Can the team reliably run Selenium/Chromedriver in parallel?
    • Are there budget/resources to maintain this stack long-term?
  3. Does the Team Have Behat Experience?
    • If no, the learning curve (Gherkin, Mink, Sylius contexts) may slow adoption.
  4. What is the Laravel/Sylius Version?
    • The package supports Symfony 5/6 but may lag behind Laravel 10+ or Sylius 2.x.
  5. Are There Modern Alternatives?
    • Laravel Dusk (for JS testing) or Pest + TestCase (for PHP tests) may be lighter-weight.
    • Playwright/Cypress for faster, more reliable JS testing.

Integration Approach

Stack Fit

  • Ideal Use Case: Sylius-based Laravel apps/plugins needing BDD-style testing with Behat.
  • Partial Fit: For pure Laravel apps, the package is overkill unless:
    • The app extends Sylius (e.g., custom e-commerce features).
    • The team explicitly requires Behat for stakeholder collaboration (e.g., non-technical QA).
  • Alternatives:
    • Laravel Dusk: For JS-heavy UI tests (modern, reliable).
    • Pest + TestCase: For PHP-based unit/feature tests (faster, Laravel-native).
    • Codeception: More flexible than Behat for Laravel/Sylius hybrids.

Migration Path

  1. Assess Sylius Dependency:
    • If using Sylius, verify version compatibility (package supports Sylius 1.x).
    • If not, evaluate forking Behat contexts or using a subset of dependencies.
  2. Installation:
    composer require --dev setono/sylius-behat-pack
    
    • Risk: May pull in conflicting Symfony/Sylius versions.
  3. Environment Setup:
    • Install Chromedriver, Selenium, and Symfony CLI (as per README).
    • Recommended: Use Docker to avoid local setup headaches:
      # Dockerfile for Selenium
      FROM selenium/standalone-chrome:latest
      
  4. Adapt Project Structure:
    • Mirror Sylius’s tests/Application if needed (or create a Laravel-compatible alternative).
    • Override Behat contexts for Laravel-specific features (e.g., service container bindings).
  5. CI/CD Integration:
    • Example GitHub Actions workflow:
      - name: Start Selenium
        uses: shimataro/gh-action-selenium@v1
        with:
          version: 4.1.2
      - name: Run Behat
        run: vendor/bin/behat --config=behat.yml
      

Compatibility

  • PHP/Laravel: No direct conflicts, but Sylius dependencies may require dependency overrides in composer.json:
    "conflict-resolution": {
      "prefer-lowest": false,
      "prefer-stable": true,
      "prefer-fully-resolved": true
    }
    
  • Sylius: Tested with Sylius 1.x; Sylius 2.x/3.x may need custom contexts.
  • Behat/Mink: Requires Behat 3.x and Mink 1.x (outdated; consider Behat 5+).
  • JS Testing: Selenium 3.4 is obsolete; upgrade to modern WebDriver (e.g., via laravel/dusk).

Sequencing

  1. Phase 1: Proof of Concept
    • Install the package in a staging environment.
    • Run a basic Sylius Behat test to validate setup.
    • Goal: Confirm no blocking conflicts with Laravel.
  2. Phase 2: Adaptation
    • Customize Behat contexts for Laravel (e.g., replace Sylius service locators with Laravel’s app()).
    • Replace Sylius fixtures with Laravel factories.
  3. Phase 3: CI/CD Integration
    • Containerize Selenium/Chromedriver (e.g., Docker).
    • Optimize test parallelization (e.g., GitHub Actions matrix).
  4. Phase 4: Maintenance Plan
    • Monitor for upstream breaking changes.
    • Document forking strategy if the package becomes unsupported.
    • Long-term: Consider migrating to Dusk/Playwright if Behat becomes a burden.

Operational Impact

Maintenance

  • Dependency Updates:
    • The package is abandoned; the team must manually patch for Sylius/Behat updates.
    • Risk: If Sylius 2.x/3.x introduces breaking changes, the package may no longer work.
  • Local Development:
    • Developers must manually start Selenium/Chromedriver, increasing onboarding friction.
    • Symfony CLI dependency adds complexity for Laravel teams.
  • Documentation:
    • Lack of Laravel-specific docs; team must fill gaps in setup/debugging.
    • Example: No guidance on integrating Laravel factories with Sylius fixtures.

Support

  • Community Support:
    • No active maintainers (last release: 2021).
    • No GitHub issues to reference for troubles
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.
babenkoivan/elastic-client
innmind/static-analysis
innmind/coding-standard
datacore/hub-sdk
alengo/sulu-http-cache-bundle
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php