Laravel 5.7.9
Dusk 4.0.2
Mac High Sierra 10.13.5
MAMP Pro 5.1.1 w/ PHP 7.2.8
Sporadically, when I run php artisan dusk nothing happens. No errors, no output, nothing.
To demonstrate the "nothingness", here's a short video clip.
Same nothingness occurs when running php artisan dusk -vvv.
I am able to run individual tests by specifying the file name, e.g. php artisan dusk /path/to/site/tests/Browser/PagesTest.php
I've run each of my individual tests this way - thinking maybe one was short-circuiting it - but they all run fine when invoked individually.
Does this issue only affect a single Laravel project?
Yes - only affecting this specific project. Just did a fresh Laravel install and it was not a problem there.
Have you tested it in Homestead or on a different machine?
Figured it out: I had two different Browser test files with the same class name.
It happened when I duplicated an existing test to create a new one and forgot to change the class name.
I was getting no output, but behind the scenes it was a PHP error.
I've since learned that if I add the following to phpunit.dusk.xml, it will show the error:
<php>
<ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" />
</php>
Now, when a mistake like that exists, I get useful feedback:
$ php artisan dusk
Fatal error: Cannot declare class Tests\Browser\AccountTest, because the name is already in use in /tests/Browser/GroupTest.php on line 30
@susanBuck you have no idea how long I've been troubleshooting this problem. I never thought to look for classes with the same name after a duplication! Thanks x1000000
@lukejamesmorrison Glad it helped!
Most helpful comment
Figured it out: I had two different Browser test files with the same class name.
It happened when I duplicated an existing test to create a new one and forgot to change the class name.
I was getting no output, but behind the scenes it was a PHP error.
I've since learned that if I add the following to
phpunit.dusk.xml, it will show the error:Now, when a mistake like that exists, I get useful feedback: