W3C home > Mailing lists > Public > spec-prod@w3.org > October to December 2011

Re: Running ReSpec in headless browser?

From: Robin Berjon <robin@berjon.com>
Date: Mon, 28 Nov 2011 11:17:45 +0100
Cc: spec-prod@w3.org
Message-Id: <0E4E96B6-5D19-4333-ACB3-4A5C24A2C3E5@berjon.com>
To: Dominique Hazael-Massieux <dom@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:19:18 GMT