From a6975be08cf6df9a724091f0fbdbf179fe9c67dc Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Fri, 13 Sep 2024 15:40:20 +0300 Subject: [PATCH] Client version update --- CHANGELOG.md | 3 +++ .../epam/reportportal/karate/ReportPortalHook.java | 3 ++- .../epam/reportportal/karate/ReportPortalUtils.java | 13 +++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b91da1..d890927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased] +### Changed +- Client version updated on [5.2.14](https://github.com/reportportal/client-java/releases/tag/5.2.14), by @HardNorth +- Called inner Features are now Nested Steps inside base Feature, by @HardNorth ## [5.0.5] ### Changed diff --git a/src/main/java/com/epam/reportportal/karate/ReportPortalHook.java b/src/main/java/com/epam/reportportal/karate/ReportPortalHook.java index 75fcc8d..dc6570e 100644 --- a/src/main/java/com/epam/reportportal/karate/ReportPortalHook.java +++ b/src/main/java/com/epam/reportportal/karate/ReportPortalHook.java @@ -25,6 +25,7 @@ import com.epam.reportportal.service.ReportPortal; import com.epam.reportportal.utils.MemoizingSupplier; import com.epam.reportportal.utils.StatusEvaluation; +import com.epam.reportportal.utils.markdown.MarkdownUtils; import com.epam.ta.reportportal.ws.model.FinishExecutionRQ; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; import com.epam.ta.reportportal.ws.model.StartTestItemRQ; @@ -153,7 +154,7 @@ protected StartTestItemRQ buildStartFeatureRq(@Nonnull FeatureRuntime fr) { String parameters = String.format(PARAMETERS_PATTERN, formatParametersAsTable(getParameters(args))); String description = rq.getDescription(); if (isNotBlank(description)) { - rq.setDescription(String.format(MARKDOWN_DELIMITER_PATTERN, parameters, description)); + rq.setDescription(MarkdownUtils.asTwoParts(parameters, description)); } else { rq.setDescription(parameters); } diff --git a/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java b/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java index 6913691..7ad60aa 100644 --- a/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java +++ b/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java @@ -25,6 +25,7 @@ import com.epam.reportportal.utils.AttributeParser; import com.epam.reportportal.utils.ParameterUtils; import com.epam.reportportal.utils.TestCaseIdUtils; +import com.epam.reportportal.utils.markdown.MarkdownUtils; import com.epam.reportportal.utils.properties.SystemAttributesExtractor; import com.epam.ta.reportportal.ws.model.FinishExecutionRQ; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; @@ -60,7 +61,7 @@ public class ReportPortalUtils { public static final String SKIPPED_ISSUE_KEY = "skippedIssue"; public static final String SCENARIO_CODE_REFERENCE_PATTERN = "%s/[SCENARIO:%s]"; public static final String EXAMPLE_CODE_REFERENCE_PATTERN = "%s/[EXAMPLE:%s%s]"; - public static final String MARKDOWN_DELIMITER = "\n\n---\n\n"; + public static final String MARKDOWN_DELIMITER = "\n" + MarkdownUtils.LOGICAL_SEPARATOR + "\n"; public static final String MARKDOWN_DELIMITER_PATTERN = "%s" + MARKDOWN_DELIMITER + "%s"; public static final String FEATURE_TAG = "Feature: "; public static final String SCENARIO_TAG = "Scenario: "; @@ -246,7 +247,7 @@ public static StartTestItemRQ buildStartFeatureRq(@Nonnull Feature feature) { String featurePath = feature.getResource().getUri().toString(); String description = feature.getDescription(); if (isNotBlank(description)) { - rq.setDescription(String.format(MARKDOWN_DELIMITER_PATTERN, featurePath, description)); + rq.setDescription(MarkdownUtils.asTwoParts(featurePath, description)); } else { rq.setDescription(featurePath); } @@ -321,13 +322,17 @@ public static StartTestItemRQ buildStartScenarioRq(@Nonnull ScenarioResult resul @Nonnull public static FinishTestItemRQ buildFinishScenarioRq(@Nonnull ScenarioResult result) { Scenario scenario = result.getScenario(); - FinishTestItemRQ rq = buildFinishTestItemRq(Calendar.getInstance().getTime(), result.getFailureMessageForDisplay() == null ? ItemStatus.PASSED : ItemStatus.FAILED); + FinishTestItemRQ rq = buildFinishTestItemRq( + Calendar.getInstance().getTime(), + result.getFailureMessageForDisplay() == null ? ItemStatus.PASSED : ItemStatus.FAILED + ); rq.setDescription(buildDescription(scenario, result.getErrorMessage(), getParameters(scenario))); return rq; } @Nonnull - private static String buildDescription(@Nonnull Scenario scenario, @Nullable String errorMessage, @Nullable List parameters) { + private static String buildDescription(@Nonnull Scenario scenario, @Nullable String errorMessage, + @Nullable List parameters) { StringBuilder descriptionBuilder = new StringBuilder(); if (parameters != null && !parameters.isEmpty()) {