Skip to content

Commit

Permalink
fix screenshots in steps (via #62)
Browse files Browse the repository at this point in the history
  • Loading branch information
eroshenkoam authored Oct 17, 2023
1 parent a4f2ee6 commit e727075
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ private void parseStep(final JsonNode activity,
return;
}

if (activity.has(ATTACHMENTS)) {
context.getCurrent().getAttachments().addAll(getAttachments(activity.get(ATTACHMENTS).get(VALUES)));
}
final Optional<List<Attachment>> attachments = Optional.ofNullable(activity.get(ATTACHMENTS))
.map(a -> a.get(VALUES))
.map(this::getAttachments);
if (activityTitle.startsWith("Start Test at") && activity.has(ACTIVITY_START)) {
context.getResult().setStart(parseDate(activity.get(ACTIVITY_START).get(VALUE).asText()));
attachments.ifPresent(context.getCurrent().getAttachments()::addAll);
return;
}

Expand All @@ -193,6 +194,7 @@ private void parseStep(final JsonNode activity,
.setStatus(Status.PASSED)
.setSteps(new ArrayList<>())
.setAttachments(new ArrayList<>());
attachments.ifPresent(step.getAttachments()::addAll);

final boolean hasAssertionMessage = activityTitle.startsWith("Assertion Failure")
|| activityTitle.contains("Test skipped");
Expand Down

0 comments on commit e727075

Please sign in to comment.