Laravel - Browser Tests - Installation
To get started, you should install Google Chrome and add the
laravel/dusk Composer dependency to your project:
composer require --dev laravel/dusk
If you are manually registering Dusk's service provider, you should never register it in your production environment, as doing so could lead to arbitrary users being able to authenticate with your application.
After installing the Dusk package, execute the
dusk:install Artisan command. The
dusk:install command will create a
tests/Browser directory and an example Dusk test:
php artisan dusk:install
Next, set the
APP_URL environment variable in your application's
.env file. This value should match the URL you use to access your application in a browser.
If you are using Laravel Sail to manage your local development environment, please also consult the Sail documentation on configuring and running Dusk tests.