Pages

Wednesday, June 20, 2012

My Current Dilemma: Resolved (Sorta)!

Yesterday, I mentioned that i had some issues with making my tests for Cucumber be totally random if I wanted them to be. I also asked the test community out there to chime in with their thoughts and their approaches to how to handle this. I received a number of replies through Twitter and email, and it even got the attention of one of my team's developers, who when I told him what I was aiming to do, did some digging of his own... and here's what he found:



Basically, if you add this to your env.rb file, it will shuffle your feature file.

I've tested this, and it does indeed work. No tweaks, no file name or directory changes needed. The only thing is that it's either on or off, so my next step is to see what it will take to set this as a flag to rake. It would be sweet to just say something like "

rake cucumber:tag:machine:random


To have randomized runs, and not include the random tag to have them run in standard, alphabetical order.


I'm not 100% of the way there, but this is pretty good so far :).

No comments:

Post a Comment