public void afterScenario() { if (givenStoryMonitor.isInGivenStory() || shouldNestScenarios()) { StepEventBus.getEventBus().stepFinished(); } else { StepEventBus.getEventBus().testFinished(); if (isPendingScenario() || isPendingStory()) { StepEventBus.getEventBus().setAllStepsTo(TestResult.PENDING); } if (isSkippedScenario() || isSkippedStory()) { StepEventBus.getEventBus().setAllStepsTo(TestResult.SKIPPED); } activeScenarios.pop(); } }