Live data from Hacker News

Capybara: Acceptance test framework for web applications

github.com

11–20 of 20 posts

Re: Capybara: Acceptance test framework for web applications

#12

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? Either way, I really enjoy Capybara -- especially being able to jump between different drivers for various reasons.

Yeah, it feels like we're partying like it's 2011. I have no idea why this is one the front page either.

Re: Capybara: Acceptance test framework for web applications

#13
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

[2] https://github.com/oesmith/puffing-billy

[3] https://www.wisecashhq.com

Re: Capybara: Acceptance test framework for web applications

#14
post #8
post #2

so, yet another later on top of seleniun or I'm missing something?

Selenium is one of the many drivers it can use. This is a DSL for driving a browser.

Indeed, it also works with webkit (capybara-webkit) and phantomjs (poltergeist driver) too.

Re: Capybara: Acceptance test framework for web applications

#15

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 th…

I 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.

Re: Capybara: Acceptance test framework for web applications

#17
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.

Re: Capybara: Acceptance test framework for web applications

#18

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 th…

I 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.

Very good point. I do this when I can so my suit runs much faster.

Re: Capybara: Acceptance test framework for web applications

#19

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? Either way, I really enjoy Capybara -- especially being able to jump between different drivers for various reasons.

Things get upvoted for a lot of reasons, chief of which is getting tips from people who use the same tool, like the comment that tops the list right now.
Post reply on HN