From 4346bdda1336150b27ae5fb6374d46e91fc5f176 Mon Sep 17 00:00:00 2001 From: Dmitry Baev Date: Sat, 23 Sep 2023 11:34:44 +0100 Subject: [PATCH] add support for attachment meta steps (via #2107) --- .../testresult-execution/steps-list.hbs | 36 +++++++++++-------- .../io/qameta/allure/entity/Summarizable.java | 9 +++++ 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/allure-generator/src/main/javascript/components/testresult-execution/steps-list.hbs b/allure-generator/src/main/javascript/components/testresult-execution/steps-list.hbs index 211252306..5c84c89ec 100644 --- a/allure-generator/src/main/javascript/components/testresult-execution/steps-list.hbs +++ b/allure-generator/src/main/javascript/components/testresult-execution/steps-list.hbs @@ -1,23 +1,29 @@ {{#each steps}}
+ {{#if attachmentStep}} + {{#each attachments}} + {{> ../../blocks/attachment-row/attachment-row . baseUrl=../../baseUrl}} + {{/each}} + {{else}}
- {{#if hasContent}} - {{arrow status}} - {{else}} - {{allure-icon status}} - {{/if}} -
{{text-with-links name}}
- {{> ../../blocks/step-stats/step-stats . baseUrl=../../baseUrl}} + {{#if hasContent}} + {{arrow status}} + {{else}} + {{allure-icon status}} + {{/if}} +
{{text-with-links name}}
+ {{> ../../blocks/step-stats/step-stats . baseUrl=../../baseUrl}}
- {{> ../../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}}
+ {{/if}}
{{/each}} diff --git a/allure-plugin-api/src/main/java/io/qameta/allure/entity/Summarizable.java b/allure-plugin-api/src/main/java/io/qameta/allure/entity/Summarizable.java index a977cfcf1..617ef78de 100644 --- a/allure-plugin-api/src/main/java/io/qameta/allure/entity/Summarizable.java +++ b/allure-plugin-api/src/main/java/io/qameta/allure/entity/Summarizable.java @@ -29,6 +29,8 @@ */ public interface Summarizable { + String getName(); + String getStatusMessage(); List getSteps(); @@ -77,4 +79,11 @@ default boolean hasContent() { final List 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()); + } }