skip to Main Content

I have been following this info https://laravel.com/docs/10.x/sail#laravel-dusk to get dusk to work with sail.

When I try to run a dusk test with: sail dusk

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

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

what do you think this is?

I am on a mac, with Firefox as default browser. Nothing of this should matter (right?) since I use sail and are using a dockerized local env.

2

Answers


  1. Make sure you have selenium defined in your docker-compose.yml. If not, follow documentation here: https://laravel.com/docs/10.x/sail#laravel-dusk

    Also you need to run "sail dusk" instead of "sail artisan dusk".

    Login or Signup to reply.
  2. This could be an SSL thing.

    The simplest way to check would be to edit your driver() method in tests/DuskTestCase.php to allow your web driver to accept insecure certificates.

    return RemoteWebDriver::create(
        env('DUSK_DRIVER_URL', 'http://selenium:4444/wd/hub'),
        DesiredCapabilities::chrome()->setCapability(
            ChromeOptions::CAPABILITY,
            $options
        )->setCapability('acceptInsecureCerts', true)
    );
    

    If that solves it you can either keep it like that review your SSL cert config

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search