Some tricks to help you fix tests that sometimes fail.
Check your at_exit callbacks.
At Collective Idea, we ♥ Cucumber, Capybara and ChromeDriver… and alliteration. But we recently encountered an issue with a very Ajaxy Rails app where we need to test a file download and assert its content.
Swapping out Firefox for Chrome is easier than you think!
There’s something very satisfying about watching your Cucumber test suite run (and pass), especially when the tests are running in your browser. I can’t help but think, “Man, I’m glad I don’t have to do all of this myself.” That’s especially true when your testing requires multiple sessions. The old me would fire up a couple different browsers and get to work. But that was the old me.
At Collective Idea, we do a lot of work with RESTful JSON APIs. They can be a joy to build but a pain to test. We’re currently working on a project that’s all API all the time, so we developed some reusable Cucumber steps for testing. Now, we’ve abstracted all that goodness out into its own gem… json_spec.
Mike Swieton recently posted Never say “Click” advocating the use of custom steps over browser-centric ones. I firmly disagree with with the consequences of that strategy.
Testing with sunspot with cucumber can be tricky since you need to manage the solr process separately. This post introduces a new gem “sunspot_test” and how to easily use it.
Last week the Ruby and Rails twitterverse had an eruption of debate on the choice of testing frameworks. My thoughts come down to this: language matters.
Schedule a tweet for the future using Delayed Job and the Twitter gem. Plus, some goodies on how to test it with Cucumber!
My list of open source tools that made a big impact on our work this year.
Integrating Spreedly into an application is straightforward. Testing it with Cucumber, however, was a little less so. Here’s how we did it.
One of the hardest aspects of development for me has always been anticipating the code I’m going to need to write to solve a problem. BDD saves me from the hassle.
Stakeholders may or may not care about cucumber scenarios, but there is still value in having developers write them.
Nobody knows how to organize cucumber features and steps. Every project has it’s own conventions–that is, if it has conventions at all. Here is a pattern that works for us.
Although they’ve been around for a while, very few people know that factory_girl comes with some really useful cucumber steps.
Cucumber steps are meant to be reused. Keep them generic so you don’t have to work too hard.
We love Cucumber but often see it poorly used and misunderstood. We are beginning a blog series about “Practical Cucumber” to give you tips and tricks and keep you out of a pickle.