I could queue messages until the step finishes, one issue I have with that is the reporter we use is used by all testcases in our framework. We're only getting involved in BDD and even going forward not all projects will be using this approach so ideally I'd like to be able to insert something before each step and not deal with these differently. I'm wondering if there's somewhere else I could do this, I'm not fully versed in the internals but I thought the candidate steps might provide an opportunity.
On 21 February 2012 19:53, Alexander Lehmann <[email protected]> wrote: > You may be a able to work around the missing "before" notification by > collecting all log events until the next after step notification and then > flush the collected log events. The first step starts with the > beforeScenario notification, the first successful/failed notification ends > the previous step and starts the next etc. > > > On 21.02.2012 16:49, Graham Abell wrote: > >> Hi Mauro, >> >> A JBehave step consists of a number of onscreen actions - from a >> reporting point of view we want to indicate when a step starts so we can >> mark all subsequent actions [until the step ends] as belonging to that >> step. In effect it would create a nested log, for example: >> >> Given a user logs in >> navigate to home page >> enter username >> enter password >> click submit >> verify logged in >> When .... >> some nested log entry >> another nested log entry >> Then ... >> nested log entry >> nested log entry >> >> >> Does that make sense? >> >> The reason we want to do this is that it provides very readable high >> level logs, but allowing for a view to drill down in to very specific >> information about each step. >> >> thanks, >> Graham >> >> >> >> On 21 February 2012 15:29, Mauro Talevi <[email protected] >> <mailto:mauro.talevi@**aquilonia.org <[email protected]>>> >> wrote: >> >> ATM only step outcomes are reported. What's your usecase for >> monitoring the before step phase? >> >> On 21/02/2012 14:43, Graham Abell wrote: >> >>> Thanks, I updated to beta3 and have access to that method now. >>> >>> I've implemented my StoryReporter and see where each method gets >>> called as part of the reporting. I don't see where I can hook in >>> before a step is run though, the steps themselves call the >>> successful, pending, failed etc methods based on their outcome I >>> guess which would allow me to create the afterStep() call but not >>> the beforeStep()? >>> >>> thanks again, >>> Graham >>> >>> On 21 February 2012 11:45, Mauro Talevi >>> <[email protected] >>> <mailto:mauro.talevi@**aquilonia.org <[email protected]>>> >>> wrote: >>> >>> Hi Graham, >>> >>> withReporters() is a new method added in 3.6 (you can use one >>> of the betas). In 3.5.x you only have withFormats() so you'd >>> need to define your own format, e.g. >>> >>> public static final Format TXT = new Format("TXT") { >>> @Override >>> public StoryReporter >>> createStoryReporter(**FilePrintStreamFactory factory, >>> StoryReporterBuilder storyReporterBuilder) { >>> >>> factory.useConfiguration(**storyReporterBuilder.** >>> fileConfiguration("txt")); >>> return new TxtOutput(factory.**createPrintStream(), >>> storyReporterBuilder.keywords(**)).doReportFailureTrace( >>> >>> storyReporterBuilder.**reportFailureTrace()).** >>> doCompressFailureTrace( >>> storyReporterBuilder.** >>> compressFailureTrace()); >>> } >>> }; >>> >>> >>> On 21/02/2012 11:41, Graham Abell wrote: >>> >>>> Hi Alex, >>>> >>>> Yeah, I have the withDefaultFormats() but I can't see a >>>> withReporters() method, I can't see it in the api either >>>> http://jbehave.org/reference/**stable/javadoc/core/org/** >>>> jbehave/core/reporters/**StoryReporterBuilder.html<http://jbehave.org/reference/stable/javadoc/core/org/jbehave/core/reporters/StoryReporterBuilder.html> >>>> >>>> >>>> am I missing something? >>>> >>>> cheers, >>>> graham >>>> >>>> >>>> On 21 February 2012 11:00, Alex Lehmann >>>> <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> >>>> your runner class has probably a statement using new >>>> StoryReporterBuilder() and calling .withFormats and/or >>>> .withDefaultFormats() , you can add >>>> .withReporters(yourReporter) >>>> >>>> >>>> On 21.02.2012 11:45, Graham Abell wrote: >>>> >>>> Having implemented my own StoryReporter, how do I >>>> specify that it gets used? >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------** >>>> ------------------------------**--------- >>>> To unsubscribe from this list, please visit: >>>> >>>> >>>> http://xircles.codehaus.org/**manage_email<http://xircles.codehaus.org/manage_email> >>>> >>>> >>>> >>>> >>> >>> >> >> > > > ------------------------------**------------------------------**--------- > To unsubscribe from this list, please visit: > > > http://xircles.codehaus.org/**manage_email<http://xircles.codehaus.org/manage_email> > > >
