sandric
sandric

Reputation: 2470

Spring can't connect to docker selenium container to run capybara via rspec

It looks like running rspec command via spring is unable to connect to local docker container with selenium running on docker-machine under osx to execute capybara tests. When invoking rspec command not via spring server - everything works fine, I can see container logs, and while running with spring - I can see nothing, and bin/rspec output stops on capybara test till I hit ctrl-c.

Here's my spec_helper.rb rspec config for docker:

Capybara.register_driver :dockerized_selenium do |app|
  Capybara::Selenium::Driver.new(app,
  :browser => :remote,
  :url => "http://192.168.99.100:4444/wd/hub")
end

Capybara.app_host = "http://10.0.2.2:3000"
Capybara.server_host = '10.0.2.2'
Capybara.server_port = '3000'

Capybara.javascript_driver = :dockerized_selenium

I'm using this docker image for selenium, with ff for browser. 192.168.99.100 - is my docker-machine's node where container is running and 10.0.2.2 - is my localhost's ip from inside of container.

Anybody see what I'm missing? thx.

Upvotes: 1

Views: 266

Answers (1)

adambsg
adambsg

Reputation: 131

If you are using a proxy you may need to add a dns entry into docker_opts. not sure how your setup, but its in etc/default/docker

Upvotes: 0

Related Questions