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

Not compatible with Chrome v128 #1123

Closed muhammadsaeedparacha closed 2 weeks ago

muhammadsaeedparacha commented 2 weeks ago

Dusk Version

8.2.4

Laravel Version

11.21.0

PHP Version

8.3

PHPUnit Version

11.1.3

Database Driver & Version

No response

Description

Fails to start with latest chrome version, Chrome 128

Tests\Browser\ExampleTest > basic example WebDriverCurlException
Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu"]}}}

Steps To Reproduce

Fresh Laravel Installation Update Chrome to 128

php artisan dusk fails

crynobone commented 2 weeks ago

What's your Chrome version?

wq9578 commented 2 weeks ago

This might be the same problem as mine here. My full error message is:

Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--disable-search-engine-choice-screen"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--disable-search-engine-choice-screen"]}}}

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

My Chrome version is the newest: Version 128.0.6613.85

crynobone commented 2 weeks ago

You should be able to fix the issue by updating the following line from tests/DuskTestCase.php:

    /**
     * Prepare for Dusk test execution.
     */
    #[BeforeClass]
    public static function prepare(): void
    {
        if (! static::runningInSail()) {
-           static::startChromeDriver([]);
+           static::startChromeDriver(['--port=9515']);
        }
    }
35grain commented 2 weeks ago

You should be able to fix the issue by updating the following line from tests/DuskTestCase.php:

    /**
     * Prepare for Dusk test execution.
     */
    #[BeforeClass]
    public static function prepare(): void
    {
        if (! static::runningInSail()) {
-           static::startChromeDriver([]);
+           static::startChromeDriver(['--port=9515']);
        }
    }

This did resolve the issue for me.