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

Dusk Laravel Package

laravel/dusk

Laravel Dusk is a browser automation and end-to-end testing tool for Laravel. It provides an expressive API for driving real browsers, ships with a standalone Chromedriver (no Selenium/JDK required by default), and can use other Selenium drivers.

View on GitHub
Deep Wiki
Context7

Laravel Dusk provides simple end-to-end testing and browser automation.

Frequently asked questions about Dusk
How do I install Laravel Dusk without needing Selenium or JDK?
Dusk ships with a bundled Chromedriver, so you only need Chrome (≥115) installed. Run `composer require --dev laravel/dusk` and `php artisan dusk:install` to auto-configure everything. No JDK or Selenium setup is required unless you switch to another driver.
Can I use Laravel Dusk with Laravel 10–13 and PHP 8.4–8.5?
Yes, Dusk officially supports Laravel 10–13 and PHP 8.1+. For PHP 8.4–8.5, ensure your `composer.json` pins Dusk to v8.x (latest stable). Check the [Laravel docs](https://laravel.com/docs/dusk) for version-specific quirks.
How do I test Vue.js or React components with Dusk?
Dusk provides helper methods like `assertVueContains()` and `assertReactContains()` for SPAs. For client-side routing, use `waitForLocation()` to ensure the browser waits for Vue Router/React Router transitions before assertions.
Will Dusk work in CI/CD pipelines like GitHub Actions?
Yes, Dusk is CI-friendly. Use `php artisan dusk` or `php artisan dusk --headless=new` for headless Chrome. Pre-install Chrome/Chromedriver in your CI environment or use Docker. Parallel testing is supported via the `--parallel` flag.
How do I debug flaky tests in Dusk?
Use `waitFor()` methods (e.g., `waitForText()`, `waitForElement()`) to handle timing issues. For visual debugging, take screenshots with `elementScreenshot()` or `browser->screenshot()`. Slow down tests with `pause(5000)` for manual inspection.
Can I use Firefox or Edge instead of Chrome with Dusk?
Yes, Dusk supports alternative Selenium drivers. Set the `DUSK_DRIVER` env var to `firefox` or `edge` and ensure the corresponding driver is installed. Example: `php artisan dusk --driver=firefox`. Check [Dusk’s docs](https://laravel.com/docs/dusk#driver-configuration) for setup.
Is Laravel Dusk suitable for unit testing, or only end-to-end?
Dusk is designed for **end-to-end** and UI regression testing, not unit testing. For unit tests, use Laravel’s built-in `HttpTests` or Pest. Dusk validates full user flows (e.g., form submissions, auth workflows) across the entire stack.
How do I run Dusk tests in parallel for faster CI execution?
Use the `--parallel` flag with `php artisan dusk --parallel=N`, where `N` is the number of browsers. Set `DUSK_BROWSERS=chrome,firefox` in your `.env` for multi-browser parallelism. Ensure your CI environment has enough resources for concurrent tests.
Does Dusk support testing Laravel queues or background jobs?
Yes, Dusk can interact with queues. Use `queue:flush` in your tests to clear pending jobs, or assert job processing with `browser->assertSeeInDatabase()`. For testing job failures, simulate them with `Artisan::call('queue:work --daemon')` in your test setup.
What are the alternatives to Laravel Dusk for browser testing?
Alternatives include **Puppeteer** (Node.js), **Playwright** (multi-language), or **Selenium WebDriver** (Java/Python). Dusk stands out for Laravel apps due to its native integration (e.g., `actingAs()` for auth) and bundled Chromedriver. For non-Laravel projects, Playwright or Cypress may offer more flexibility.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai