[rspec-users] Cucumber speed tips

Josh Knowles joshknowles at gmail.com
Sun Dec 28 11:30:08 EST 2008


On Sat, Dec 27, 2008 at 12:52 PM, Ben Mabey <ben at benmabey.com> wrote:
> On 12/27/08 1:08 AM, Mischa Fierer wrote:
>>
>> As some of us have been using cucumber for quite a while now, I may not be
>> the only one wishing his many steps ran a bit faster.
>>
>> Let's try to put together a quick FAQ for people looking to speed up their
>> steps.
>>
>> Here's my ideas:
>>
>> 1) Consolidate steps
>> You only need to test login for each login case, not for each time you are
>> testing some sort of logged in functionality.
>> In most cases you can just post to sessions/create rather than filling in
>> a login form.
>>
>> 1a) Don't use GivenScenario
>> Instead, make one step that will quickly do what the scenario you want to
>> start at the end of does. E.g. rather than fill in a form and post to a
>> controller to create an object, just create the object in its own step.
>>
>> 2) Use the profiler format
>> I've only tried this a few times, but the profile formatting appears to be
>> useful.
>>
>>
>> Anybody else have any tips?
>
> 3) Seed your database in your support files.  For static data that will be
> used over and over again you can save time by only inserting it once in your
> DB at the start of the run.  For example in env.rb you could say:


4) Distribute your scenarios across multiple processes using TestJour
(http://github.com/brynary/testjour)


-- 
Josh Knowles
phone: 509-979-1593
email:  joshknowles at gmail.com
web:    http://joshknowles.com


More information about the rspec-users mailing list