Johnson/envjs support for Capybara (was Re: [Capybara] driver specs with node path support ...)

2 views
Skip to first unread message

Steven Parkes

unread,
Feb 18, 2010, 9:53:29 PM2/18/10
to ruby-c...@googlegroups.com, en...@googlegroups.com, johnso...@googlegroups.com
[Adding the envjs and johnson lists, rather than posting separately. This thread is about envjs support in Capybara, the webrat-like full stack testing framework for rack applications like Rails, Sinatra, etc.]

On Feb 15, 2010, at Feb 15,1:23 PM , Jonas Nicklas wrote:

> P.S.: what kind of driver are you writing?

I've added Capybara driver support for Johnson/Tracemonkey and env.js. I just committed it to my fork, http://github.com/smparkes/capybara.

Full javascript support in the same process, so you don't need a browser and you can reach over into the DOM at any time during debugging. Uses all the rack-test stuff and integrates it so that actions on the javascript side like form submits get routed back to rack-test, regardless of how they're triggered.

It passes all the specs but has an huge gapping memory leak (all windows are kept forever) so it takes gigabytes to run all the specs at one time. So can't be considered better than alpha until that's tracked down and fixed. Not all that quick right now for several reasons. We'll see where that goes when the memory leaks are plugged.

Don't try to use this with anything that uses threads. It'll almost surely core. And there seem to be issues running it against 1.8.6. I haven't had any problems with 1.8.7-p249.

I do need one change to the driver API: the wait loop in the session needs to call into the driver in case it needs to do something, which it does in envjs (run the javascript timer loop).

My strawman for the API is

http://github.com/smparkes/capybara/commit/288ab24f441154a68328f94a738430412116991a

It kinda borks the default arguments though. I figured I'd let you take a nicer crack at it.

Reply all
Reply to author
Forward
0 new messages