laravel / dusk

Laravel Dusk provides simple end-to-end testing and browser automation.
https://laravel.com/docs/dusk
MIT License
1.88k stars 322 forks source link

Error message too unspecific #1017

Closed wq9578 closed 1 year ago

wq9578 commented 1 year ago

Description:

This is a follow-up to: https://github.com/laravel/dusk/issues/1016

The error message

Failed to connect to localhost port 9515

was given since the following lines were missing in the test file:

use Tests\DuskTestCase;
uses(DuskTestCase::class);

after commenting out #uses(DuskTestCase::class)->in('Browser'); in Pest.php, which previously specified that all tests in directory Browser should use this class.

The error message is extremely unspecific and should be improved, as users with little experience concerning Dusk will spend much time for finding the cause. It should be easy to check whether this class was loaded or otherwise throw a more specific error message.

Steps To Reproduce:

See above.

driesvints commented 1 year ago

Thanks @wq9578. It looks like this is an improvement and we'd welcome PR's.

wq9578 commented 3 months ago

Update

The same error message:

Failed to connect to localhost port 9515 after 0 ms: Couldn't connect to server

occurs if php artisan dusk:chrome-driver for updating the driver is called immediately before running the Dusk test(s). I'm using Pest. In the past, this hasn't been a problem.

In my case this was from a Makefile, but the error is also reproducible within shell only.

Examples:

Current versions: