Or to compliment And

Jul 7, 2010 at 3:04 PM

Hi, have to compliment you on the clean fluent interface of StoryQ. Nice one.

Got a suggestion and as the subject suggests introducing an Or to compliment the And would be good.

        Story is Data Safety
          In order to Keep my data safe
          As a User
          I want All credit card numbers to be encrypted

        With scenario submitting shopping cart
          Given I have typed my credit card number into the checkout page
          When I click the Buy button
            Or I press the return key                                     
            And the browser posts my credit card number over the internet
          Then the form should be posted over https
            Or the data should be sent encypted                   

Whether this is a good way forward or whether an Or suggests a different scenaro I'm not sure.

Jul 7, 2010 at 4:25 PM
Hi Derek Thanks :) I have definitely thought about this :). The problem with "Or" is it implies that either situation is enough for the story to pass. Or (no pun intended) it might imply that the test should run through both code paths. This makes things complicated! It's best to be very clear about what's being tested. In the case you've supplied, it's probably best to actually create two scenarios, and reuse most of your steps. The bits of the story before the "With Scenario" might be simpler to add an "Or" clause to, especially the "As a" section Regards - Rob
Jul 8, 2010 at 4:57 PM

Hello again Rob... 

Someone posted about how StoryQ should support the Gherkin Syntax so I had a look to see what Gherkin was and whether it supported 'Or' and it doesn't... someone must have thought against including Or; I doubt the use of Or has escaped the makers of Gherkin and this is the first time ever it's been mentioned.  It will probably be because of the reasons you mentioned.

Information is here.... http://wiki.github.com/aslakhellesoy/cucumber/given-when-then...

I need to put StoryQ to the test, I'm sitting here projecting circumstances and thinking through how it could be used, need to get my hands dirty with it.

Just glad I've found a good BDD tool out here for .NET. Can finally do some proper TDD!!