Discussion:
[Cucumber] Getting a step status in a @AfterStep hook
tomaugs
2018-07-16 14:24:30 UTC
Permalink
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
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
MP Korstanje
2018-07-19 08:34:38 UTC
Permalink
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.
Post by tomaugs
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.
@AfterStep
public void afterStepHook(final ScenarioImpl scenario) {
final String status = scenario.getStatus().toString();
...
}
hook?
Thanks in advance,
Thomas
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...