Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cucumber reporting - New Generation UI #923

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6981d55
update
fslevoaca-ionos Sep 28, 2019
52d683f
Merge branch 'master' into 4.10.0
fslevoaca-ionos Sep 28, 2019
ce29fa0
[maven-release-plugin] prepare release cucumber-reporting-extended-4.…
fslevoaca-ionos Sep 28, 2019
de1b027
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Sep 28, 2019
0ea4287
Merge branch 'master' into 4.10.0
fslevoaca-ionos Sep 28, 2019
d93f9ff
Merge branch 'master' into 4.10.0
fslevoaca-ionos Sep 28, 2019
83ac634
[maven-release-plugin] prepare release cucumber-reporting-extended-4.…
fslevoaca-ionos Sep 28, 2019
9a6b131
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Sep 28, 2019
6d12c28
Merge tag 'cucumber-reporting-4.11.1' of github.com:damianszczepanik/…
fslevoaca-ionos Oct 22, 2019
be0f9b7
fix banned dependency
fslevoaca-ionos Oct 22, 2019
fbf16af
decrease jackson dependencies
fslevoaca-ionos Oct 22, 2019
023e8dc
prepare
fslevoaca-ionos Oct 22, 2019
d9d2c84
[maven-release-plugin] prepare release cucumber-reporting-extended-4.…
fslevoaca-ionos Oct 22, 2019
d923a42
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Oct 22, 2019
8919bb3
Merge remote-tracking branch 'remotes/origin/cucumber-reporting-5'
fslevoaca-ionos Dec 18, 2019
f0c3366
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.0
fslevoaca-ionos Dec 18, 2019
f6ec8e6
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Dec 18, 2019
622eb2a
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.1
fslevoaca-ionos Dec 18, 2019
2ed0f0f
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Dec 18, 2019
5d99542
Merge branch '5.0.2'
fslevoaca-ionos Feb 8, 2020
23f5f82
add URI support
fslevoaca-ionos Feb 8, 2020
b2e3167
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.2
fslevoaca-ionos Feb 8, 2020
2272cc5
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Feb 8, 2020
f6a13c6
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.3
fslevoaca-ionos Feb 8, 2020
60e6816
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Feb 8, 2020
261dec7
re-style
fslevoaca-ionos Feb 8, 2020
f8297f4
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.4
fslevoaca-ionos Feb 8, 2020
aae8776
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Feb 8, 2020
7872cd1
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.5
fslevoaca-ionos Feb 8, 2020
169a1bd
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Feb 8, 2020
71de68b
refactoring
fslevoaca-ionos Feb 8, 2020
ecefdde
[maven-release-plugin] prepare release cucumber-reporting-extended-5.0.6
fslevoaca-ionos Feb 8, 2020
4f03e20
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Feb 8, 2020
c8c5860
Merge tag 'cucumber-reporting-5.1.1'
fslevoaca-ionos Apr 9, 2020
7ec3471
New UI style
fslevoaca-ionos Apr 12, 2020
062c6c2
refactor
fslevoaca-ionos Apr 12, 2020
e6b57a5
[maven-release-plugin] prepare release cucumber-reporting-extended-5.1.1
fslevoaca-ionos Apr 12, 2020
8c3ba97
[maven-release-plugin] prepare for next development iteration
fslevoaca-ionos Apr 12, 2020
9b6ccb5
cleanup
fslevoaca-ionos Apr 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 20 additions & 66 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<packaging>jar</packaging>
<version>5.1.1</version>
<version>5.1.2-SNAPSHOT</version>
<name>cucumber-reporting</name>
<url>https://github.com/damianszczepanik/cucumber-reporting</url>

Expand All @@ -12,39 +12,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<maven.compile.encoding>UTF-8</maven.compile.encoding>

<powermock.version>1.7.0</powermock.version>

