Re: Running ReSpec in headless browser?

On Nov 28, 2011, at 10:45 , Dominique Hazael-Massieux wrote:
> Has anyone managed to get the transformed DOM out of a ReSpec document
> via a headless browser? I tried with with zombie.js, but without success
> (no error message, but the DOM isn't transformed either).

I've successfully done it using PhantomJS. The problem you'll have (and that maybe you're seeing with zombie.js) is that you can't capture the DOM on load: that's when ReSpec *starts* doing its thing, so the DOM won't be transformed. What I did (it was just a hack) was that I intercepted a log message and then set a timeout to allow async operations to complete. Ideally, ReSpec would dispatch some kind of event when it's done; that would make things a lot easier.

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Received on Monday, 28 November 2011 10:18:17 UTC