Skip to content

Commit

Permalink
StepwiseExtension: Mark only subsequent features as skipped in case o…
Browse files Browse the repository at this point in the history
  • Loading branch information
tilmanginzel authored and MartyIX committed Oct 14, 2018
1 parent 8a79961 commit 376069f
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -53,10 +53,12 @@ public void error(ErrorInfo error) {
// but not sub- and super classes
if (!error.getMethod().getParent().equals(spec)) return;

// we can just set skip flag on all features, even though
// some of them might already have run
for (FeatureInfo feature : spec.getFeatures())
feature.setSkipped(true);
// mark all subsequent features as skipped
List<FeatureInfo> features = spec.getFeatures();
int indexOfFailedFeature = features.indexOf(error.getMethod().getFeature());
for (int i = indexOfFailedFeature + 1; i < features.size(); i++) {
features.get(i).setSkipped(true);
}
}
});
}
Expand Down

0 comments on commit 376069f

Please sign in to comment.