Qqwy

Qqwy OP

TypeCheck Core Team

I am working on setting up integration testing of our Phoenix-application using Hound. I encountered a very strange error, which is that when using PhantomJS as Hound browser driver, Cowboy will reject all incoming connection with an ‘error 400’.

Searching the internet I found out that other people had a similar problem with Cowboy as well: PhantomJS does not by default seem to add a Host:-header to the requests it does, which is against the HTTP spec and rejected by Cowboy (as well as happily accepted by most other webservers).

Switching to Selenium+Firefox instead of PhantomJS and everything works fine.
So just a heads-up that this issue exists. I’m not sure how this could/should be resolved; what would be the best approach?

  • Ask the developers of PhantomJS to alter its default settings so it follows the spec.
  • Update Hound so it requests PhantomJS to set a Host:-header when connecting.
  • Update Hound so it has the possibility to add custom HTTP headers from your own code.
  • Ask the people behind Cowboy to create a way to accept requests with missing Host:-headers.

First 3 of 3 Posts Switch mode

idi527

idi527

I think it might be easier to switch to chrome. I’m not sure if there’s anyone left to develop phantomjs further at this point: Redirecting to Google Groups.

I mostly use GitHub - puppeteer/puppeteer: JavaScript API for Chrome and Firefox · GitHub for “end-to-end” tests.

Qqwy

Qqwy OP

TypeCheck Core Team

At first I switched to Selenium + Firefox, but lo and behold, Hound crashes whenever you try to run a find_element because it cannot understand the current format that is returned by the webdriven Firefox.

The Selenium+Chrome driver still works fine, though.

@idi527 Do you use puppeteer instead of Hound, or somehow from within Hound? I’d like to keep all my tests in Elixir-land, because the existing tests are, and because most of the stuff is server-side related anyway.

idi527

idi527

Do you use puppeteer instead of Hound, or somehow from within Hound?

Yes, I got frustrated with Hound and Wallaby at the time, and just wrote these tests in js, which was surprisingly easy.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

ElixirConf
Lightning Talk: Jacob Swanner - Put your Scaller (Named Correctly) | ElixirConf US 2025 https://www.youtube.com/watch?v=dqqZSSxs-MA Co...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement