drugpl/bbq — Issue #19: Don't run so many browser instances
Author: jdudek
Created: 2011-12-10 20:47:47+00:00
State: open

Currently bbq creates new Capybara session for each TestUser in tests. That means running separate browser process when using Selenium. Spawning those processes takes a considerable amount of time on each tests run.

I think we could speed up our tests and also use less memory if we reuse Capybara sessions between tests. A few weeks ago I wrote a sample implementation: https://gist.github.com/1456271

I'm pretty sure it could be improved. (I don't like the idea of passing `TestUser` class, but I needed `Bbq::TestUser#page` to call `reset!`; maybe we need an object encapsulating Capybara session and pass that object to `TestUser.new`). Also, this implementation needs thorough testing. I recall it didn't work quite well in some cases...

What do you think?