<test.integration.pattern>**/*IntegrationTest*.java</test.integration.pattern>
</properties>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<scm>
<connection>scm:git:[email protected]:damianszczepanik/cucumber-reporting.git</connection>
<developerConnection>scm:git:[email protected]:damianszczepanik/cucumber-reporting.git</developerConnection>
<url>[email protected]:damianszczepanik/cucumber-reporting.git</url>
</scm>
<ciManagement>
<system>travis</system>
<url>https://travis-ci.org/damianszczepanik/cucumber-reporting</url>
</ciManagement>

<description>
Provides pretty html reports for Cucumber. It works by generating html from the cucumber json file.
</description>
Expand Down Expand Up @@ -85,26 +56,6 @@
<gpg.keyname>0738FA8F</gpg.keyname>
<release.username>Damian Szczepanik</release.username>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</profile>
</profiles>

Expand Down Expand Up @@ -135,20 +86,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand All @@ -168,10 +105,27 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
<doclint>none</doclint>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<version>2.22.1</version>
<configuration>
<systemPropertyVariables>
<!-- JaCoCo runtime must know where to dump coverage: -->
Expand All @@ -186,7 +140,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.20</version>
<version>2.22.1</version>
<configuration>
<includes>
<!-- Run only integration tests -->
Expand Down
77 changes: 32 additions & 45 deletions src/main/java/net/masterthought/cucumber/ReportBuilder.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
package net.masterthought.cucumber;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.commons.io.FileUtils;

import net.masterthought.cucumber.generators.ErrorPage;
import net.masterthought.cucumber.generators.FailuresOverviewPage;
import net.masterthought.cucumber.generators.FeatureReportPage;
import net.masterthought.cucumber.generators.FeaturesOverviewPage;
import net.masterthought.cucumber.generators.StepsOverviewPage;
import net.masterthought.cucumber.generators.TagReportPage;
import net.masterthought.cucumber.generators.TagsOverviewPage;
import net.masterthought.cucumber.generators.TrendsOverviewPage;
import net.masterthought.cucumber.generators.*;
import net.masterthought.cucumber.json.Feature;
import net.masterthought.cucumber.json.support.TagObject;
import org.apache.commons.io.FileUtils;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ReportBuilder {

Expand Down Expand Up @@ -69,6 +54,7 @@ public ReportBuilder(List<String> jsonFiles, Configuration configuration) {
/**
* Parses provided files and generates the report. When generating process fails
* report with information about error is provided.
*
* @return stats for the generated report
*/
public Reportable generateReports() {
Expand Down Expand Up @@ -124,7 +110,8 @@ private void copyStaticResources() {
"fontawesome-webfont.eot", "fontawesome-webfont.ttf", "fontawesome-webfont.woff2",
"glyphicons-halflings-regular.eot", "glyphicons-halflings-regular.eot",
"glyphicons-halflings-regular.woff2", "glyphicons-halflings-regular.woff",
"glyphicons-halflings-regular.ttf", "glyphicons-halflings-regular.svg");
"glyphicons-halflings-regular.ttf", "glyphicons-halflings-regular.svg", "HarmoniaSans.ttf", "HarmoniaSans.otf",
"Inter-UI-Regular.woff2", "Inter-UI-Regular.woff", "Inter-UI-Medium.woff", "Inter-UI-Medium.woff2");
copyResources("images", "favicon.png");
}

Expand All @@ -147,27 +134,27 @@ private void copyResources(String resourceLocation, String... resources) {
}
}

