Looking to hire Laravel developers? Try LaraJobs

laravel-dusk-chromedriver maintained by zgetro

Description
A Laravel Artisan command to download matching ChromeDriver binaries for Windows, Linux, Mac, with WSL host detection support.
Author
Last update
2025/05/22 08:17 (dev-main)
License
Links
Downloads
15

Comments
comments powered by Disqus

🧩 Features

  • 🎯 Detects your Chrome version precisely
  • 💻 Supports downloading drivers for:
    • Windows (chromedriver-win64)
    • Linux (chromedriver-linux64)
    • macOS (chromedriver-mac-arm64 / mac-x64)
  • 🐧 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.