When it comes to testing anything that stores IP addresses in Laravel, you may want to mock the return value of request()->ip() to verify that something has been stored correctly, etc.
I recently found myself writing a test where I needed to test a macro applied to the Request object in Laravel. But I needed the user to be 'authenticated'.
Despite Dusk integrating flawlessly with the Laravel framework, sometimes your tests just won't run.
Unless you're running end-to-end tests, you probably don't need Vite to build assets before your test suite runs.
Without wasting time, this article will have you set up and running your Dusk test suite on GitHub Actions. We'll also discuss security around any secret keys you may need. Let's take a look.
While Dusk doesn't provide a direct assertion method to check the count of elements on a page, we can still fetch all elements by a selector and then make an assertion on what's returned.