I've spent the afternoon on this and am making no progress, I'm really starting to wonder if it's even possible.
I'm using Angular with Headroom to handle a menu disappearing when scrolling down. My testing is done with Protractor, using PhantomJS, and this is where the fun begins.
PhantomJS does not support .bind()
and Headroom uses it all over the place, which means I need to polyfill it. It should be no problem, but I can't make it work.
I think my problem is that no matter where I run the polyfill function, PhantomJS and the tested page are already loaded, so it's already too late, Headroom will have failed to load due to .bind()
not being available.
Is there any way to run those methods before the page is loaded? I know I could add them to my application via a script tag in the head, but I'd rather not add something to the whole app that will only be used by the testing framework.