In this episode, we're jumping straight into getting Laravel Dusk set up alongside Pest so you can start writing end-to-end browser tests for your Inertia-powered apps. We start from scratch, spinning up a fresh Laravel application with the Breeze starter kit (using Inertia and Vue), and opting in for Pest as the testing framework.
You'll see how we connect the app to MySQL, run migrations, and take a quick tour of the test directory that comes out of the box. We talk about the difference between feature and browser tests—feature tests just hit endpoints like an API request, but browser (Dusk) tests actually launch a real browser session so we can truly interact with our app just like a user would.
Next up, we install Dusk using Composer, set it up with php artisan dusk:install
, and take a look at the new scaffolding it adds (including all the browser stuff). We also handle an important bit: making sure our ChromeDriver binaries are up to date and correctly matched with our installed browser versions using a handy artisan command.
Then, we go through running our first Dusk test, explain what happens in headless mode vs opening the browser visually, and how to use things like the pause
method to observe what's actually happening during a test run. Troubleshooting is covered too—like fixing permissions that might cause "couldn't connect to server" errors.
We wrap up by stressing how important it is to keep your dev server running (npm run dev
) so that Dusk always tests the latest version of your frontend. By the end of this episode, you’ve got Dusk up and running with Pest and are ready to dive into real, interactive end-to-end testing for your app!