2

I have a Laravel 8 application running with Lando and I'm trying to figure out why when I have the following setup of the Lando container its not running my Dusk tests. I have provided as much information about my setup as I believe will assist in the problem.

composer.json

"laravel/dusk": "^6.13",

Terminal

± lando start
Let's get this party started! Starting app teach-me...
Starting landoproxyhyperion5000gandalfedition_proxy_1 ... done
Starting teachme_database_1     ... done
Starting teachme_chromedriver_1 ... done
Scanning to determine which services are ready... Please standby...
                                                                   

Your app has started up correctly.
Here are some vitals:

NAME            teach-me                                      
LOCATION        /Users/me/my-app
SERVICES        chromedriver, appserver, database             
APPSERVER URLS  https://localhost:55000                       
                http://localhost:55001                        
                http://my-app.lndo.site/                    
                https://my-app.lndo.site/                   

± lando artisan dusk
PHPUnit 9.5.0 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 00:01.416, Memory: 26.00 MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\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"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"args":["--window-size=1920,1080","--disable-gpu","--headless"]}}}

Failed to connect to localhost port 9515: Connection refused

/app/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:332
/app/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:135
/app/tests/DuskTestCase.php:46
/app/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:218
/app/vendor/laravel/framework/src/Illuminate/Support/helpers.php:234
/app/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:219
/app/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:97
/app/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:65
/app/tests/Browser/ExampleTest.php:23

docker-compose.yml

version: '3'

services:
  chromedriver:
    image: robcherry/docker-chromedriver:latest
    volumes:
      - /dev/shm:/dev/shm
    expose:
      - "4444"
    environment:
      CHROMEDRIVER_WHITELISTED_IPS: ""
      CHROMEDRIVER_URL_BASE: "/wd/hub"
    security_opt:
      - seccomp:unconfined

lando.yml

name: my-app
recipe: laravel
compose:
  - docker-compose.yml
config:
  php: '8.0'
  webroot: /public
  database: mysql
  xdebug: true

.env.dusk.local

APP_URL=http://my-app.lndo.site
  • 2
    Dusk is bundled with its own chromedriver binary. There may be a conflict (though not sure how you would go around in solving it) – apokryfos Mar 11 '21 at 16:32
  • 1
    Did you try exposing chromedriver on port 9515 in docker-compose.yml? – Bart Mar 15 '21 at 18:06

0 Answers0