I don't understand your use case. 

Steps are meant to be reusable across all stories.  If you want you can 
implement the steps to be facades for different implementations via factory 
objects, but I would avoid having one steps class specific to one story.

The context can be reset before each scenario or story using the 
@BeforeScenario/Story annotation.

On 2 Jan 2014, at 18:43, Enric Ballo <[email protected]> wrote:

> Hi Mauro,
> 
> There is no other solution ? because i have other stories that are changes, 
> moves... etc.. so I would like to have one story class for each one, because 
> the context is different.
> 
> I'm reusing the same steps but different logic, for example:
> 
> As a customer I want to have a 1P product Onnet residential ADSL (this for 
> DSLStories)
> As a customer I want to have a 2P product Offnet residential FTTH (this for 
> fiberStories)
> 
> So I have a class called AbstractCommonsSteps where i have the common 
> logic... and then i have the OrderDSLSteps and OrderFiberSteps where i have 
> the validations or specific logic for each one.
> 
> So to do a Fiber order I can't load the same beans than order dsl... that's 
> why I want to have different stories, but I want all to be executed. The 
> stories should all look more or less the same, some with more steps.. but at 
> least have all the same idea.
> 
> Witch strategy do you suggest to do ?
> 
> Thanks in advance, 
> 
> 
> On Thu, Jan 2, 2014 at 6:31 PM, Mauro Talevi <[email protected]> 
> wrote:
>> The annotated embedder is meant as a configurable entry point for multiple 
>> stories, not just the single one.
>> 
>> So you should have a OrderPDSLStories class and use it to run all the 
>> stories you need with same configuration.
>> 
>> Here's an example:
>> 
>> https://github.com/jbehave/jbehave-core/blob/master/examples/annotations/src/main/java/org/jbehave/examples/core/annotations/CoreAnnotatedEmbedder.java
>> 
>> To use with Jenkins configure XML report format and use the 
>> jbehave-jenkins-plugin.
>> 
>> Cheers
>> 
>> 
>> On 02/01/2014 10:24, Enric Ballo wrote:
>>> Hi Mauro,
>>> 
>>> With this annotated with options (generateViewAfterStories = true, 
>>> ignoreFailureInStories = true, ignoreFailureInView = false), it works fine. 
>>> And execute all the scenarios inside the sotry file.. and when is finished 
>>> continue with the next story file. But After this I want to continue with 
>>> the other Order1PDSLStory.java files, but dosen't do that.
>>> 
>>>              <plugins>
>>>  <plugin>
>>>  <groupId>org.jbehave</groupId>
>>>  <artifactId>jbehave-maven-plugin</artifactId>
>>>  <version>${jbehave.version}</version>
>>>  <executions>
>>>  <execution>
>>>  <id>unpack-view-resources</id>
>>>  <phase>process-resources</phase>
>>>  <goals>
>>>  <goal>unpack-view-resources</goal>
>>>  </goals>
>>>  </execution>
>>>  <execution>
>>>  <id>embeddable-stories</id>
>>>  <phase>integration-test</phase>
>>>  <configuration>
>>>  <outputDirectory>${project.build.directory}</outputDirectory>
>>>  <scope>test</scope>
>>>  <includes>
>>>  <!-- Order DSL -->
>>>  <include>**/Order1PDSLStory.java</include>
>>>  <include>**/Order2PSDSLStory.java</include>
>>>  </includes>
>>>  <generateViewAfterStories>true</generateViewAfterStories>
>>>  <ignoreFailureInStories>true</ignoreFailureInStories>
>>>  <ignoreFailureInView>true</ignoreFailureInView>
>>>  <storyTimeoutInSecs>1600</storyTimeoutInSecs>
>>>  </configuration>
>>>  <goals>
>>>  <goal>run-stories-with-annotated-embedder</goal>
>>>  </goals>
>>>  </execution>
>>>  </executions>
>>>  <dependencies>
>>>  <dependency>
>>>  <groupId>log4j</groupId>
>>>  <artifactId>log4j</artifactId>
>>>  <version>1.2.16</version>
>>>  </dependency>
>>>  </dependencies>
>>>  </plugin>
>>>  </plugins>
>>> 
>>> So what happens is that executes Order1PDSLStory.java file, and execute all 
>>> the story files inside... but if there is any error doesn't run the 
>>> Order2PSDSLStory.java. Stops the execution and I only have the report of 
>>> the Order1PDSLStory.
>>> 
>>> What I would like: 
>>> 
>>> I want to run Jbehave scenarios in test scope, and when any scenario fail, 
>>> continue with the other stories (in order to execute all the scenarios in 
>>> all the stories).
>>> I also want to see in Jenkins the build in yellow if the build was not 
>>> successful, and green it was all the tests ok.
>>> Thanks in advance,
>>> 
>>> 
>>> On Tue, Dec 31, 2013 at 7:58 PM, Mauro Talevi <[email protected]> 
>>> wrote:
>>>> Annotated with options: 
>>>> 
>>>> @UsingEmbedder(generateViewAfterStories = true, ignoreFailureInStories = 
>>>> true, ignoreFailureInView = false)
>>>> 
>>>> Cheers
>>>> 
>>>> On 31/12/2013 14:45, Enric Ballo wrote:
>>>>> I'm running Jbehave maven plugin with 
>>>>> run-stories-with-annotated-embedder. But when any scenario fails, then 
>>>>> stop all the other scenarios. But I would like to run all the scenarios 
>>>>> and then do a report with the scenarios that fails. Is it possible to do 
>>>>> this ??
>>>>> 
>>>>> I setup the jbehave strategy configuration to SilentlyAbsorbingFailure, 
>>>>> and also I tryed ignoreFailureInStories option... but it dosen't work for 
>>>>> me. I think I am missing something.
>>>>> 
>>>>> This is my maven execution code when fails:
>>>>> 
>>>>> 
>>>>> [INFO] 
>>>>> ------------------------------------------------------------------------
>>>>> [INFO] Reactor Summary:
>>>>> [INFO]
>>>>> [INFO] Consumer Regression Test Suite .................... SUCCESS 
>>>>> [0.591s]
>>>>> [INFO] Customer Regression Test Suite Commons module ..... SUCCESS 
>>>>> [2.678s]
>>>>> [INFO] Customer Regression Test Suite Core module ........ FAILURE 
>>>>> [25:24.539s]
>>>>> [INFO] 
>>>>> ------------------------------------------------------------------------
>>>>> [INFO] BUILD FAILURE
>>>>> [INFO] 
>>>>> ------------------------------------------------------------------------
>>>>> [INFO] Total time: 25:28.081s
>>>>> [INFO] Finished at: Mon Dec 16 15:42:02 CET 2013
>>>>> [INFO] Final Memory: 71M/664M
>>>>> [INFO] 
>>>>> ------------------------------------------------------------------------
>>>>> [ERROR] Failed to execute goal 
>>>>> org.jbehave:jbehave-maven-plugin:3.7.4:run-stories-with-    
>>>>> annotated-embedder (embeddable-stories) on project 
>>>>> consumer-regression-test-suite-core:     
>>>>> Failed to run stories with annotated embedder runner: Annotated embedder 
>>>>> run failed with    runner 
>>>>> org.jbehave.core.junit.spring.SpringAnnotatedEmbedderRunner@72f4abb9: 
>>>>> Failures in   running stories:        
>>>>> ReportsCount[stories=2,storiesNotAllowed=0,storiesPending=0,scenarios=16,scenariosFailed=2,
>>>>>      scenariosNotAllowed=0,scenariosPending=0,stepsFailed=2] -> [Help 1]
>>>>>  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to 
>>>>> execute goal     
>>>>> org.jbehave:jbehave-maven-plugin:3.7.4:run-stories-with-annotated-embedder
>>>>>  (embeddable-     stories
>>>>> ) on project consumer-regression-test-suite-core: Failed to run stories 
>>>>> with    annotated e
>>>>> mbedder runner
>>>>>     at org.apache.maven.lifecycle

Reply via email to