From e73486faff15c919dee71ee6784804cdf4f580b2 Mon Sep 17 00:00:00 2001 From: vdelendik Date: Fri, 12 May 2023 19:14:55 +0200 Subject: [PATCH] added ci_build_url as configuration param and reused for cucumberreport link generation --- .../java/com/zebrunner/carina/utils/Configuration.java | 3 +++ .../zebrunner/carina/utils/report/ReportContext.java | 10 +++------- src/main/resources/config.properties | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/zebrunner/carina/utils/Configuration.java b/src/main/java/com/zebrunner/carina/utils/Configuration.java index 0f7bb70..062a1df 100644 --- a/src/main/java/com/zebrunner/carina/utils/Configuration.java +++ b/src/main/java/com/zebrunner/carina/utils/Configuration.java @@ -97,7 +97,10 @@ public enum Parameter { PROXY_SET_TO_SYSTEM("proxy_set_to_system"), + @Deprecated REPORT_URL("report_url"), + + CI_BUILD_URL("ci_build_url"), AUTO_SCREENSHOT("auto_screenshot"), diff --git a/src/main/java/com/zebrunner/carina/utils/report/ReportContext.java b/src/main/java/com/zebrunner/carina/utils/report/ReportContext.java index 8a501b1..dabcdc0 100644 --- a/src/main/java/com/zebrunner/carina/utils/report/ReportContext.java +++ b/src/main/java/com/zebrunner/carina/utils/report/ReportContext.java @@ -693,13 +693,9 @@ public static String getCucumberReportLink() { String fileName = SpecialKeywords.CUCUMBER_REPORT_FILE_NAME; String link = ""; - if (!Configuration.get(Configuration.Parameter.REPORT_URL).isEmpty()) { - String reportUrl = Configuration.get(Configuration.Parameter.REPORT_URL); - if (reportUrl.contains("n/a")) { - LOGGER.error("Contains n/a. Replace it."); - reportUrl = reportUrl.replace("n/a", ""); - } - link = String.format("%s/%d/%s/%s/%s", reportUrl, rootID, folder, subFolder, fileName); + if (!Configuration.get(Configuration.Parameter.CI_BUILD_URL).isEmpty()) { + String ciBuildUrl = Configuration.get(Configuration.Parameter.CI_BUILD_URL); + link = String.format("%s/%s", ciBuildUrl, "CucumberReport"); } else { link = String.format("file://%s/%s/%s/%s", getBaseDirAbsolutePath(), folder, subFolder, fileName); } diff --git a/src/main/resources/config.properties b/src/main/resources/config.properties index d020adf..b132480 100644 --- a/src/main/resources/config.properties +++ b/src/main/resources/config.properties @@ -3,3 +3,4 @@ retry_count=0 date_format=HH:mm:ss yyyy-MM-dd time_format=HH:mm:ss +ci_build_url= \ No newline at end of file