zgetro / laravel-dusk-chromedriver
A Laravel Artisan command to download matching ChromeDriver binaries for Windows, Linux, Mac, with WSL host detection support.
Requires
- php: ^7.4|^8.0
Requires (Dev)
- illuminate/console: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- laravel/dusk: ^5.0|^6.0|^7.0|^8.0
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0|^10.0
- phpunit/phpunit: ^8.5 || ^9.0
Suggests
- illuminate/console: Required for Artisan command
- illuminate/support: Required for Laravel integration
- laravel/dusk: Required for Dusk integration
README
π Laravel ChromeDriver Downloader
A Laravel Artisan command that auto-magically detects your Chrome version, downloads the right ChromeDriver for Windows πͺ, Linux π§, and Mac π β with exclusive WSL support!
π§ Smart Β· π€ Automated Β· β‘ Fast Β· π§© Cross-Platform Β· π» WSL-Aware
π§© Features
- π― Detects your Chrome version precisely
- π» Supports downloading drivers for:
- Windows (
chromedriver-win64
) - Linux (
chromedriver-linux64
) - macOS (
chromedriver-mac-arm64
/mac-x64
)
- Windows (
- π§ WSL Smart Detection β detects Chrome version from Windows host
- βοΈ Stores drivers in
.vendor/laravel/dusk/bin/
- π Supports
--all
flag to download drivers for all OSes - β Laravel 6β11 compatible
- π§ͺ PHPUnit support for testing the command
π Installation
composer require zgetro/laravel-dusk-chromedriver --dev
π οΈ Usage
php artisan dusk:download-chromedriver
By default, this will:
- Detect the local Chrome version
- Download the matching ChromeDriver for your OS
- Save it as .vendor/laravel/dusk/bin/chromedriver-[os]
𧬠Download All Drivers
php artisan dusk:download-chromedriver --all
This downloads all supported platform drivers β ideal for testing or CI.
βοΈ Environment Compatibility
OS | Chrome Detection Method |
---|---|
Linux | google-chrome --version / chromium-browser |
macOS | mdls metadata or standard version queries |
Windows | PowerShell: read .exe version |
WSL | PowerShell bridge to detect host Windows Chrome β |
π¦ Output Directory
All drivers are stored under:
.vendor/laravel/dusk/bin/
With friendly names:
- chromedriver-win
- chromedriver-linux
- chromedriver-mac
π§ͺ Testing
composer test
Supports phpunit via Orchestra Testbench.
π§ Behind the Scenes
Your Artisan command is your wand. This package just makes it magical.
The package:
- etches your Chrome version using OS-specific logic
- Queries official Chrome for Testing URLs
- Extracts & renames the ChromeDriver zip content
- Makes it executable where needed
π§° Requirements
- PHP 7.4 or newer
- Laravel 6.x to 11.x
- Internet access (to download drivers)
π§Ύ License
MIT Β© zgetro
π‘ Contributing
PRs welcome! Feel free to submit issues, add test coverage, or request new features.