Description
Sail Version
1.27.4
Laravel Version
v10.44.0
PHP Version
v8.3.2-1
Operating System
Linux
OS Version
ubuntu22.04.1+deb.sury.org+1
Description
Hi,
Not sure if this is a Sail issue or a Dusk issue, I decided to register the problem here.
In the Laravel Dusk documentation is states that you can create a seperate ENV file for Dusk testing by naming it .env.dusk.{environment}.
When I do this it appears that the ENV values that were set in .env.local are still used by the system and the dusk specific file is ignored.
This may be something to do with the combination of SAIL + Dusk? I couldn't find a clear example of this working anywhere online but he documentation seems to suggest it should work.
Steps To Reproduce
I created a repo with a test that shows the problem. See the instructions in this commit (copied below as well).
Reproduction
Requirements: check out https://github.com/chrismacp/dusk-bug.git
- Start the sail app:
./vendor/bin/sail up
-
Open the
.env
file in your IDE so you can watch it change as the ENV is updated by Dusk. -
Run e2e test
./vendor/bin/sail dusk
- See that:
- 1 test fails in
tests/Browser/EnvTest
- The first test in the same test file passes when it shouldn't