search for: givenscenario

Displaying 9 results from an estimated 9 matches for "givenscenario".

2008 Mar 14
5
Branching scenarios, GivenScenario and database
...ot some branching scenarios where I want to follow a scenario, to establish a base situation, and then have different scenarios which ''branch'' out from that state, possibly several levels deep. I asked a bit about this a few days ago, and David pointed out the rather undocumented GivenScenario which seems to give the basic ability to do what I''m after. So far it''s been working fairly well, but I''ve run into a few quirks. 1) I''ve been working through my scenarios, and I''d commented out the later ones to cut down on the ''pending'...
2008 Nov 04
8
Testing a wizard with Cucumber
Assuming you have a multi-step wizard like thing, with lots of different states and paths through it. What approach would your use to write a feature for it? What I want to do is do the separate states and then reuse these things in more complex scenarios that cover paths. For example Scenario: State A Given I''m ... And I''m ... When I ... Then I should see And I at
2008 Mar 11
2
Composed Stories/Scenarios
In using stories, I find myself wanting to build scenarios on top of each other, For example I want something like Scenario: The user logs on Given a And b When c And d Then e And f Scenario: The user changes his password Given the user logs on And g Then h In other words, I''d like to write the second scenario starting with the ''state'' produced by
2007 Sep 21
11
given_it
Hello, Just decided to check whether I am doing something that makes sense or not. I was thinking about how cool would it be to re-use examples (just like we reuse story scenarios with GivenScenario). I was not sure if this possibility already exists in rspec (and, honestly, was lazy to check), so I have created this helper: def given_it(name) example_definition = behaviour.example_definitions.find{|i| i.description == name } instance_eval(&example_definition.example_block) e...
2008 Nov 26
5
could one scenario depend on another in cucumber?
I think it is a common test case you would meet. For example, you want to test a user registry scenario. You write: Scenario: User Registry When I dosth Then I dosth ... And now business has some changes. Register should have to activate his account by a secret code sent by mobile phone. So you need to write the other scenario: Scenario: User Registry and Account Activation By Mobile
2008 Mar 13
22
Specifing methods in a steps_for block
Hey list, I''m refactoring some much-used functionality into a common_steps step group. Methods like this are in there: steps_for :common do Given "a number of existing $types?" do |type| @initial_item_count = type.singularize.classify.constantize.count end When "the user adds an invalid $type" do |type| post
2007 Nov 15
7
Plain Text Stories Chaining Scenarios
I''m writing a plain text story (testing the waters) and I have scenarios that I need to chain in my specs. Here is what I have so far: Story: User purchasing tshirts As a user I want to checkout So that I can purchase shirts Scenario: User goes to checkout with nothing in cart Given a user And user has an empty cart When user goes to checkout Then user
2007 Dec 22
4
StepGroup ?
Hi, I have a need for the StepGroup feature in stories but not clear what''s the current api. Could you provide an example? In my case I have several scenarios which vary in the Givens, but not the results. Ideally I''m hoping to achieve something like: (but anything will do for now :) Scenario: one Given something When he does foo Then good things should happen
2008 May 11
5
Are you writing "imperative" or "declarative" scenarios in your stories?
Hey all, I just found Bryan Helmkamp''s (of webrat fame) slides on a presentation he did at GoRuCo 2008: http://www.brynary.com/2008/4/26/story-driven-development-slides-posted On slides 21-24 he talks about writing good stories and shows gives two examples.. the way not to do it and the way to do it. You can also see the video of the presentation at confreaks