Getting a step status in a @AfterStep hook

62 views
Skip to first unread message

tomaugs

unread,
Jul 18, 2018, 5:16:14 PM7/18/18
to Cukes
Hi everyone,

I've just migrated from cucumber v2 to v3 and I would like to replace my old around Aspect (used for error handling at steps level) by a new step hook.
I tried this following but the status is always PASSED :

@AfterStep
public void afterStepHook(final ScenarioImpl scenario) {
final String status = scenario.getStatus().toString();
                ...
}

My question is: How to get the status of the current step in an @AfterStep hook?

Thanks in advance,

Thomas

MP Korstanje

unread,
Jul 19, 2018, 4:34:38 AM7/19/18
to Cukes
If you're doing report type things have a look at the Plugin + EventListener interfaces instead.

Right now the step result isn't added until after the step and hooks have been finished. This may be a bug.
Reply all
Reply to author
Forward
0 new messages