I currently have PhpStorm running Dusk Test successfully however, I would like it to use the testing database I have set up. Per other threads and resources online, I have created the .env.dusk.local and phpunit.dusk.xml that points to the testing database I have created. When I run the dusk tests in PhpStorm the application that is rendered in Chromium doesn't use the testing database that is described in these files but when I run them using php artisan dusk in the terminal it uses the correct databases.
It seems like I need make phpstorm aware of what env file to use when running the tests. Any clues on how to make this work.
If you're running the tests using
artisan dusk, make sure that theAPP_ENVsetting you are running Dusk in matches the.env.dusk.[environment]setting.The Dusk browser instance always use the current .env file so...
From the Laravel Dusk docs:
If you're not running the
artisan duskcommand to run your Dusk tests, I suspect that you would have to do something similar to this code before and after running the test suite: https://github.com/laravel/dusk/blob/2.0/src/Console/DuskCommand.php#L136If you get this working I'd be very interested in how you did it.