HashNuke / hound

Elixir library for writing integration tests and browser automation
http://hexdocs.pm/hound
MIT License
1.36k stars 144 forks source link

How to sideload PhantomJS Polyfills? #120

Open fahrradflucht opened 8 years ago

fahrradflucht commented 8 years ago

I get:

TypeError: undefined is not a constructor (evaluating 'Object.assign({}, state, {
            isFetching: true
          })')

from PhantomJS because Object.assign() seems to be missing. I would like to polyfill it, for example with phantomjs-polyfill-object-assign.

As declared in the Readme of the mentioned project, in Karma you are able to sideload javascript files into Phantom/the page. How would one go about that with hound?

I know polyfilling Object.assign isn't that much code so I could probably do it in the project itself but I would rather not do it if it isn't necessary.

danhper commented 8 years ago

IIRC, PhantomJS 2 should support Object.assign correctly.

Otherwise, I suggest you just add the polyfill to your project, as I do not think this is really the job of Hound, which is an interface to an external webdriver.

@HashNuke What do you think?

fahrradflucht commented 8 years ago

I use PhantomJS 2 it neither supports Object.assign nor Promises.

I think it's a valid feature for hound to support polyfilling the web driver environment for cases were PhantomJS lags behind the minimum browser versions you would like to support. How is hound different then Karma in that perspective?

phanimahesh commented 7 years ago

Looks like with Chrome and Firefox working on headless modes, PhantomJs is going to be discontinued. Is this issue still relevant?