Skip to content

Commit

Permalink
Try to guess server's IP when there's more than one
Browse files Browse the repository at this point in the history
The previous way of guessing the IP address of the server
for Capybara tests failed if we had more than one IP address.

This new way doesn't guarantee to pick the right IP, but it
works strictly better than the previous one.
  • Loading branch information
matiasgarciaisaia committed Nov 12, 2021
1 parent e6ab53d commit b985b99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/selenium_docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def setup_capybara_docker_driver_if_needed
unless ENV['SELENIUM_URL'].nil? || ENV['SELENIUM_URL'].empty?
ip = `/sbin/ip route|awk '/scope/ { print $9 }'`.gsub("\n", "")
ip = `/sbin/ip route|awk '/scope/ { print $9 }'`.split("\n").last

Capybara.javascript_driver = :docker_firefox
Capybara.server_port = 55555
Expand Down

0 comments on commit b985b99

Please sign in to comment.