A step that is not found (or whose signature is not matched which is the same) is considered pending. You can think pending as synonymous to not found.
Passing nulls around is not a safe nor good practice as it simply shifts the problem without solving it. You can activate the step monitor to investigate missing steps. We can make the debugging easier perhaps. Please send a scenario to reproduce the issue with given stories on 4.0 There is a case for lifecycle after steps to be executed depending on outcome, like the @AfterScenario steps. Please raise a JIRA issue. Cheers > On 25 Apr 2014, at 13:23, Hans Schwäbli <[email protected]> wrote: > > 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.
