From 685d101e27e8ca28a4620f1ad0e22a342c00062d Mon Sep 17 00:00:00 2001 From: Benjamin Bischoff <5775857+bischoffdev@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:36:52 +0100 Subject: [PATCH] 3.9.0 (#361) * update, thread-safe mojo * resilience, javadoc warnings * outputs/docstrings does not yield different scenarios * 3.8.3 -> 3.9.0 --- CHANGELOG.md | 18 +++++ .../cluecumber/core/CluecumberCore.java | 13 ++- engine/pom.xml | 4 - .../cluecumber/engine/CluecumberEngine.java | 12 ++- .../engine/constants/Navigation.java | 7 ++ .../cluecumber/engine/constants/Settings.java | 7 ++ .../cluecumber/engine/json/pojo/Argument.java | 7 ++ .../engine/json/pojo/DocString.java | 7 ++ .../cluecumber/engine/json/pojo/Element.java | 7 ++ .../engine/json/pojo/Embedding.java | 7 ++ .../cluecumber/engine/json/pojo/Match.java | 8 ++ .../cluecumber/engine/json/pojo/Report.java | 7 ++ .../cluecumber/engine/json/pojo/Result.java | 9 ++- .../engine/json/pojo/ResultMatch.java | 7 ++ .../cluecumber/engine/json/pojo/Row.java | 8 ++ .../cluecumber/engine/json/pojo/Step.java | 15 +++- .../cluecumber/engine/json/pojo/Tag.java | 8 ++ .../ElementMultipleRunsPreProcessor.java | 40 +++------- .../engine/properties/LinkedProperties.java | 7 ++ .../rendering/pages/charts/pojos/Axis.java | 8 ++ .../rendering/pages/charts/pojos/Chart.java | 8 ++ .../rendering/pages/charts/pojos/Data.java | 8 ++ .../rendering/pages/charts/pojos/Dataset.java | 7 ++ .../rendering/pages/charts/pojos/Legend.java | 7 ++ .../rendering/pages/charts/pojos/Options.java | 8 ++ .../pages/charts/pojos/ScaleLabel.java | 8 ++ .../rendering/pages/charts/pojos/Scales.java | 9 +++ .../rendering/pages/charts/pojos/Ticks.java | 8 ++ .../engine/rendering/pages/pojos/Times.java | 8 ++ .../pages/renderering/PageRenderer.java | 7 ++ .../pages/renderering/RenderingUtils.java | 8 ++ .../resources/template/css/cluecumber.css | 2 +- .../resources/template/macros/navigation.ftl | 79 ++++++++++--------- .../main/resources/template/macros/page.ftl | 8 +- .../main/resources/template/snippets/js.ftl | 23 +++--- .../ElementMultipleRunsPreProcessorTest.java | 4 +- examples/core-example/pom.xml | 2 +- examples/maven-example/pom.xml | 2 +- makefile | 2 +- .../cluecumber/maven/CluecumberMaven.java | 2 +- pom.xml | 24 ++++-- 41 files changed, 338 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df181529..8de35ca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Back to [Readme](README.md). +## [3.9.0] - 2024-11-05 + +### Fixed + +* Plugin doesn't support parallel compilation (#358) +* Merging of reports with same test scenario doesn't work when output is different (#359) +* Dark mode flickering on navigation +* Wrong dark mode toggle caption when starting with dark mode active +* Fixed all Javadoc warnings + +### Changed + +* Shortened dark/light mode button caption +* Allow report generation even if `` defined file does not exist (#357) +* Updated JUnit Jupiter, Mockito, JavaDoc and GPG plugins + ## [3.8.2] - 2024-10-30 ### Added @@ -924,6 +940,8 @@ the core component is now the reporting engine that is the base for other forms Initial project version on GitHub and Maven Central. +[3.9.0]: https://github.com/trivago/cluecumber-report-plugin/tree/v3.9.0 + [3.8.2]: https://github.com/trivago/cluecumber-report-plugin/tree/v3.8.2 [3.8.1]: https://github.com/trivago/cluecumber-report-plugin/tree/v3.8.1 diff --git a/core/src/main/java/com/trivago/cluecumber/core/CluecumberCore.java b/core/src/main/java/com/trivago/cluecumber/core/CluecumberCore.java index b1d42b23..3c46f590 100644 --- a/core/src/main/java/com/trivago/cluecumber/core/CluecumberCore.java +++ b/core/src/main/java/com/trivago/cluecumber/core/CluecumberCore.java @@ -36,7 +36,7 @@ public class CluecumberCore { * @param builder The builder instance. * @throws CluecumberException Thrown in case of any error. */ - private CluecumberCore(Builder builder) throws CluecumberException { + private CluecumberCore(final Builder builder) throws CluecumberException { cluecumberEngine = DaggerCluecumberCoreGraph.create().getCluecumberEngine(); cluecumberEngine.setCustomCssFile(builder.customCssFile); cluecumberEngine.setCustomFavicon(builder.customFavicon); @@ -73,7 +73,7 @@ public void generateReports(final String jsonDirectory, final String reportDirec } /** - * The builder class for a new {@link CluecumberCore} instance. + * The builder class for the {@link CluecumberCore}. */ public static class Builder { private String customCssFile; @@ -98,6 +98,13 @@ public static class Builder { private boolean failScenariosOnPendingOrUndefinedSteps; private boolean expandOutputs; + /** + * Default constructor for the Builder class. + */ + public Builder() { + // Default constructor + } + /** * Finalize the {@link CluecumberCore} builder. * @@ -141,7 +148,6 @@ public Builder setCustomNavigationLinks(final LinkedHashMap cust return this; } - /** * Custom parameters to display at the top of the test report. * @@ -153,7 +159,6 @@ public Builder setCustomParameters(final LinkedHashMap customPar return this; } - /** * Where to display custom parameters. * diff --git a/engine/pom.xml b/engine/pom.xml index 22019070..b6456d5b 100644 --- a/engine/pom.xml +++ b/engine/pom.xml @@ -29,7 +29,6 @@ 11 UTF-8 - 3.13.0 2.8.0-M1 2.3.33 1.9.0 @@ -38,7 +37,6 @@ 1.5.0 1.1.0 0.9.1 - 3.4.2 @@ -95,7 +93,6 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven-compiler-plugin.version} @@ -112,7 +109,6 @@ org.apache.maven.plugins maven-jar-plugin - ${maven-jar-plugin.version} diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/CluecumberEngine.java b/engine/src/main/java/com/trivago/cluecumber/engine/CluecumberEngine.java index 3a1f7226..a6c9d507 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/CluecumberEngine.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/CluecumberEngine.java @@ -166,7 +166,11 @@ public void setCustomParameters(final LinkedHashMap customParame * @throws CluecumberException Thrown on any error. */ public void setCustomParametersFile(final String customParametersFile) throws CluecumberException { - propertyManager.setCustomParametersFile(customParametersFile); + try { + propertyManager.setCustomParametersFile(customParametersFile); + } catch (MissingFileException e) { + logger.warn("Could not read custom parameters file: " + e.getMessage()); + } } /** @@ -284,6 +288,12 @@ public void setCustomCssFile(final String customCss) throws MissingFileException propertyManager.setCustomCssFile(customCss); } + /** + * Custom favicon file to use for the report. + * + * @param customFavicon The path to a favicon file. + * @throws MissingFileException Thrown if the specified file does not exist. + */ public void setCustomFavicon(final String customFavicon) throws MissingFileException { if (customFavicon == null) { return; diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/constants/Navigation.java b/engine/src/main/java/com/trivago/cluecumber/engine/constants/Navigation.java index b8ac5f54..8b55eccf 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/constants/Navigation.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/constants/Navigation.java @@ -25,6 +25,13 @@ * Report navigation. */ public class Navigation { + /** + * Default constructor. + */ + public Navigation() { + // Default constructor + } + /** * The list of internal report navigation links. */ diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/constants/Settings.java b/engine/src/main/java/com/trivago/cluecumber/engine/constants/Settings.java index 52c5e234..828437f9 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/constants/Settings.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/constants/Settings.java @@ -20,6 +20,13 @@ */ public class Settings { + /** + * Default constructor. + */ + public Settings() { + // Default constructor + } + /** * The name of the Cluecumber plugin. */ diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Argument.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Argument.java index 13f3f53f..d16ae3bc 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Argument.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Argument.java @@ -22,6 +22,13 @@ public class Argument { private String val; private int offset; + /** + * Default constructor. + */ + public Argument() { + // Default constructor + } + /** * Gets the value of the argument. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/DocString.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/DocString.java index 6b3bc3d3..8a7dd9a4 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/DocString.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/DocString.java @@ -24,6 +24,13 @@ public class DocString { private int line; private String value = ""; + /** + * Default constructor. + */ + public DocString() { + // Default constructor + } + /** * Get the line number. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Element.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Element.java index e5ee098e..3cb21e11 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Element.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Element.java @@ -52,6 +52,13 @@ public class Element { private transient int scenarioIndex = 0; private transient boolean failOnPendingOrUndefined = false; + /** + * Default constructor. + */ + public Element() { + // Default constructor + } + /** * Get the list of tags of this scenario. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Embedding.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Embedding.java index 91ab9b84..88c41e38 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Embedding.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Embedding.java @@ -36,6 +36,13 @@ public class Embedding { private transient String filename = ""; + /** + * Default constructor. + */ + public Embedding() { + // Default constructor + } + /** * Get the raw attachment data. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Match.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Match.java index 997e3f5f..ab4e9dbf 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Match.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Match.java @@ -22,9 +22,17 @@ * The match of the {@link ResultMatch}. */ public class Match { + private String location = ""; private List arguments = new ArrayList<>(); + /** + * Default constructor. + */ + public Match() { + // Default constructor + } + /** * Get the class and method where this step is defined. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Report.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Report.java index a5035b75..0a87c902 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Report.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Report.java @@ -32,6 +32,13 @@ public class Report implements Cloneable { private transient int featureIndex = -1; + /** + * Default constructor. + */ + public Report() { + // Default constructor + } + /** * Get the line number where this feature starts. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Result.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Result.java index 4f9ac914..a997f6e9 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Result.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Result.java @@ -30,6 +30,13 @@ public class Result { @SerializedName("error_message") private String errorMessage = ""; + /** + * Default constructor. + */ + public Result() { + // Default constructor + } + /** * Get the duration of this result. * @@ -104,7 +111,7 @@ public long getDurationInMilliseconds() { } /** - * Get the human readable duration string. + * Get the human-readable duration string. * * @return The duration string. */ diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/ResultMatch.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/ResultMatch.java index 43f1cd2c..bac068d1 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/ResultMatch.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/ResultMatch.java @@ -30,6 +30,13 @@ public class ResultMatch { private List output = new ArrayList<>(); private List embeddings = new ArrayList<>(); + /** + * Default constructor. + */ + public ResultMatch() { + // Default constructor + } + /** * Get the result. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Row.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Row.java index d94907ba..93311717 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Row.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Row.java @@ -22,8 +22,16 @@ * Table row. */ public class Row { + private List cells = new ArrayList<>(); + /** + * Default constructor. + */ + public Row() { + // Default constructor + } + /** * Get the individual table cells in this row. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Step.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Step.java index 00d94c2d..d125ae39 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Step.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Step.java @@ -30,6 +30,7 @@ * A Cucumber step. */ public class Step extends ResultMatch { + private List before = new ArrayList<>(); private int line; private String name = ""; @@ -44,6 +45,13 @@ public class Step extends ResultMatch { private static final Map stepMatchToNameWithArgumentPlaceholders = new HashMap<>(); + /** + * Default constructor. + */ + public Step() { + // Default constructor + } + /** * Check if there are before or after step hooks with content. * @@ -344,7 +352,7 @@ public boolean hasSubSections() { } /** - * Set if the step has sub sections. + * Set if the step has subsections. * * @param hasSubSections true if the step has sub sections. */ @@ -352,6 +360,11 @@ public void setHasSubSections(boolean hasSubSections) { this.hasSubSections = hasSubSections; } + /** + * Get the unique name of the step. + * + * @return The unique name. + */ public String getUniqueName() { return getGlueMethodName() + "_" + returnNameWithArgumentPlaceholders(); } diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Tag.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Tag.java index f644e660..d28683af 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Tag.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/pojo/Tag.java @@ -25,8 +25,16 @@ * This represents a Cucumber tag. */ public class Tag { + private String name; + /** + * Default constructor. + */ + public Tag() { + // Default constructor + } + /** * Get the tag name. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessor.java b/engine/src/main/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessor.java index ffea0549..7400850d 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessor.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessor.java @@ -15,10 +15,8 @@ */ package com.trivago.cluecumber.engine.json.processors; -import com.trivago.cluecumber.engine.json.pojo.Argument; import com.trivago.cluecumber.engine.json.pojo.Element; import com.trivago.cluecumber.engine.json.pojo.Report; -import com.trivago.cluecumber.engine.json.pojo.Row; import com.trivago.cluecumber.engine.json.pojo.Step; import com.trivago.cluecumber.engine.json.pojo.Tag; @@ -80,8 +78,6 @@ public void addMultipleRunsInformationToScenarios(final List reports) { private String generateCombinedId(Element element) { List argumentValues = new ArrayList<>(); - List docStrings = new ArrayList<>(); - List> outputs = new ArrayList<>(); List rows = new ArrayList<>(); for (Step step : element.getSteps()) { @@ -89,33 +85,23 @@ private String generateCombinedId(Element element) { .map(argument -> argument.getOffset() + ": " + argument.getVal()) .forEach(argumentValues::add); - if (step.getDocString() != null) { - docStrings.add(step.getDocString().getLine() + ": " + step.getDocString().getValue()); - } - - if (step.getOutput() != null) { - outputs.add(step.getOutput()); - } - if (step.getRows() != null) { step.getRows().forEach(row -> rows.add(String.join(", ", row.getCells()))); } } - return String.valueOf((element.getFeatureIndex() + - element.getDescription() + - element.getLine() + - element.getFeatureName() + - element.getName() + - element.getId() + - element.getTags().stream().map(Tag::getName).collect(Collectors.joining(",")) + - element.getTotalNumberOfSteps() + - element.getSteps().stream().map(Step::getKeyword).collect(Collectors.joining(", ")) + - element.getSteps().stream().map(Step::getName).collect(Collectors.joining(", ")) + - String.join(", ", docStrings) + - String.join(", ", argumentValues) + - String.join(", ", rows) + - outputs.stream().map(output -> String.join(", ", output)).collect(Collectors.joining(", "))) - .hashCode()); + return element.getFeatureIndex() + + element.getDescription() + + element.getLine() + + element.getFeatureName() + + element.getName() + + element.getId() + + element.getTags().stream().map(Tag::getName).collect(Collectors.joining(",")) + + element.getTotalNumberOfSteps() + + element.getSteps().stream().map(Step::getKeyword).collect(Collectors.joining(", ")) + + element.getSteps().stream().map(Step::getName).collect(Collectors.joining(", ")) + + String.join(", ", argumentValues) + + String.join(", ", rows) + .hashCode(); } } diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/properties/LinkedProperties.java b/engine/src/main/java/com/trivago/cluecumber/engine/properties/LinkedProperties.java index 2f7aedeb..81c4c673 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/properties/LinkedProperties.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/properties/LinkedProperties.java @@ -33,6 +33,13 @@ public class LinkedProperties extends Properties { */ private final Map linkMap = new LinkedHashMap<>(); + /** + * Default constructor. + */ + public LinkedProperties() { + // Default constructor + } + /** * Add a property. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Axis.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Axis.java index 08641832..33503657 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Axis.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Axis.java @@ -18,12 +18,20 @@ /** * Chart axis. */ +@SuppressWarnings("unused") public class Axis { private Ticks ticks; private boolean stacked; private ScaleLabel scaleLabel; private float stepSize; + /** + * Default constructor. + */ + public Axis() { + // Default constructor + } + /** * Get the ticks on this chart axis. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Chart.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Chart.java index b4830d26..ab8e13a2 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Chart.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Chart.java @@ -26,6 +26,13 @@ public class Chart { private Options options; private ChartConfiguration.Type type; + /** + * Default constructor. + */ + public Chart() { + // Default constructor + } + /** * Get the chart data. * @@ -68,6 +75,7 @@ public void setType(final ChartConfiguration.Type type) { * * @return The {@link Options} instance. */ + @SuppressWarnings("unused") public Options getOptions() { return options; } diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Data.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Data.java index d3f9c995..b562a5a1 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Data.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Data.java @@ -20,10 +20,18 @@ /** * The chart data to be displayed. */ +@SuppressWarnings("unused") public class Data { private List labels; private List datasets; + /** + * Default constructor. + */ + public Data() { + // Default constructor + } + /** * Get the labels for the data sets. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Dataset.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Dataset.java index c4dce728..2421f213 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Dataset.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Dataset.java @@ -28,6 +28,13 @@ public class Dataset { private String label; private String stack; + /** + * Default constructor. + */ + public Dataset() { + // Default constructor + } + /** * Get the values of this dataset. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Legend.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Legend.java index 3e167437..51f428e6 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Legend.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Legend.java @@ -19,6 +19,13 @@ * The legend for charts shown in the report. */ public class Legend { + /** + * Default constructor. + */ + public Legend() { + // Default constructor + } + /** * Return if the legend should be displayed. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Options.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Options.java index 8a3f01ac..92b0e7d9 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Options.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Options.java @@ -22,10 +22,18 @@ * Chart options. */ public class Options { + private Scales scales; private Legend legend; private List events; + /** + * Default constructor. + */ + public Options() { + // Default constructor + } + /** * Get the scales. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/ScaleLabel.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/ScaleLabel.java index f810993c..7bb96f52 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/ScaleLabel.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/ScaleLabel.java @@ -19,9 +19,17 @@ * The */ public class ScaleLabel { + private boolean display; private String labelString; + /** + * Default constructor. + */ + public ScaleLabel() { + // Default constructor + } + /** * Whether the label should be displayed. * @return true if it should be displayed. diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Scales.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Scales.java index 63a7a189..b8d016fa 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Scales.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Scales.java @@ -20,10 +20,19 @@ /** * The axes of the chart. */ +@SuppressWarnings("unused") public class Scales { + private List xAxes; private List yAxes; + /** + * Default constructor. + */ + public Scales() { + // Default constructor + } + /** * Get the x axes. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Ticks.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Ticks.java index a9383a66..afe272f0 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Ticks.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/charts/pojos/Ticks.java @@ -19,10 +19,18 @@ * Class to define the ticks on chart axes. */ public class Ticks { + private int min; private float stepSize; private boolean display = true; + /** + * Default constructor. + */ + public Ticks() { + // Default constructor + } + /** * Get the minimum tick. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/pojos/Times.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/pojos/Times.java index 4279dcad..13fd1ef8 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/pojos/Times.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/pojos/Times.java @@ -26,8 +26,16 @@ * This class holds feature, scenario or step indeces and associated times. */ public class Times { + private final List times = new ArrayList<>(); + /** + * Default constructor. + */ + public Times() { + // Default constructor + } + /** * Add a time and an index to the list of times. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/PageRenderer.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/PageRenderer.java index 44430a1f..62380766 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/PageRenderer.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/PageRenderer.java @@ -35,6 +35,13 @@ */ public class PageRenderer { + /** + * Default constructor. + */ + public PageRenderer() { + // Default constructor + } + /** * Return the completely rendered template content using a page collection. * diff --git a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/RenderingUtils.java b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/RenderingUtils.java index 4877403f..cf942f6c 100644 --- a/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/RenderingUtils.java +++ b/engine/src/main/java/com/trivago/cluecumber/engine/rendering/pages/renderering/RenderingUtils.java @@ -31,10 +31,18 @@ * Generic utilities for page rendering. */ public class RenderingUtils { + private static final int MICROSECOND_FACTOR = 1000000; private static final Pattern URL_PATTERN = Pattern.compile( "\\b((ftp|https?|file)://\\S+)|\\b(file:\\\\\\\\S+)"); + /** + * Default constructor. + */ + private RenderingUtils() { + // Default constructor + } + /** * Convert nanoseconds to a human-readable time string. * diff --git a/engine/src/main/resources/template/css/cluecumber.css b/engine/src/main/resources/template/css/cluecumber.css index a489257b..1c0eca63 100644 --- a/engine/src/main/resources/template/css/cluecumber.css +++ b/engine/src/main/resources/template/css/cluecumber.css @@ -314,6 +314,6 @@ html.dark-mode .border-color-skipped{ filter: invert(100%) hue-rotate(180deg); } -#dark-mode-toggle { +#dark-light-mode-switch { margin-right: 10px; } diff --git a/engine/src/main/resources/template/macros/navigation.ftl b/engine/src/main/resources/template/macros/navigation.ftl index 2a8b2228..0d1d77e1 100644 --- a/engine/src/main/resources/template/macros/navigation.ftl +++ b/engine/src/main/resources/template/macros/navigation.ftl @@ -22,47 +22,50 @@ limitations under the License. + \ No newline at end of file diff --git a/engine/src/main/resources/template/macros/page.ftl b/engine/src/main/resources/template/macros/page.ftl index 70e6ee83..7d3921fe 100644 --- a/engine/src/main/resources/template/macros/page.ftl +++ b/engine/src/main/resources/template/macros/page.ftl @@ -35,7 +35,13 @@ limitations under the License. ${title} - + + <#include "../snippets/common_headers.ftl"> <#include "../snippets/css.ftl"> <#include "../snippets/js.ftl"> diff --git a/engine/src/main/resources/template/snippets/js.ftl b/engine/src/main/resources/template/snippets/js.ftl index 86a4accb..a6aa2c0e 100644 --- a/engine/src/main/resources/template/snippets/js.ftl +++ b/engine/src/main/resources/template/snippets/js.ftl @@ -126,28 +126,27 @@ limitations under the License. $("[data-cluecumber-item='multi-run-button']").click(); } - const isDarkMode = localStorage.getItem('darkMode') === 'enabled'; - if (isDarkMode) { - document.documentElement.classList.add('dark-mode'); - } - updateToggleButton(isDarkMode); - - document.getElementById('dark-mode-toggle').addEventListener('click', toggleDarkMode); + document.getElementById('dark-light-mode-switch').addEventListener('click', darkLightModeSwitch); } ); - function toggleDarkMode() { + function darkLightModeSwitch() { document.documentElement.classList.toggle('dark-mode'); const isDarkMode = document.documentElement.classList.contains('dark-mode'); localStorage.setItem('darkMode', isDarkMode ? 'enabled' : 'disabled'); - updateToggleButton(isDarkMode); + updateDarkLightModeButton(isDarkMode); } - function updateToggleButton(isDarkMode) { - const button = document.getElementById('dark-mode-toggle'); - button.textContent = isDarkMode ? 'Toggle Light Mode' : 'Toggle Dark Mode'; + function updateDarkLightModeButton(isDarkMode) { + const button = document.getElementById('dark-light-mode-switch'); + console.log("BUTTON: " + button); + console.log("isDarkMode: " + isDarkMode); + console.log("button.textContent: " + button.textContent); + button.textContent = isDarkMode ? 'Light Mode' : 'Dark Mode'; } + console.log("The button is " + document.getElementById('dark-light-mode-switch')) + function resizeIframe(iframe) { setInterval(function () { try { diff --git a/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java b/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java index e2e629d3..0a1606cf 100644 --- a/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java +++ b/engine/src/test/java/com/trivago/cluecumber/engine/json/processors/ElementMultipleRunsPreProcessorTest.java @@ -188,7 +188,7 @@ public void addMultipleRunsInformationToSameScenariosWithDifferentDocStrings() { elementMultipleRunsPreProcessor.addMultipleRunsInformationToScenarios(reports); List newElements = reports.get(0).getElements(); - assertEquals(2, newElements.size()); + assertEquals(1, newElements.size()); } @Test @@ -213,7 +213,7 @@ public void addMultipleRunsInformationToSameScenariosWithDifferentOutputs() { elementMultipleRunsPreProcessor.addMultipleRunsInformationToScenarios(reports); List newElements = reports.get(0).getElements(); - assertEquals(2, newElements.size()); + assertEquals(1, newElements.size()); } @Test diff --git a/examples/core-example/pom.xml b/examples/core-example/pom.xml index afd0bc85..7e7a3030 100644 --- a/examples/core-example/pom.xml +++ b/examples/core-example/pom.xml @@ -6,7 +6,7 @@ blog.softwaretester core-example - 3.8.1 + 3.9.0 jar diff --git a/examples/maven-example/pom.xml b/examples/maven-example/pom.xml index bb1b7957..8e3f8389 100644 --- a/examples/maven-example/pom.xml +++ b/examples/maven-example/pom.xml @@ -6,7 +6,7 @@ blog.softwaretester maven-example - 3.8.2 + 3.9.0 pom diff --git a/makefile b/makefile index 4e982415..954a6e64 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,7 @@ build: .Phony: build test: - ./mvnw clean verify -U -ntp -f examples/maven-example/pom.xml + ./mvnw clean verify -U -ntp -f examples/maven-example/pom.xml -threads 1.0C open examples/maven-example/target/cluecumber-report/index.html .Phony: test diff --git a/maven/src/main/java/com/trivago/cluecumber/maven/CluecumberMaven.java b/maven/src/main/java/com/trivago/cluecumber/maven/CluecumberMaven.java index 40279010..3a973a18 100644 --- a/maven/src/main/java/com/trivago/cluecumber/maven/CluecumberMaven.java +++ b/maven/src/main/java/com/trivago/cluecumber/maven/CluecumberMaven.java @@ -29,7 +29,7 @@ /** * The main plugin class. */ -@Mojo(name = "reporting", requiresProject = false) +@Mojo(name = "reporting", requiresProject = false, threadSafe = true) public final class CluecumberMaven extends AbstractMojo { /** diff --git a/pom.xml b/pom.xml index b9baf920..9260283a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ - 3.8.2 + 3.9.0 11 11 11 @@ -31,16 +31,18 @@ UTF-8 UTF-8 3.11.0 - 3.2.5 + 3.2.7 1.7.0 - 5.11.0 - 5.13.0 - 3.5.0 + 5.11.3 + 5.14.2 + 3.5.2 3.3.1 - 3.10.0 + 3.11.1 3.1.1 3.3.1 3.1.3 + 3.4.2 + 3.13.0 1.6.0 @@ -144,6 +146,16 @@ maven-install-plugin ${maven-install-plugin.version} + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} +