I have a Homestead installation running with Behat to test my Laravel project. I am running into some problems when using the @javasccript tag to run my tasks as Selenium.
I have downloaded Selenium standalone server on my Windows host machine. Its version is 2.42.2
In my behat.yml i have got the following configuration:
default:
extensions:
Behat\MinkExtension:
base_url: http://my.app:8000/
sessions:
default_session:
goutte: ~
selenium_session:
selenium2:
wd_host: http://x.x.x.x:4444/wd/hub/static/resource/hub.html
suites:
functional:
paths: [ %paths.base%/features/functional ]
contexts: [ LaravelFeatureContext ]
However when I run my scenarios I get the following error:
Given I am on the "/users/create" page #
LaravelFeatureContext::iAmOnThePage()
Could not open connection: Curl error thrown for http POST to http://x.x.x.x:4444/wd/hub/static/resource/hub.html/session with
params: {"desiredCapabilities":{"tags":["homestead","PHP
5.6.0-1+deb.sury.org~trusty+1"],"browserName":"firefox","version":"21","platform":"ANY","browserVersion":"9","browser":"firefox","ignoreZoomSetting":"false","name":"Behat
feature suite","deviceOrientation":"portrait","deviceType":"tablet"}}
Failed to connect to 127.0.0.1 port 4444: Connection refused (Behat\Mink\Exception\DriverException)
When i go to http://x.x.x.x:4444/wd/hub/static/resource/hub.html I see that the selenium hub is up and running.
Could the issue here be that I am running Behat from the homestad terminal through SSH and that does not resolve to the IP address of the hub? Because the ip address of the host is localhost
How can I solve this?
It has something to do with the fact that Mink is starting a firefox session on the Homestead box in stead of on the Host box.