Skip to content

Commit

Permalink
add support for attachment meta steps (via #2107)
Browse files Browse the repository at this point in the history
  • Loading branch information
baev authored Sep 23, 2023
1 parent 2dd6074 commit 4346bdd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
{{#each steps}}
<div class="step">
{{#if attachmentStep}}
{{#each attachments}}
{{> ../../blocks/attachment-row/attachment-row . baseUrl=../../baseUrl}}
{{/each}}
{{else}}
<div class="{{b "step" "title" hasContent=hasContent}} long-line">
{{#if hasContent}}
<span class="step__arrow block__arrow">{{arrow status}}</span>
{{else}}
<span class="step__status">{{allure-icon status}}</span>
{{/if}}
<div class="step__name">{{text-with-links name}}</div>
{{> ../../blocks/step-stats/step-stats . baseUrl=../../baseUrl}}
{{#if hasContent}}
<span class="step__arrow block__arrow">{{arrow status}}</span>
{{else}}
<span class="step__status">{{allure-icon status}}</span>
{{/if}}
<div class="step__name">{{text-with-links name}}</div>
{{> ../../blocks/step-stats/step-stats . baseUrl=../../baseUrl}}
</div>
<div class="step__content">
{{> ../../blocks/parameters-table/parameters-table parameters=parameters }}
{{~> steps-list steps=steps baseUrl=../baseUrl}}
{{#each attachments}}
{{> ../../blocks/attachment-row/attachment-row . baseUrl=../../baseUrl}}
{{/each}}
{{#if shouldDisplayMessage}}
{{~> ../../blocks/status-details/status-details .}}
{{/if}}
{{> ../../blocks/parameters-table/parameters-table parameters=parameters }}
{{~> steps-list steps=steps baseUrl=../baseUrl}}
{{#each attachments}}
{{> ../../blocks/attachment-row/attachment-row . baseUrl=../../baseUrl}}
{{/each}}
{{#if shouldDisplayMessage}}
{{~> ../../blocks/status-details/status-details .}}
{{/if}}
</div>
{{/if}}
</div>
{{/each}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
public interface Summarizable {

String getName();

String getStatusMessage();

List<Step> getSteps();
Expand Down Expand Up @@ -77,4 +79,11 @@ default boolean hasContent() {
final List<Parameter> parameters = isNull(getParameters()) ? emptyList() : getParameters();
return steps.size() + attachments.size() + parameters.size() > 0 || shouldDisplayMessage();
}

@JsonProperty
default boolean isAttachmentStep() {
return getStepsCount() == 0
&& getAttachmentsCount() == 1
&& Objects.equals(getName(), getAttachments().get(0).getName());
}
}

0 comments on commit 4346bdd

Please sign in to comment.