Download the PHP package stevebauman/laravel-husk without Composer
On this page you can find all versions of the php package stevebauman/laravel-husk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stevebauman/laravel-husk
More information about stevebauman/laravel-husk
Files in stevebauman/laravel-husk
Package laravel-husk
Short Description A Laravel Dusk environment for your Javascript only applications.
License MIT
Informations about the package laravel-husk
Laravel Husk
Laravel Husk is a thin and light scaffolded Laravel Dusk environment.
It allows you to test your JavaScript applications with PHP using Pest, without having to scaffold an entire Laravel application.
Examples
JS Framework | Tests |
---|---|
NuxtJS | |
NextJS | |
Svelte | |
Gatsby | |
Gridsome | |
Showcode (NuxtJS) |
Installation
Inside of your JavaScript application folder, run the below command to scaffold the Laravel Husk environment:
Note: This will create the folder named
browser
which will contain your Laravel Husk test environment.
After scaffolding the test environment, you should have the below folder structure;
Then, navigate into the browser
directory and install the Chrome driver by running the below command:
Usage
Before running your dusk tests, be sure to set the proper base URL to where your JavaScript application will be served from:
After setting the base URL, serve your JavaScript application:
Then, inside of another terminal, navigate into the browser
directory:
And run the below command:
Important: Make sure you've installed the Chrome driver first, via
php application dusk:chrome-driver --detect
With arguments:
Note: You may also insert the below JSON into the
scripts
section of yourpackage.json
file to run your browser tests from your root project directory:
GitHub Actions
You may use the below GitHub action as a template to run your Laravel Dusk tests:
All versions of laravel-husk with dependencies
laravel-zero/framework Version ^10.0
nunomaduro/laravel-console-dusk Version ^1.11
nunomaduro/termwind Version ^1.15