@Override public StepResult withStop(Long value) { setStop(value); return this; }
/** * @deprecated use set method. Scheduled to removal in 3.0 release. */ @Deprecated @Override public StepResult withStop(final Long value) { return setStop(value); }
/** * Stops step by given uuid. * * @param uuid the uuid of step to stop. */ public void stopStep(final String uuid) { final Optional<StepResult> found = storage.getStep(uuid); if (!found.isPresent()) { LOGGER.error("Could not stop step: step with uuid {} not found", uuid); return; } final StepResult step = found.get(); notifier.beforeStepStop(step); step.setStage(Stage.FINISHED); step.setStop(System.currentTimeMillis()); storage.remove(uuid); threadContext.stop(); notifier.afterStepStop(step); }
protected void fireFixtureStep(final Match match, final Result result, final boolean isBefore) { final String uuid = md5(match.getLocation()); final StepResult stepResult = new StepResult() .setName(match.getLocation()) .setStatus(Status.fromValue(result.getStatus())) .setStart(System.currentTimeMillis() - result.getDuration()) .setStop(System.currentTimeMillis()); if (FAILED.equals(result.getStatus())) { final StatusDetails statusDetails = ResultsUtils.getStatusDetails(result.getError()).get(); stepResult.setStatusDetails(statusDetails); if (isBefore) { final TagParser tagParser = new TagParser(feature, scenario); statusDetails .setMessage("Before is failed: " + result.getError().getLocalizedMessage()) .setFlaky(tagParser.isFlaky()) .setMuted(tagParser.isMuted()) .setKnown(tagParser.isKnown()); lifecycle.updateTestCase(scenario.getId(), scenarioResult -> scenarioResult.setStatus(Status.SKIPPED) .setStatusDetails(statusDetails)); } } lifecycle.startStep(scenario.getId(), uuid, stepResult); lifecycle.stopStep(uuid); } }
protected void fireCanceledStep(final Step unimplementedStep) { final StepResult stepResult = new StepResult(); stepResult.setName(unimplementedStep.getName()) .setStart(System.currentTimeMillis()) .setStop(System.currentTimeMillis()) .setStatus(Status.SKIPPED) .setStatusDetails(new StatusDetails().setMessage("Unimplemented step")); lifecycle.startStep(scenario.getId(), getStepUuid(unimplementedStep), stepResult); lifecycle.stopStep(getStepUuid(unimplementedStep)); final StatusDetails statusDetails = new StatusDetails(); final TagParser tagParser = new TagParser(feature, scenario); statusDetails .setFlaky(tagParser.isFlaky()) .setMuted(tagParser.isMuted()) .setKnown(tagParser.isKnown()); lifecycle.updateTestCase(scenario.getId(), scenarioResult -> scenarioResult.setStatus(Status.SKIPPED) .setStatusDetails(statusDetails .setMessage("Unimplemented steps were found"))); }