Docker with phantomjs container and Hound testing

Rubber ducking debugging here! :smile:

It’s a little bit embarrassing to me. But the error was in the test.exs file. In the Endpoint configuration, I needed to add url: [host: "web"]. In order to change the default localhost endpoint to point to the web container:

config :hcmex, Hcmex.Endpoint,
  http: [port: 4001],
  url: [host: "web"],
  server: true 

Now if I run the tests (there are some IO.inspects):

"http://web:4001/sign_in"
{:ok,
%{browser: "phantomjs", driver: "phantomjs", host: "http://phantomjs",
  path_prefix: nil, port: 8910}}
{:ok, %{host: "http://web", port: 4001}}
.

Finished in 2.4 seconds
1 test, 0 failures

Randomized with seed 427281

And It works! I feel a little bit dumb right now. But I hope this post can help other people.

Cheers!