Search code examples
capybarapoltergeist

Capybara / Poltergeist Internals: Running the Server in a Separate Process/Environment


I'm attempting to use Capybara and Poltergeist to automate taking screenshots of my Rails application. I already have this sort of working, and I've integrated the functionality with Rails' asset pipeline. (See this question for more on that.)

While testing my current setup, however, I've noticed lots of weird issues that seem to be caused by Capybara and my application running in the same process. Is there a way to make Capybara run its server in a separate process, in a different environment?


Solution

  • You can make Capybara run against an external server by following the directions in the "Calling remote servers" section of the README. I think your best bet would be to fork an external server yourself before calling Capybara (e.g., in a rake task or a hook in your testing framework) and then treat it as a remote server in Capybara.