Capybara has been a part of my/our workflow for a while; I'm curious why this is on the frontpage -- is there a specific update I'm missing?<p>Either way, I really enjoy Capybara -- especially being able to jump between different drivers for various reasons.
If you use Capybara, a couple of useful notes, based on what I learned implementing js-enabled &headless specs for my SaaS [3]:<p>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.<p>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.<p>[1] <a href="https://github.com/teampoltergeist/poltergeist" rel="nofollow">https://github.com/teampoltergeist/poltergeist</a><p>[2] <a href="https://github.com/oesmith/puffing-billy" rel="nofollow">https://github.com/oesmith/puffing-billy</a><p>[3] <a href="https://www.wisecashhq.com" rel="nofollow">https://www.wisecashhq.com</a>
Capybara's a great too that we use heavily at <a href="https://www.incoin.io" rel="nofollow">https://www.incoin.io</a>. One of the hangups we had is with multiple API endpoints being hit for a particular page. In some instances the first API request would finish and Capybara would assume that loading is done, when really there's another API request pending meaning our promises haven't yet finished and tests would fail randomly.<p>In order to prevent this you need to delay Capybara's processing so that all requests have finished using a request counter. Information is here: <a href="http://tonyhb.com/stop-treading-water-with-marionette-and-capybara" rel="nofollow">http://tonyhb.com/stop-treading-water-with-marionette-and-ca...</a><p>Other than that, Capybara is absolutely amazing. It doesn't replace manual UI testing by any means, though it provides a lot of confidence knowing we haven't broken critical components of our app.
If you liked this, you might also like the following: <a href="https://github.com/webdriverio/cucumber-boilerplate" rel="nofollow">https://github.com/webdriverio/cucumber-boilerplate</a> , not as detailed as Capybara but similar
I think that your ultimate goal is to rely on Capybara for your testing as little as cleverly possible. Push all your logic into separately-unit-testable JS, perhaps use a DOM emulator, anything to get away from slow, barely-deterministic full browser Capybara testing.
I was disappointed that the subtitle wasn't "tighter and tighter testing". <a href="http://i.imgur.com/1aD54YR.jpg" rel="nofollow">http://i.imgur.com/1aD54YR.jpg</a>