public <T> void reportStepFailureFor(Consequence<T> consequence, Throwable e) { ExecutedStepDescription consequenceDescription = ExecutedStepDescription.withTitle(consequence.toString()); StepEventBus.getEventBus().stepFailed(new StepFailure(consequenceDescription, e)); }
private void startTestForFirstScenarioIn(Story story) { startScenarioCalled(story.getScenarios().get(0), story); StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle("Preconditions")); shouldNestScenarios(true); }
@Override public void comment(String step) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(step)); StepEventBus.getEventBus().stepIgnored(); }
public void updateCurrentStepTitle(String updatedStepTitle) { if (currentStepExists()) { getCurrentStep().setDescription(updatedStepTitle); } else { stepStarted(ExecutedStepDescription.withTitle(updatedStepTitle)); } }
public void recordRestQuery(RestQuery restQuery) { stepStarted(ExecutedStepDescription.withTitle(restQuery.toString())); addRestQuery(restQuery); stepFinished(); }
public void updateCurrentStepTitle(String updatedStepTitle) { if (currentStepExists()) { getCurrentStep().setDescription(updatedStepTitle); } else { stepStarted(ExecutedStepDescription.withTitle(updatedStepTitle)); } }
private void startTestForFirstScenarioIn(Story story) { System.out.println("Starting first test for " + story.getName()); Scenario firstScenario = story.getScenarios().get(0); startScenarioCalled(firstScenario.getTitle()); StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle("Preconditions")); shouldNestScenarios(true); }
public void failed(String stepTitle, Throwable cause) { Throwable rootCause = cause.getCause() != null ? cause.getCause() : cause; StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle); if (isAssumptionFailure(rootCause)) { StepEventBus.getEventBus().assumptionViolated(rootCause.getMessage()); } else { StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(stepTitle)), rootCause)); } }
@Override public void notPerformed(String stepTitle) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(normalized(stepTitle))); StepEventBus.getEventBus().stepIgnored(); }
public StepMutator updateCurrentStepTitle(String updatedStepTitle) { if (currentStepExists()) { getCurrentStep().setDescription(updatedStepTitle); } else { stepStarted(ExecutedStepDescription.withTitle(updatedStepTitle)); } return new StepMutator(this); }
@Override public void pending(String stepTitle) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(normalized(stepTitle))); StepEventBus.getEventBus().stepPending(); }
public void pending(String stepTitle) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(normalized(stepTitle))); StepEventBus.getEventBus().stepPending(); }
public void notPerformed(String stepTitle) { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(normalized(stepTitle))); StepEventBus.getEventBus().stepIgnored(); }
public final void should(String groupStepName, Consequence... consequences) { try { String groupTitle = injectActorInto(groupStepName); StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(groupTitle)); should(consequences); } catch (Throwable error) { throw error; } finally { StepEventBus.getEventBus().stepFinished(); } }
private void handleWrite(WriteEvent event) { getStepEventBus(currentFeaturePath()).stepStarted(ExecutedStepDescription.withTitle(event.text)); getStepEventBus(currentFeaturePath()).stepFinished(); }
private void startNewStep(String scenarioTitle) { if (givenStoryMonitor.isInGivenStory() && StepEventBus.getEventBus().areStepsRunning()) { StepEventBus.getEventBus().updateCurrentStepTitle(scenarioTitle); } else { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(scenarioTitle)); } }
private void startNewStep(String scenarioTitle) { if (givenStoryMonitor.isInGivenStory() && StepEventBus.getEventBus().areStepsRunning()) { StepEventBus.getEventBus().updateCurrentStepTitleAsPrecondition(scenarioTitle); } else { StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(scenarioTitle), givenStoryMonitor.isInGivenStory()); } }
public void exampleStarted(Map<String, String> data) { if (getCurrentTestOutcome().isDataDriven() && !getCurrentTestOutcome().dataIsPredefined()) { getCurrentTestOutcome().addRow(data); } currentExample++; getEventBus().stepStarted(ExecutedStepDescription.withTitle(exampleTitle(currentExample, data))); }
public void exampleStarted(Map<String, String> data) { clearForcedResult(); if (getCurrentTestOutcome().isDataDriven()) { if (!getCurrentTestOutcome().dataIsPredefined()) { getCurrentTestOutcome().addRow(data); } } currentExample++; getEventBus().stepStarted(ExecutedStepDescription.withTitle(exampleTitle(currentExample, data))); }
public void exampleStarted(Map<String, String> data) { clearForcedResult(); if (getCurrentTestOutcome().isDataDriven()) { if (!getCurrentTestOutcome().dataIsPredefined()) { getCurrentTestOutcome().addRow(data); } } currentExample++; if (newStepForEachExample()) { getEventBus().stepStarted(ExecutedStepDescription.withTitle(exampleTitle(currentExample, data))); } }