@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) public @interface Stepwise
When applied to a feature method, the annotation analogically indicates that the feature's iterations should be run sequentially in their declared order. If an iteration fails, the remaining iterations will be skipped.
@Stepwise is useful for specs with (logical) dependencies between methods. In particular, it helps to avoid consecutive errors after a method has failed, which makes it easier to understand what really went wrong. Analogically, it helps to avoid consecutive errors in subsequent iterations, when it is clear that the reason for one iteration failure usually also causes subsequent iterations to fail, such as the availability of an external resource in an integration test.
Please try to use this annotation as infrequently as possible by refactoring to avoid dependencies between feature methods or iterations whenever possible. Otherwise, you will lose opportunities to get meaningful test results and good coverage.
Please note:
ExecutionMode.SAME_THREAD
for the whole
spec, all of its feature methods and their iterations (if any). If it is applied to a data-driven feature method
only, it will set the same flag only per annotated method.