4 ms·
If you use Capybara, a couple of useful notes, based on what I learned implementing js-enabled &headless specs for my SaaS [3]: First, using the poltergeist dr
by thibaut_barrere 11y ago
If you use Capybara, a couple of useful notes, based on what I learned implementing js-enabled &headless specs for my SaaS [3]:
First, using the poltergeist driver [1] which is PhantomJS based will tend to be faster AND raise errors when a javascript error occurs (unlike capybara-webkit), which is really handy if your app has a bit of javascript.
Also, you can inject puffing-billy [2] into the mix: this is a proxy that will allow you to mock XHR queries without touching the javascript libraries. This allows to write full integration specs for scenarios involving libraries like Stripe/Recurly.js etc, but using mocked calls.
[1] https://github.com/teampoltergeist/poltergeist https://github.com/teampoltergeist/poltergeist
[2] https://github.com/oesmith/puffing-billy https://github.com/oesmith/puffing-billy
[3] https://www.wisecashhq.com https://www.wisecashhq.com
- dankohn1 11y agoI recommend using the built-in Rack Test for tests that don't require Javascript, and Poltergeist for tests that do. That is the fastest configuration.
- packersville 11y agoVery good point. I do this when I can so my suit runs much faster.