I tried the new lifecylce steps in JBehave 4 beta-6.

I wondered why my lifecycle after step was not executed (pending state).

It was because the step method used a argument although the step name does
not contain a parameter:

@Given("the user logs out")

*public* *void* logout(String *user*) {}

This mistake is a bit tricky to solve. What do you think about indicating
that no step was found instead of using state "pending"? Or you could use
that step, pass null into the step and log a warning?

But this might apply to all steps, not just lifecycle steps.

With lifecycle steps I have another issue. If a step has failed then the
after lifecycle steps are not exectuted.

I think it would be good to also have after steps which are executed even
if a normal step has failed. Then I could do some cleanups in the after
steps. But if the after steps are not called because a normal step failed,
then I cannot do such cleanups. What do you think about this?

By the way, I only used lifecycle because I have problems with
GivenStories. It is not executed but ignored. It used to work in former
versions. I couldn't yet figure out what the problem is, but I will provide
a reproducible example.

Reply via email to