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

Mistral's avatar

Dusk doesn't work. App updated to Laravel 5.4

Hello,

yestarday I have updated my application from 5.3 to 5.4 laravel. I don't know if it is imporant, but I use laradock Docker for this app with running: nginx, php, mysql, beanstalkd, beanstalkd-console, redis, workspace. What I have done:

  • copied tests directory from fresh laravel 5.4 application
  • composer require laravel/dusk
  • add DuskServiceProvider in config/app.php
  • run php artisan dusk:install
  • run php artisan dusk and got:
PHPUnit 5.7.6 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 2.5 minutes, Memory: 10.00MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}

Operation timed out after 30000 milliseconds with 0 bytes received

/home/st/Code/myapp/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:287
/home/st/Code/myapp/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:121
/home/st/Code/myapp/tests/DuskTestCase.php:32
/home/st/Code/myapp/vendor/laravel/dusk/src/TestCase.php:180
/home/st/Code/myapp/vendor/laravel/framework/src/Illuminate/Support/helpers.php:639
/home/st/Code/myapp/vendor/laravel/dusk/src/TestCase.php:181
/home/st/Code/myapp/vendor/laravel/dusk/src/TestCase.php:111
/home/st/Code/myapp/vendor/laravel/dusk/src/TestCase.php:85
/home/st/Code/myapp/tests/Browser/ExampleTest.php:21

What's going on? How can I run propely tests?

0 likes
10 replies
mdecooman's avatar

Do you have your APP_URL=http:// in your .env file pointing to the correct URL?

mdecooman's avatar

Ok you may want to add in your docker-compose.yml

environment:
    - DBUS_SESSION_BUS_ADDRESS=/dev/null

sources: here and here

Mistral's avatar

Now I back to vagrant's Homestead and still not working. So it is not depends on laradock which doesn't have chrome container.

mdecooman's avatar

I ditched homestead for valet and sleep much better since...

you have the exact same error with homestead?

Mistral's avatar

Maybe it could help to resolve problem:

I have downloaded chromedriver from https://sites.google.com/a/chromium.org/chromedriver/ and starts it manually from console. Then command php artisan dusk works. But it opens webbrowser :)

In other side when type php artisan dusk I see proccess on port 9515 in my system but why it doesn't work? Only work if I manually starts chromedriver.

1 like
brandonferens's avatar

I'm having the same issue. If I figure it out, I'll let you know.

pakuize's avatar

@Mistral it is supposed to open a browser.

and have you added the chromedriver to your environment ? as described on the google page.

brandonferens's avatar

I finally figured out what was wrong with my install. For some reason the permissions on the chrome drivers in vender/laravel/dusk/bin are set to 0664, when they should be 0755.

Running chmod -R 0755 vendor/laravel/dusk/bin fixed the issue, but I have a feeling that pulling an updated composer package may overwrite this. I have a question in to Taylor at https://github.com/laravel/dusk/issues/81

1 like

Please or to participate in this conversation.