Hello,

I have the following question.

I implemented a custom reporter format 
(http://jaroslav-sedlacek.blogspot.nl/2011/05/screenshots-in-jbehave-reports.html)
 which creates a screenshot on failure and add a link to the reports. Which 
works fine when using a single thread.

This is how I configured it in a class which extends from JUnitStories:

    StoryReporterBuilder reporter = new StoryReporterBuilder();
    reporter.withCodeLocation(
        CodeLocations
            .codeLocationFromClass(embeddableClass))
        .withFormats(new ScreenshootingHtmlFormat(driverProvider), XML, 
CONSOLE, TXT);

This doesn't work when using multiple threads. Which seems to be logical since 
the driverProvider is null.

So I added this custom reporter to the spring configuration xml file. This is 
actually the place where I distribute the driverProvider. I see that the 
screenshots are being made (file are stored in a folder). However the HTML 
reports are not generated properly.

So I tried to move the StoryReporterBuilder to the spring configuration file is 
well: so it looks like this:

  <bean id="screenshot" class="org.spilgames.ScreenshootingHtmlFormat">
    <constructor-arg ref="provider" />
  </bean>

  <bean
    class="org.jbehave.core.configuration.spring.SpringStoryReporterBuilder"
    init-method="withDefaultFormats">
    <property name="formats">
      <list>
        <value>CONSOLE</value>
        <value>TXT</value>
        <value>screenshot</value>
        <value>XML</value>
      </list>
    </property>
  </bean>

However this doesn't work for customformats. Is there a workaround? or is there 
another to do this ? How can I define the custom format in the Spring 
Configuration XML file?

The first bean in the above example is working (screenshots are being made)
The second bean needs some modification, because it gets stuck at the third 
parameter.


Any help is appreciated!

Thanks,
Roy





Reply via email to