Hi

thanks for the sample project.    The issue you are seeing is a consequence of 
the fact that there are two special “stories” called (BeforeStories and 
AfterStories - used to report issues in the execution of the @BeforeStories and 
@AfterStories annotated steps).        If you disregard these two special 
“stories” - the rest of the reporting works as expected.   To determine which 
story to ignore you can use the Story injected in the beforeStory() method and 
check the getPath() method: 

        public void beforeStory(Story story, boolean givenStory) {
                if ( story.getPath().matches("(Before|After)Stories") ) {
                        System.out.println("ignore me");
                        return;
                }
                System.out.println("======CustomReporter before Story=======");
        }

Cheers
 
> On 8 Aug 2016, at 20:20, [email protected] wrote:
> 
> 
> Hi,
> 
> 
> Attached the sample project for your reference.
> 
> Thank you.
> 
> On Monday, August 8, 2016 at 10:45:49 PM UTC+5:30, mauro.talevi wrote:
> Yes, the beforeStory() event will be invoked for each story and after the 
> @BeforeStories annotated method. 
> 
> But if you don’t share your project which reproduces your behaviour you can’t 
> be helped. 
> 
> Please ensure that it is a self-contained (and as simple as possible) Maven 
> project.   
>   
>> On 8 Aug 2016, at 09:30, [email protected] <javascript:> wrote:
>> 
>> Actually its working like below
>> 
>> 
>> (BeforeStories)
>> ======In CustomStoryReporter beforeStory=========
>> ======In Jbehave @BeforeStories=========
>> ======In CustomStoryReporter aftertory=========
>> 
>> Running story Login_Story.story
>> Login story
>> (Login_Story.story)
>> ======In CustomStoryReporter beforeStory=========
>> ======In CustomStoryReporter aftertory=========
>> 
>> (AfterStories)
>> ======In CustomStoryReporter beforeStory=========
>> ======In Jbehave @AfterStories=========
>> ======In CustomStoryReporter aftertory=========
>> 
>> This is the way it should work?
>> 
>> On Sunday, August 7, 2016 at 6:10:11 PM UTC-12, [email protected] 
>> <http://gmail.com/> wrote:
>> Sorry I am not getting what you are saying. I thought that beforeStory 
>> method in the cistomreporter class should execute after @ BeforeStories 
>> annotation. But it is executed before the @BeforeStories annotation. Please 
>> clarify me what's the exact behaviour or life cycle of beforeStory
>>  
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "JBehave User" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/jbehave-user/491b5ed9-10dd-4aff-bcc7-640bb0755542%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jbehave-user/491b5ed9-10dd-4aff-bcc7-640bb0755542%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JBehave User" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/jbehave-user/0b257df6-b460-43e6-9188-3a6b0207089c%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jbehave-user/0b257df6-b460-43e6-9188-3a6b0207089c%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> <JSample.zip>

-- 
You received this message because you are subscribed to the Google Groups 
"JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/jbehave-user/3D035031-5B6B-4BD3-9054-116D2421AB04%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to