In my docker-compose file I am passing this environment variable to the PHP containers that runs the tests:
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", null, "http://chrome:9515"]'
If I pull the latest webdriver-chromedriver:dev build from Dockerhub it crashes with the following error:
1) Drupal\Tests\views\FunctionalJavascript\PaginationAJAXTest::testBasicPagination
An unexpected error occurred while starting Mink: Could not open connection: unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Linux 4.9.87-linuxkit-aufs x86_64)
If I download the latest Dockerfile from GIT and use that then I get
1) Drupal\Tests\views\FunctionalJavascript\PaginationAJAXTest::testBasicPagination
An unexpected error occurred while starting Mink: Could not open connection: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf),platform=Linux 4.9.87-linuxkit-aufs x86_64)
This Stackoverflow question might be related to this issue, but adding the mentioned arguments did not work for me. I tried to pass these arguments multiple different ways to the chromedriver:
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"switches": ["--no-sandbox", "--disable-dev-shm-usage"]}, "http://chrome:9515"]'
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"args": ["--no-sandbox", "--disable-dev-shm-usage"]}, "http://chrome:9515"]'
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"args": "--no-sandbox --disable-dev-shm-usage"}, "http://chrome:9515"]'