Story Runner => Cucumber(duplicate steps)!

Hi,

I am currently moving over my Watir Story Runner tests over to Cucumber.

However, I have a verification_steps.rb that holds these two steps

Then “the user is at ‘$title’ page” do |title|
browser.wait_until_includes(title)
end

Given “the user is at ‘$title’ page” do |title|
browser.wait_until_includes(title)
end

I think these are both valid ‘Whens’ and ‘Thens’, but I am getting a
duplicate error from Cucumber.

Any opinions or suggestions please?

Aidy

On Tue, Sep 23, 2008 at 11:18 AM, aidy lewis [email protected]
wrote:

Given “the user is at ‘$title’ page” do |title|
browser.wait_until_includes(title)
end

I think these are both valid ‘Whens’ and ‘Thens’, but I am getting a
duplicate error from Cucumber.

I see a Given and a Then. Can you clarify?

On Tue, Sep 23, 2008 at 6:18 PM, aidy lewis [email protected]
wrote:

Given “the user is at ‘$title’ page” do |title|
browser.wait_until_includes(title)
end

I think these are both valid ‘Whens’ and ‘Thens’, but I am getting a
duplicate error from Cucumber.

Any opinions or suggestions please?

Cucumber doesn’t distinguish between Given/When/Then. Just delete one of
them.

On a more semantic note - I usually recommend that:

  • Given and When steps be expressed (grammatically) as non-negotiable
    facts
  • Then steps be expressed (grammatically) as expectations (“should be
    at the home page”)
    Should | ENGLISH PAGE

“Then” steps represent the outputs of your system, which is often
related to the feature’s business value. What you get out of a
system and it’s behaviour is not a fact, it’s an expectation :wink:

Aslak