Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Laravel sail + dusk

Hello,

I have followed the documentation to install dusk with sail.

I run the test with php artisan dusk and I get this error.

   FAILED  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","--headless=new"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--headless=new"]}}}

Failed to connect to localhost port 9515 after 0 ms: Connection refused

  at vendor/php-webdriver/webdriver/lib/Exception/Internal/WebDriverCurlException.php:20
     16▕         }
     17▕ 
     18▕         $message .= "\n\n" . $curlError;
     19▕ 
  ➜  20▕         return new self($message);
     21▕     }
     22▕ }
     23▕ 

      +3 vendor frames 
  4   tests/DuskTestCase.php:39
      +1 vendor frames 
  6   tests/Browser/ExampleTest.php:16
   FAILED  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","--headless=new"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","goog:chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--headless=new"]}}}

Failed to connect to localhost port 9515 after 0 ms: Connection refused

  at vendor/php-webdriver/webdriver/lib/Exception/Internal/WebDriverCurlException.php:20
     16▕         }
     17▕ 
     18▕         $message .= "\n\n" . $curlError;
     19▕ 
  ➜  20▕         return new self($message);
     21▕     }
     22▕ }
     23▕ 

      +3 vendor frames 
  4   tests/DuskTestCase.php:39
      +1 vendor frames 
  6   tests/Browser/ExampleTest.php:16

Probably a problem with the chrome driver.

On Ubuntu, I'm using Chromium, is it possible that chromium is not compatible with Dusk ?

Any other idea why it doesn't work ?

And if the problem is effectively Chromium, is there any possibility to have the dusk tests run without having to install Chrome on Ubuntu ?

Thanks for your help.

V

0 likes
0 replies

Please or to participate in this conversation.