Skip to content

Commit

Permalink
Merge pull request #169 from trivago/visitor-architecture
Browse files Browse the repository at this point in the history
Visitor architecture
  • Loading branch information
Benjamin Bischoff authored Jun 10, 2019
2 parents e5a69de + 39fe52f commit 0ed5898
Show file tree
Hide file tree
Showing 66 changed files with 1,128 additions and 654 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

Back to [Readme](README.md).

## [2.0.0] - UNRELEASED

### Changed
* Major internal architecture change to ease extension

## [1.11.0] - 2019-05-21

### Fixed
Expand Down Expand Up @@ -458,6 +463,7 @@ steps with status `pending` or `undefined` (default value is `false`) (#74)

Initial project version on GitHub and Maven Central.

[2.0.0]: https://github.com/trivago/cluecumber-report-plugin/tree/2.0.0
[1.11.0]: https://github.com/trivago/cluecumber-report-plugin/tree/1.11.0
[1.10.2]: https://github.com/trivago/cluecumber-report-plugin/tree/1.10.2
[1.10.1]: https://github.com/trivago/cluecumber-report-plugin/tree/1.10.1
Expand Down
12 changes: 6 additions & 6 deletions example-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.benjamin-bischoff</groupId>
<artifactId>cluecumber-test-project</artifactId>
<version>1.11.0</version>
<version>2.0.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -36,11 +36,11 @@
<generatedHtmlReportDirectory>${generated.report.location}</generatedHtmlReportDirectory>

<!-- Optional custom parameters that are shown on the start page if they have a value -->
<customParameters>
<Custom_Parameter>This is a test</Custom_Parameter>
<Custom_URL>http://www.google.com</Custom_URL>
<Empty_Parameter/>
</customParameters>
<!-- <customParameters>-->
<!-- <Custom_Parameter>This is a test</Custom_Parameter>-->
<!-- <Custom_URL>http://www.google.com</Custom_URL>-->
<!-- <Empty_Parameter/>-->
<!-- </customParameters>-->

<!-- Optional: mark scenarios as failed that contain pending or undefined steps (default: false) -->
<!--<failScenariosOnPendingOrUndefinedSteps>true</failScenariosOnPendingOrUndefinedSteps>-->
Expand Down
4 changes: 2 additions & 2 deletions plugin-code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.trivago.rta</groupId>
<artifactId>cluecumber-report-plugin</artifactId>
<version>1.11.0</version>
<version>2.0.0</version>
<url>https://github.com/trivago/cluecumber-report-plugin</url>

<name>Cluecumber Maven Plugin for Cucumber Reports</name>
Expand Down Expand Up @@ -81,7 +81,7 @@
<maven.source.plugin.version>2.4</maven.source.plugin.version>
<plexus.utilities.version>3.2.0</plexus.utilities.version>

<mockito.version>2.27.0</mockito.version>
<mockito.version>2.28.2</mockito.version>
<junit5.vintage.version>5.5.0-M1</junit5.vintage.version>
<openpojo.version>0.8.12</openpojo.version>

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.trivago.cluecumber.constants;

public class Charts {

public enum Type {bar, pie}

/**
* This enum manages the colors for the overview and detail charts that correspond to the passed in {@link Status} value.
*/
public enum Color {
PASSED(40, 167, 69), FAILED(220, 53, 69), SKIPPED(255, 193, 7);

private static final String COLOR_FORMAT = "rgba(%d, %d, %d, 1.000)";

private final int r;
private final int g;
private final int b;

Color(final int r, final int g, final int b) {
this.r = r;
this.g = g;
this.b = b;
}

/**
* Get the corresponding chart color string for the passed {@link Status}.
*
* @param status the {@link Status}.
* @return the matching color string.
*/
public static String getChartColorStringByStatus(Status status) {
switch (status) {
case FAILED:
return String.format(COLOR_FORMAT, FAILED.r, FAILED.g, FAILED.b);
case SKIPPED:
return String.format(COLOR_FORMAT, SKIPPED.r, SKIPPED.g, SKIPPED.b);
case PASSED:
default:
return String.format(COLOR_FORMAT, PASSED.r, PASSED.g, PASSED.b);
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,25 @@ public class PluginSettings {
public static final String PAGES_DIRECTORY = "pages";

public final static String SCENARIO_SUMMARY_PAGE_NAME = "Scenario Summary";
public final static String SCENARIO_SUMMARY_TEMPLATE = "scenario-summary";
public final static String SCENARIO_SUMMARY_PAGE_PATH = "index";

public final static String SCENARIO_DETAIL_PAGE_NAME = "Scenario Details";
public final static String SCENARIO_DETAIL_TEMPLATE = "scenario-detail";
public final static String SCENARIO_DETAIL_PAGE_PATH = "scenario-detail";
public static final String SCENARIO_DETAIL_PAGE_FRAGMENT = "/" + SCENARIO_DETAIL_PAGE_PATH + "/scenario_";

public final static String SCENARIO_SEQUENCE_TEMPLATE = "scenario-sequence";
public final static String SCENARIO_SEQUENCE_PAGE_PATH = "scenario-sequence";

public final static String TAG_SUMMARY_PAGE_NAME = "Tag Summary";
public final static String TAG_SUMMARY_TEMPLATE = "tag-summary";
public final static String TAG_SUMMARY_PAGE_PATH = "tag-summary";
public static final String TAG_SCENARIO_PAGE_PATH = "tag-scenarios";
public static final String TAG_SCENARIO_PAGE_FRAGMENT = "/" + TAG_SCENARIO_PAGE_PATH + "/tag_";

public final static String STEP_SUMMARY_PAGE_NAME = "Step Summary";
public final static String STEP_SUMMARY_TEMPLATE = "step-summary";
public final static String STEP_SUMMARY_PAGE_PATH = "step-summary";
public static final String STEP_SCENARIO_PAGE_PATH = "step-scenarios";
public static final String STEP_SCENARIO_PAGE_FRAGMENT = "/" + STEP_SCENARIO_PAGE_PATH + "/step_";

public final static String FEATURE_SUMMARY_PAGE_NAME = "Feature Summary";
public final static String FEATURE_SUMMARY_TEMPLATE = "feature-summary";
public final static String FEATURE_SUMMARY_PAGE_PATH = "feature-summary";
public static final String FEATURE_SCENARIOS_PAGE_PATH = "feature-scenarios";
public static final String FEATURE_SCENARIOS_PAGE_FRAGMENT = "/" + FEATURE_SCENARIOS_PAGE_PATH + "/feature_";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.trivago.cluecumber.json.pojo;

import com.google.gson.annotations.SerializedName;
import com.trivago.cluecumber.rendering.RenderingUtils;
import com.trivago.cluecumber.rendering.pages.renderering.RenderingUtils;

public class DocString {
@SerializedName("content_type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import com.google.gson.annotations.SerializedName;
import com.trivago.cluecumber.constants.Status;
import com.trivago.cluecumber.rendering.RenderingUtils;
import com.trivago.cluecumber.rendering.pages.renderering.RenderingUtils;

import java.time.ZonedDateTime;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import com.google.gson.annotations.SerializedName;
import com.trivago.cluecumber.constants.Status;
import com.trivago.cluecumber.rendering.RenderingUtils;
import com.trivago.cluecumber.rendering.pages.renderering.RenderingUtils;

public class Result {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.trivago.cluecumber.json.pojo;

import com.google.gson.annotations.SerializedName;
import com.trivago.cluecumber.rendering.RenderingUtils;
import com.trivago.cluecumber.rendering.pages.renderering.RenderingUtils;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.trivago.cluecumber.json.pojo;

import com.trivago.cluecumber.rendering.RenderingUtils;
import com.trivago.cluecumber.rendering.pages.renderering.RenderingUtils;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,26 @@ public void validateSettings() throws CluecumberPluginException {
}

public void logProperties() {
logger.info("- source JSON report directory : " + sourceJsonReportDirectory);
logger.info("- generated HTML report directory : " + generatedHtmlReportDirectory);
logger.info("- source JSON report directory : " + sourceJsonReportDirectory);
logger.info("- generated HTML report directory : " + generatedHtmlReportDirectory);

if (customParameters != null && !customParameters.isEmpty()) {
logger.logSeparator();
for (Map.Entry<String, String> entry : customParameters.entrySet()) {
logger.info("- custom parameter : " +
logger.info("- custom parameter : " +
entry.getKey() + " -> " + entry.getValue());
}
}

logger.logSeparator();

logger.info("- fail scenarios with pending/undefined steps : " + failScenariosOnPendingOrUndefinedSteps);
logger.info("- expand before/after hooks : " + expandBeforeAfterHooks);
logger.info("- expand step hooks : " + expandStepHooks);
logger.info("- expand doc strings : " + expandDocStrings);
logger.info("- fail pending/undefined scenarios : " + failScenariosOnPendingOrUndefinedSteps);
logger.info("- expand before/after hooks : " + expandBeforeAfterHooks);
logger.info("- expand step hooks : " + expandStepHooks);
logger.info("- expand doc strings : " + expandDocStrings);

if (customCss != null && !customCss.isEmpty()) {
logger.info("- custom CSS : " + customCss);
logger.info("- custom CSS : " + customCss);
}

logger.logSeparator();
Expand Down
Loading

0 comments on commit 0ed5898

Please sign in to comment.