@Override public Consequence<T> because(String explanation) { return new EventualConsequence<T>(consequenceThatMightTakeSomeTime.because(explanation)); }
@Override public Consequence<T> orComplainWith(Class<? extends Error> complaintType) { return new EventualConsequence(consequenceThatMightTakeSomeTime.orComplainWith(complaintType)); }
@Override public Consequence<T> whenAttemptingTo(Performable performable) { return new EventualConsequence<T>(consequenceThatMightTakeSomeTime.whenAttemptingTo(performable)); }
private <T> void check(Consequence<T> consequence, ErrorTally errorTally) { ConsequenceCheckReporter reporter = new ConsequenceCheckReporter(eventBusInterface, consequence); try { reporter.startQuestion(); if (eventBusInterface.shouldIgnoreConsequences()) { reporter.reportStepIgnored(); } else { consequence.evaluateFor(this); reporter.reportStepFinished(); } } catch (IgnoreStepException e) { reporter.reportStepIgnored(); } catch (Throwable e) { errorTally.recordError(consequence, e); } }
do { try { consequenceThatMightTakeSomeTime.evaluateFor(actor); return; } catch (AssertionError assertionError) {
private <T> void check(Consequence<T> consequence) { try { eventBusInterface.reportNewStepWithTitle(FormattedTitle.ofConsequence(consequence)); if (StepEventBus.getEventBus().currentTestIsSuspended() || StepEventBus.getEventBus().aStepInTheCurrentTestHasFailed()) { StepEventBus.getEventBus().stepIgnored(); } consequence.evaluateFor(this); eventBusInterface.reportStepFinished(); } catch (IgnoreStepException e) { eventBusInterface.reportStepIgnored(); } catch (Throwable e) { eventBusInterface.reportStepFailureFor(consequence, e); if (Serenity.shouldThrowErrorsImmediately()) { throw e; } } }
@Override public Consequence<T> orComplainWith(Class<? extends Error> complaintType, String complaintDetails) { return new EventualConsequence(consequenceThatMightTakeSomeTime.orComplainWith(complaintType, complaintDetails)); }