I know about this section and actually I tried this :
--------------------
Story: test story 2
Scenario: test scenario 2
GivenStories: org/ow2/petals/jbehave/spike/testStory1.story#{0},
org/ow2/petals/jbehave/spike/testStory1.story#{1}
When a <secondEvent> occurs
Then I can check a <secondOutcome>
Examples:
|something |firstEvent |firstOutcome |secondEvent |secondOutcome |
|something3|firstEvent3|firstOutcome3|secondEvent3|secondOutcome3|
|something4|firstEvent4|firstOutcome4|secondEvent4|secondOutcome4|
--------------------
The execution log is :
--------------------
Running story org/ow2/petals/jbehave/spike/testStory2.story
Story: test story 2
(org/ow2/petals/jbehave/spike/testStory2.story)
Before Story
Scenario: test scenario 2
Before scenario
GivenStories:
org/ow2/petals/jbehave/spike/testStory1.story#{0} {something=something3,
firstEvent=firstEvent3, firstOutcome=firstOutcome3,
secondEvent=secondEvent3, secondOutcome=secondOutcome3}
org/ow2/petals/jbehave/spike/testStory1.story#{1} {something=something4,
firstEvent=firstEvent4, firstOutcome=firstOutcome4,
secondEvent=secondEvent4, secondOutcome=secondOutcome4}
Story: test story 1
(org/ow2/petals/jbehave/spike/testStory1.story)
Scenario: test scenario 1
Before scenario
something = something3
Given something3 I need to do to prepare this first story environment
firstEvent = firstEvent3
When some firstEvent3 occurs
firstOutcome = firstOutcome3
Then I can check a firstOutcome3
After scenario
Story: test story 1
(org/ow2/petals/jbehave/spike/testStory1.story)
Scenario: test scenario 1
Before scenario
something = something4
Given something4 I need to do to prepare this first story environment
firstEvent = firstEvent4
When some firstEvent4 occurs
firstOutcome = firstOutcome4
Then I can check a firstOutcome4
After scenario
When a <secondEvent> occurs (PENDING)
Then I can check a <secondOutcome> (NOT PERFORMED)
After scenario
After Story
--------------------
And this is not at all what I want.
I would like to obtain something like :
--------------------
Running story org/ow2/petals/jbehave/spike/testStory2.story
Story: test story 2
(org/ow2/petals/jbehave/spike/testStory2.story)
Before Story
Scenario: test scenario 2
Before scenario
GivenStories:
org/ow2/petals/jbehave/spike/testStory1.story#{0} {something=something3,
firstEvent=firstEvent3, firstOutcome=firstOutcome3,
secondEvent=secondEvent3, secondOutcome=secondOutcome3}
org/ow2/petals/jbehave/spike/testStory1.story#{1} {something=something4,
firstEvent=firstEvent4, firstOutcome=firstOutcome4,
secondEvent=secondEvent4, secondOutcome=secondOutcome4}
#### ... execution of story1 + story2 on first row of example ...)
Story: test story 1
(org/ow2/petals/jbehave/spike/testStory1.story)
Scenario: test scenario 1
Before scenario
something = something3
Given something3 I need to do to prepare this first story environment
firstEvent = firstEvent3
When some firstEvent3 occurs
firstOutcome = firstOutcome3
Then I can check a firstOutcome3
After scenario
#### ... back to story 2 ...)
When a secondEvent3 occurs
Then I can check a secondOutcome3
#### ... execution of story1 + story2 on second row of example ...)
Story: test story 1
(org/ow2/petals/jbehave/spike/testStory1.story)
Scenario: test scenario 1
Before scenario
something = something4
Given something4 I need to do to prepare this first story environment
firstEvent = firstEvent4
When some firstEvent4 occurs
firstOutcome = firstOutcome4
Then I can check a firstOutcome4
After scenario
#### ... back to story 2 ...)
When a secondEvent4 occurs
Then I can check a secondOutcome4
--------------------
I don't know if I am getting any clearer ...?