jbehave-junit-runner icon indicating copy to clipboard operation
jbehave-junit-runner copied to clipboard

When stories have lifecycle steps the execution of Before and After steps are not captured

Open oscillot opened this issue 10 years ago • 2 comments

Not sure if this is a bug or an enhancement, but Lifecycle steps have been available since version 3.9

Conditional After steps are added in 3.9.3 although I'm sure this would present additional problems.

See http://jbehave.org/reference/stable/story-syntax.html for Lifecycle steps.

oscillot avatar Nov 11 '14 14:11 oscillot

I myself haven't tried lifecycle steps. Are they not working with jbehave-junit-runner?

[image: Stephen Kurlow on about.me]

Stephen Kurlow about.me/skurlow http://about.me/skurlow

On Wed, Nov 12, 2014 at 1:53 AM, oscillot [email protected] wrote:

Not sure if this is a bug or an enhancement, but Lifecycle steps have been available since version 3.9

Conditional After steps are added in 3.9.3 although I'm sure this would present additional problems.

See http://jbehave.org/reference/stable/story-syntax.html for Lifecycle steps.

— Reply to this email directly or view it on GitHub https://github.com/codecentric/jbehave-junit-runner/issues/71.

skurlow avatar Nov 11 '14 22:11 skurlow

Apologies for the delay in response, I wanted to observe the behavior a bit longer so I could give as much information as possible.

I have created a barebones repo that showcases this behavior well: https://github.com/oscillot/jusyncissue

I also see this a lot in my output, which I wasn't able to capture in the linked repo but I guess is related: Wrong test finished. Last started: [<STORY>.story, Scenario: AC1] In each case for the above, it is in fact the correct Scenario running.

In addition to the link to the repo, please find attached a series of numbered screenshots that help illustrate the issue. Here are some notes:

0 - looks good 1 - looks good 2 - looks good 3 - looks good (scenario1) 4 - partial given output* 5 - no output at all 6 - rest of given, all of when and then 7 - looks good (scenario2) 8 - no output at all 9 - looks good 10 - looks good 11 - looks good

*Please not that on the console, any line that starts with [JBEHAVE]: was added by my ConsoleStoryReporter class, so, for example, in Scenario 1's given, the output is purely from my reporter class, and without it, it would be like Scenario 2's given, totally blank. If you run ExampleQuietJBehaveValidator you'll see the same behaviour but without that Reporter class.

In scenario 1, all the data is in each scenario, but not necessarily in the correct step. In scenario 2, you can't see the given at all by clicking on the given step, or in any other step either. You can only find it by clicking on the parent scenario. The behavior is not consistent and what I see with a real test is similar but not identical as well.

Thanks for the awesome plugin! I hope you can get Lifecycle added and these issues fixed. Please, do let me know if I can provide anything else to help with this.

On Tue Nov 11 2014 at 4:46:14 PM Stephen Kurlow [email protected] wrote:

I myself haven't tried lifecycle steps. Are they not working with jbehave-junit-runner?

[image: Stephen Kurlow on about.me]

Stephen Kurlow about.me/skurlow http://about.me/skurlow

On Wed, Nov 12, 2014 at 1:53 AM, oscillot [email protected] wrote:

Not sure if this is a bug or an enhancement, but Lifecycle steps have been available since version 3.9

Conditional After steps are added in 3.9.3 although I'm sure this would present additional problems.

See http://jbehave.org/reference/stable/story-syntax.html for Lifecycle steps.

— Reply to this email directly or view it on GitHub https://github.com/codecentric/jbehave-junit-runner/issues/71.

— Reply to this email directly or view it on GitHub https://github.com/codecentric/jbehave-junit-runner/issues/71#issuecomment-62636085 .

oscillot avatar Nov 14 '14 00:11 oscillot