Qqwy

Qqwy

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.

Showing Posts 1 to 3

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

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews