views:

33

answers:

1

In our Cucumber steps, we would like to start a long running task in one step and check that the task is running and that it set up the UI for the task correctly, in another step. Checking the UI must be done while the first step is still running. Our Cucumber looks similar to this:

Given I start my long running task  
And I navigate to application status page  
Then I should see "Status" in the html  

We are using the DelayedJob gem to complete our long running tasks and currently run Delayed::Job.work_off in a new thread.

What is the best way to run steps concurrently with Cucumber?
Is there an officially supported way to do this?

A: 

You may want to take a look at

Spork

http://github.com/timcharper/spork

or Hydra

http://github.com/ngauthier/hydra

I am not entirely sure, that you can run steps in parallel. Features/scenarios you can. I am assuming this because of the long running task right ?

If my assumption is correct, Delayed::Job.work_off is the best way, if that is taking really long, you can mock/stub the process. Test the worker/process separately, this way your scenarios can run without any delay, and you delayed job is tested separately. ( This can be analogues to testing models and controllers separately)

Rishav Rastogi
Thanks for the suggestion. We might start using Hydra to speed up our tests.It doesn't answer this question though. We need to run steps in parallel not tests.
Sean
Updated answer..
Rishav Rastogi