public void afterScenario() { notifier.fireTestFinished(currentScenario); if (scenarioDescriptions.hasNext()) { currentScenario = scenarioDescriptions.next(); finishedDescriptions.clear(); } }
private Description getStepDescription(String step) { for (Description description : currentScenario.getChildren()) { if (!finishedDescriptions.contains(description) && match(step, description)) { return description; } } throw new RuntimeException("Could not find description for: " + step); }
public void successful(String step) { currentStep = getStepDescription(step); notifier.fireTestStarted(currentStep); notifier.fireTestFinished(currentStep); finishedDescriptions.add(currentStep); }
public void failed(String step, Throwable e) { currentStep = getStepDescription(step); notifier.fireTestStarted(currentStep); notifier.fireTestFailure(new Failure(currentStep, e)); finishedDescriptions.add(currentStep); }