I'm trying to run Behat on Docker using selenium/hub
, selenium/node-chrome-debug
and selenium/node-firefox-debug
images.
Running Behat with the Chrome node is working, but the Firefox node gives me the following error:
Could not open connection: Payload received from webdriver is valid but unexpected json: {"value":{"sessionId":"244f4715-c59b-4bfc-aa17-8f6a867ead83","capabilities":{"moz:profile":"/tmp/rust_mozprofile.u3mB4xKf6nVD","rotatable":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"pageLoadStrategy":"normal","moz:headless":false,"moz:accessibilityChecks":false,"acceptInsecureCerts":false,"browserVersion":"57.0","platformVersion":"4.9.60-linuxkit-aufs","moz:processID":1005,"browserName":"firefox","platformName":"linux","moz:webdriverClick":false}}} (Behat\Mink\Exception\DriverException)
When I vnc
to Firefox node, I see it opened Firefox, but nothing is happening.
My docker-compose.yml
:
version: '3.2'
services:
site.local:
image: webdevops/php-apache-dev:7.1
ports:
- "8888:80"
volumes:
- ./public:/app
- .:/application
selenium-grid-hub.local:
image: selenium/hub
ports:
- "4445:4444"
selenium-node-chrome.local:
image: selenium/node-chrome-debug
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-grid-hub.local
- HUB_PORT_4444_TCP_PORT=4444
ports:
- "5901:5900"
selenium-node-firefox.local:
image: selenium/node-firefox-debug
environment:
- HUB_PORT_4444_TCP_ADDR=selenium-grid-hub.local
- HUB_PORT_4444_TCP_PORT=4444
ports:
- "5902:5900"
My behat.yml
:
default:
extensions:
Behat\MinkExtension:
base_url: "http://site.local"
goutte:
guzzle_parameters:
verify: false
suites:
mysuite:
paths: [ %paths.base%/features ]
contexts:
- Zstate\BehatSeleniumDockerSkeleton\Tests\Behat\Context\FeatureContext
chrome:
extensions:
Behat\MinkExtension:
selenium2:
browser: "chrome"
wd_host: http://selenium-grid-hub.local:4444/wd/hub
capabilities: {"browserName": "chrome", "browser": "chrome", 'chrome': {'switches':['--no-sandbox']}}
firefox:
extensions:
Behat\MinkExtension:
selenium2:
browser: "firefox"
wd_host: http://selenium-grid-hub.local:4444/wd/hub
capabilities: {"browserName": "firefox", "browser": "firefox"}
I created this small repo to replicate the issue.
I would greatly appreciate any help or advice. Please let me know if I miss something in my question so I can update it.