laravel / dusk

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

Failure with error message: Failed to connect to localhost port 9515 after 0 ms: Could not connect to server #1122

Closed wq9578 closed 2 weeks ago

wq9578 commented 2 weeks ago

Dusk Version

8.2.4

Laravel Version

11.21.0

PHP Version

8.3.9

PHPUnit Version

10.5.17

Database Driver & Version

No response

Description

After updating Laravel with composer update, Dusk fails with the following error message:

Failed to connect to localhost port 9515 after 0 ms: Could not connect to server

Running Dusk directly with php artisan test -v --bail --group=browser (instead from a Makefile) doesn't work either, unlike described here previously.

The update itself was intended to solve a prior problem when starting Dusk:

  session not created: This version of ChromeDriver only supports Chrome version 126
Current browser version is 128.0.6613.85 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

This problem occurred even after updating with php artisan dusk:chrome-driver:

ChromeDriver binary successfully installed for version 128.0.6613.84.

(and after restarting the computer).

Steps To Reproduce

Update Chrome.

Then run:

composer update
php artisan dusk:chrome-driver
php artisan test -v --bail --group=browser

(Assuming that some test(s) belongs to group "browser".)

crynobone commented 2 weeks ago

Duplicate of #1123 and be fixed using the following suggestion: https://github.com/laravel/dusk/issues/1123#issuecomment-2309158134