mink/driver-testsuite
Common PHPUnit test suite for Behat Mink drivers to ensure consistent behavior across implementations. Includes a fixture web server runner and an AbstractConfig hook to create your driver and customize/skip tests as needed.
Purpose Alignment: The mink/driver-testsuite is a test suite for Mink drivers, primarily used to validate the correctness of browser automation drivers (e.g., Selenium2, Goutte, etc.). It is not a standalone testing framework but rather a validation tool for driver implementations.
Key Technical Synergies:
Http\Testing\Mink facade) if Mink is already in use.mink/mink).facebook/mink-selenium2-driver).laravel/mink) may need alignment.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Driver Version Mismatch | High | Pin exact Mink/driver versions in composer.json. |
| False Positives in Tests | Medium | Review test cases against actual use cases; exclude irrelevant tests. |
| Legacy Mink (1.x) Support | Low | If using Mink 2.x, ensure compatibility (some tests may need updates). |
| CI Flakiness | Medium | Run in isolated containers; cache dependencies. |
| No Laravel-Specific Tests | Low | Use as a complement, not a replacement, for Laravel’s testing tools. |
laravel/mink facade (if using Mink 2.x).php artisan test (if using Mink facade).composer show mink/mink).composer require --dev mink/driver-testsuite facebook/mink-selenium2-driver
phpunit.xml or pest.php:
<testsuites>
<testsuite name="Mink Driver Tests">
<directory>./vendor/mink/driver-testsuite/tests</directory>
</testsuite>
</testsuites>
./vendor/bin/phpunit --filter="Mink\\Driver\\TestSuite"
laravel/mink, ensure driver configuration matches test expectations..env:
MINK_DRIVER=selenium2
MINK_SELENIUM_URL=http://selenium:4444/wd/hub
# GitHub Actions example
- name: Test Mink Drivers
run: composer test:mink-drivers
| Component | Compatibility Notes |
|---|---|
| Mink 1.x vs. 2.x | Test suite may need updates for Mink 2.x (API changes). |
| Laravel Facade | laravel/mink must be configured to match test expectations. |
| Custom Drivers | Non-standard drivers may fail tests; exclude or adapt. |
| Headless Browsers | Selenium/Goutte tests may require real browsers in CI. |
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Driver test failures | Blocks deploy if gated in CI. | Exclude non-critical tests; investigate root cause. |
| CI flakiness (Selenium) | Unstable builds. | Use retry logic or Dockerized Selenium. |
| Mink version conflicts | Tests pass locally but fail in CI. | Pin versions in composer.json. |
| Laravel/Mink integration bugs | Tests fail due to facade issues. | Test with minimal Laravel config. |
How can I help you explore Laravel packages today?