friends-of-behat/symfony-extension
^6.0/^7.0), aligning with modern PHP frameworks. It leverages Symfony’s dependency injection (DI) and service container, enabling seamless integration with existing Symfony applications.Behat/Symfony2Extension, reducing migration risk for existing Symfony + Behat setups.6.x/7.x may limit adoption in legacy or non-Symfony PHP projects.6.x/7.x? If not, is migration feasible?behat/mink or behat/mink-browserkit-driver.use Behat\Symfony2Extension with use FriendsOfBehat\SymfonyExtension).BrowserKitDriver (headless) or Selenium2Driver.behat.yml Symfony2Extension config with SymfonyExtension’s schema.# Before
extensions:
Behat\Symfony2Extension: ~
# After
extensions:
FriendsOfBehat\SymfonyExtension:
kernel:
class: App\Kernel
symfony/mime, symfony/browser-kit, and symfony/css-selector are compatible with Symfony 6.x/7.x.@Tag("behat.context") or registered in services.yaml).mink/mink and at least one driver (e.g., mink-browserkit-driver for headless, mink-selenium2-driver for browser).^8.1 (Symfony 7.x requirement).composer require friends-of-behat/symfony-extension.behat.yml and services.yaml.services: block in config/packages/test.yaml).behat with --dry-run to catch configuration errors.@Scope("request") for contexts with request-specific data.bin/behat -d for detailed debug output.behat --parallel.--headless=new).warmup scripts or cache:clear optimizations.| Failure Type | Symptoms | Mitigation |
|---|---|---|
| Context Autowiring | No context found for "feature" |
Verify services.yaml includes contexts with tags: ["behat.context"]. |
| Mink Driver Issues | Session not created |
Check driver installation (e.g., chromedriver --version). |
| Symfony Kernel Errors | Class not found in Behat |
Ensure kernel.class in behat.yml matches App\Kernel. |
| Environment Mismatch | Tests pass locally but fail in CI | Use Docker or behat --env=ci to replicate environments. |
| State Contamination | Flaky tests due to shared services | Use @Scope("request") or reset state in BeforeScenario. |
How can I help you explore Laravel packages today?