private void generatePages(Trends trends) {
new FeaturesOverviewPage(reportResult, configuration).generatePage();
for (Feature feature : reportResult.getAllFeatures()) {
new FeatureReportPage(reportResult, configuration, feature).generatePage();
}
new TagsOverviewPage(reportResult, configuration).generatePage();
for (TagObject tagObject : reportResult.getAllTags()) {
new TagReportPage(reportResult, configuration, tagObject).generatePage();
}

new StepsOverviewPage(reportResult, configuration).generatePage();
new FailuresOverviewPage(reportResult, configuration).generatePage();

if (configuration.isTrendsAvailable()) {
new TrendsOverviewPage(reportResult, configuration, trends).generatePage();
}
}
private void generatePages(Trends trends) {
new FeaturesOverviewPage(reportResult, configuration).generatePage();

for (Feature feature : reportResult.getAllFeatures()) {
new FeatureReportPage(reportResult, configuration, feature).generatePage();
}

new TagsOverviewPage(reportResult, configuration).generatePage();

for (TagObject tagObject : reportResult.getAllTags()) {
new TagReportPage(reportResult, configuration, tagObject).generatePage();
}

new StepsOverviewPage(reportResult, configuration).generatePage();
new FailuresOverviewPage(reportResult, configuration).generatePage();

if (configuration.isTrendsAvailable()) {
new TrendsOverviewPage(reportResult, configuration, trends).generatePage();
}
}

private Trends updateAndSaveTrends(Reportable reportable) {
Trends trends = loadOrCreateTrends();
appendToTrends(trends, reportable);
Expand Down
25 changes: 13 additions & 12 deletions src/main/java/net/masterthought/cucumber/ReportParser.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
package net.masterthought.cucumber;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import net.masterthought.cucumber.json.Feature;
import net.masterthought.cucumber.reducers.ReducingMethod;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ArrayUtils;
import static org.apache.commons.collections.CollectionUtils.isNotEmpty;

import java.io.*;
import java.nio.charset.StandardCharsets;
Expand All @@ -21,7 +11,18 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.InjectableValues;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ArrayUtils;

import net.masterthought.cucumber.json.Feature;
import net.masterthought.cucumber.reducers.ReducingMethod;

/**
* @author Damian Szczepanik (damianszczepanik@github)
Expand Down
64 changes: 48 additions & 16 deletions src/main/java/net/masterthought/cucumber/Reportable.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,83 @@
*/
public interface Reportable {

/** Returns name of the element that will be displayed to user. */
/**
* Returns name of the element that will be displayed to user.
*/
String getName();

/** Returns number of features for this element. */
/**
* Returns number of features for this element.
*/
int getFeatures();

/** Returns number of passed features for this element. */
/**
* Returns number of passed features for this element.
*/
int getPassedFeatures();

/** Returns number of failed features for this element. */
/**
* Returns number of failed features for this element.
*/
int getFailedFeatures();

/** Returns number of scenarios for this element. */
/**
* Returns number of scenarios for this element.
*/
int getScenarios();

/** Returns number of passed scenarios for this element. */
/**
* Returns number of passed scenarios for this element.
*/
int getPassedScenarios();

/** Returns number of failed scenarios for this element. */
/**
* Returns number of failed scenarios for this element.
*/
int getFailedScenarios();

/** Returns number of all steps for this element. */
/**
* Returns number of all steps for this element.
*/
int getSteps();

/** Returns number of passed steps for this element. */
/**
* Returns number of passed steps for this element.
*/
int getPassedSteps();

/** Returns number of failed steps for this element. */
/**
* Returns number of failed steps for this element.
*/
int getFailedSteps();

/** Returns number of skipped steps for this element. */
/**
* Returns number of skipped steps for this element.
*/
int getSkippedSteps();

/** Returns number of undefined steps for this element. */
/**
* Returns number of undefined steps for this element.
*/
int getUndefinedSteps();

/** Returns number of pending steps for this element. */
/**
* Returns number of pending steps for this element.
*/
int getPendingSteps();

/** Returns duration as milliseconds for this element. */
/**
* Returns duration as milliseconds for this element.
*/
long getDuration();

/** Returns formatted duration for this element. */
/**
* Returns formatted duration for this element.
*/
String getFormattedDuration();

/** Returns status for this element. */
/**
* Returns status for this element.
*/
Status getStatus();
}
Loading