bbc / wraith

Wraith — A responsive screenshot comparison tool

Home Page:http://bbc-news.github.io/wraith/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP error codes not detected as failures

jimbobhickville opened this issue · comments

If the URL you are attempting to snapshot returns a 404, 502, 503, 504, etc, the job takes a snapshot of the error page in the history, then snapshots the error page for the comparison, resulting in a successful comparison because the content was unchanged. It should fail to take the original snapshots on anything but a 200 OK response, or at least make that option configurable.

Is this a limitation of the underlying phantom library? It appears that even though it's getting an http error response, the status is successful in the library. It seems to only fail if it can't talk to the http server at all. If that's the case, would one of the other drivers give more flexibility?

I looked into this more and apparently this is only possible with the onResourceReceived callback:

http://phantomjs.org/api/webpage/handler/on-resource-received.html