Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Cucumber feature syntax convention for a sequential scenario
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mltsy  
View profile  
 More options Feb 21 2012, 3:58 pm
From: mltsy <j...@ownlocal.com>
Date: Tue, 21 Feb 2012 12:58:13 -0800 (PST)
Local: Tues, Feb 21 2012 3:58 pm
Subject: Cucumber feature syntax convention for a sequential scenario
I'm pretty new to cucumber, and I'm just learning the conventions.
One feature I am writing lends itself to a kind of "sequential"
scenario.  Consider this post both a question "Is there already a
conventional way to express this?" and (if not) a proposal of a
convention to express a sequence of events in cucumber scenarios
without separating the events into separate scenarios.  The main
reason is that I feel that, in some cases, splitting it into separate
scenarios is less semantically accurate than keeping it as a single
scenario.

I discovered  that using When... Then ... When ... Then ... works
functionally and semantically (in my opinion) but I wonder if there is
another syntax, or if others agree that that is a good convention to
use for sequential scenarios.  Here's the actual feature I'm working
on:

My original conventional feature definition: http://pastie.org/3428567
My proposed short-hand for a sequential scenario: http://pastie.org/3429140

But here's a better example of something that would be a good sequence
candidate:

Feature: Subscribe to the email list
  In order to easily receive updates via email
  As an end-user
  I want to subscribe to the e-mail list with a single click from the
homepage

  Scenario: Subscribe using a valid e-mail address
    Given I am on the homepage
    When I enter a valid e-mail address
    Then I should see a successful ajax validation message
    And the submit button should light up
    When I hit the submit button
    Then I should see the "successful subscription" page

Notice the interwoven When and Then statements.  What do you think of
this convention for this kind of a scenario?  A nice syntactic sugar
for this might be "And When..." or is there a better, established way
to express this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.