public Step withSteps(Step... values) { if (values!= null) { for (Step value: values) { getSteps().add(value); } } return this; }
public Step withSteps(Collection<Step> values) { if (values!= null) { getSteps().addAll(values); } return this; }
private Step convert(final Path source, final ResultsVisitor visitor, final ru.yandex.qatools.allure.model.Step s, final Status testStatus, final String message, final String trace) { final Status status = convert(s.getStatus()); final Step current = new Step() .setName(s.getTitle() == null ? s.getName() : s.getTitle()) .setTime(new Time() .setStart(s.getStart()) .setStop(s.getStop()) .setDuration(s.getStop() - s.getStart())) .setStatus(status) .setSteps(convert(s.getSteps(), step -> convert(source, visitor, step, testStatus, message, trace))) .setAttachments(convert(s.getAttachments(), attach -> convert(source, visitor, attach))); //Copy test status details to each step set the same status if (Objects.equals(status, testStatus)) { current.setStatusMessage(message); current.setStatusMessage(trace); } return current; }
/** * Move last step to children of previous step. How it works: * <pre> * before: step1(...) -> step2(child1 -> ... -> childN) -> step3(...) -> ... -> null * after: step2(child1 -> ... -> childN -> step1(...)) -> step3(...) -> ... -> null * </pre> * @return ex-last step */ public Step adopt() { Step step = pollLast(); synchronized (LOCK) { getLast().getSteps().add(step); } return step; }
theSteps = this.getSteps(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "steps", theSteps), currentHashCode, theSteps);
@Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } } }
public void fire(StepFinishedEvent event) { Step step = stepStorage.pollLast(); event.process(step); stepStorage.getLast().getSteps().add(step); }
/** * Remove attachments matches pattern from step and all step substeps * * @param context from which attachments will be removed */ @Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } } }
private List<TestStep> addTestSteps(List<Step> steps, int level) { List<TestStep> result = new ArrayList<TestStep>(steps.size()); for (Step step : steps) { TestStep testStep = new TestStep(); testStep.setDescription(step.getName()); testStep.setSteps(addTestSteps(step.getSteps(), level + 1)); result.add(testStep); } return result; } }
public void fire(TestCaseFinishedEvent event) { TestCaseResult testCase = testCaseStorage.get(); event.process(testCase); Step root = stepStorage.pollLast(); if (Status.PASSED.equals(testCase.getStatus())) { new RemoveAttachmentsEvent(AllureReportConfig.newInstance().getRemoveAttachments()).process(root); } testCase.getSteps().addAll(root.getSteps()); testCase.getAttachments().addAll(root.getAttachments()); stepStorage.remove(); testCaseStorage.remove(); }
/** * Process TestCaseFinishedEvent. Add steps and attachments from * top step from stepStorage to current testCase, then remove testCase * and step from stores. Also remove attachments matches removeAttachments * config. * * @param event to process */ public void fire(TestCaseFinishedEvent event) { TestCaseResult testCase = testCaseStorage.get(); event.process(testCase); Step root = stepStorage.pollLast(); if (Status.PASSED.equals(testCase.getStatus())) { new RemoveAttachmentsEvent(AllureConfig.newInstance().getRemoveAttachments()).process(root); } testCase.getSteps().addAll(root.getSteps()); testCase.getAttachments().addAll(root.getAttachments()); stepStorage.remove(); testCaseStorage.remove(); notifier.fire(event); }
private Step convert(final Path source, final ResultsVisitor visitor, final ru.yandex.qatools.allure.model.Step s, final Status testStatus, final String message, final String trace) { final Status status = convert(s.getStatus()); final Step current = new Step() .setName(s.getTitle() == null ? s.getName() : s.getTitle()) .setTime(new Time() .setStart(s.getStart()) .setStop(s.getStop()) .setDuration(s.getStop() - s.getStart())) .setStatus(status) .setSteps(convert(s.getSteps(), step -> convert(source, visitor, step, testStatus, message, trace))) .setAttachments(convert(s.getAttachments(), attach -> convert(source, visitor, attach))); //Copy test status details to each step set the same status if (Objects.equals(status, testStatus)) { current.setStatusMessage(message); current.setStatusMessage(trace); } return current; }