├── commons-reporting-handlebars ├── .gitignore ├── README.md └── src │ ├── test │ └── java │ │ └── com │ │ └── github │ │ └── bogdanlivadariu │ │ └── reporting │ │ └── commons │ │ └── ResourceUtilTest.java │ └── main │ └── java │ └── com │ └── github │ └── bogdanlivadariu │ └── reporting │ └── commons │ └── ResourceUtil.java ├── testng-reporting-handlebars ├── README.md ├── src │ ├── main │ │ ├── resources │ │ │ └── testng-reporting │ │ │ │ ├── footer.hbs │ │ │ │ ├── analitics.hbs │ │ │ │ ├── scrollTopScript.hbs │ │ │ │ ├── menu.hbs │ │ │ │ ├── highchartsScripts.hbs │ │ │ │ ├── style.hbs │ │ │ │ ├── requiredScripts.hbs │ │ │ │ ├── testsByNameOverview.hbs │ │ │ │ └── testsByClassOverview.hbs │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── bogdanlivadariu │ │ │ └── reporting │ │ │ └── testng │ │ │ ├── xml │ │ │ └── models │ │ │ │ ├── ParamModel.java │ │ │ │ ├── MessageModel.java │ │ │ │ ├── LineModel.java │ │ │ │ ├── FullStacktraceModel.java │ │ │ │ ├── ParamsModel.java │ │ │ │ ├── MethodModel.java │ │ │ │ ├── ReporterOutputModel.java │ │ │ │ ├── ExceptionModel.java │ │ │ │ ├── GroupModel.java │ │ │ │ ├── TestModel.java │ │ │ │ ├── TestMethodModel.java │ │ │ │ ├── TestngResultsModel.java │ │ │ │ ├── ClassModel.java │ │ │ │ └── SuiteModel.java │ │ │ ├── helpers │ │ │ ├── Constants.java │ │ │ ├── StringUtils.java │ │ │ └── Helpers.java │ │ │ ├── cli │ │ │ └── TestNgReportBuilderCli.java │ │ │ └── builder │ │ │ └── AllTestNgReports.java │ └── test │ │ └── java │ │ └── com │ │ └── github │ │ └── bogdanlivadariu │ │ └── reporting │ │ └── testng │ │ ├── TestNgReportBuilderTest.java │ │ └── AllTestNgReportsTest.java └── pom.xml ├── .mvn ├── maven.config └── extensions.xml ├── .github ├── CODEOWNERS ├── release-drafter.yml ├── dependabot.yml └── workflows │ ├── release-drafter.yml │ └── jenkins-security-scan.yml ├── Jenkinsfile ├── bootstraped-multi-test-results-report ├── src │ └── main │ │ ├── webapp │ │ ├── junit.png │ │ ├── rspec.png │ │ ├── testng.png │ │ └── cucumber.png │ │ ├── resources │ │ ├── index.jelly │ │ └── com │ │ │ └── github │ │ │ └── bogdanlivadariu │ │ │ └── jenkins │ │ │ └── reporting │ │ │ ├── junit │ │ │ └── JUnitTestReportPublisher │ │ │ │ └── config.jelly │ │ │ ├── rspec │ │ │ └── RSpecTestReportPublisher │ │ │ │ └── config.jelly │ │ │ ├── testng │ │ │ └── TestNGTestReportPublisher │ │ │ │ └── config.jelly │ │ │ └── cucumber │ │ │ └── CucumberTestReportPublisher │ │ │ └── config.jelly │ │ └── java │ │ └── com │ │ └── github │ │ └── bogdanlivadariu │ │ └── jenkins │ │ └── reporting │ │ ├── rspec │ │ ├── RSpecTestReportBuildStepDescriptor.java │ │ ├── RSpecTestReportBaseAction.java │ │ └── RSpecTestReportProjectAction.java │ │ ├── junit │ │ ├── JUnitTestReportBuildStepDescriptor.java │ │ ├── JUnitTestReportBaseAction.java │ │ └── JUnitTestReportProjectAction.java │ │ ├── testng │ │ ├── TestNGTestReportBuildStepDescriptor.java │ │ ├── TestNGTestReportBaseAction.java │ │ └── TestNGTestReportProjectAction.java │ │ ├── cucumber │ │ ├── CucumberTestReportBuildStepDescriptor.java │ │ ├── CucumberTestReportBaseAction.java │ │ └── CucumberTestReportProjectAction.java │ │ ├── SafeArchiveServingRunAction.java │ │ └── Helper.java └── LICENSE ├── junit-reporting-handlebars ├── src │ ├── main │ │ ├── resources │ │ │ └── junit-reporting │ │ │ │ ├── footer.hbs │ │ │ │ ├── analitics.hbs │ │ │ │ ├── scrollTopScript.hbs │ │ │ │ ├── menu.hbs │ │ │ │ ├── highchartsScripts.hbs │ │ │ │ ├── style.hbs │ │ │ │ ├── requiredScripts.hbs │ │ │ │ ├── testOverviewReport.hbs │ │ │ │ └── testCaseSummaryReport.hbs │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── bogdanlivadariu │ │ │ └── reporting │ │ │ └── junit │ │ │ ├── helpers │ │ │ ├── Constants.java │ │ │ └── Helpers.java │ │ │ ├── xml │ │ │ └── models │ │ │ │ ├── PropertyModel.java │ │ │ │ ├── BaseModel.java │ │ │ │ ├── TestCaseModel.java │ │ │ │ └── TestSuitesModel.java │ │ │ └── builder │ │ │ └── AllJUnitReports.java │ └── test │ │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── bogdanlivadariu │ │ │ └── reporting │ │ │ └── junit │ │ │ └── builder │ │ │ ├── AllJunitReportsTest.java │ │ │ ├── AllJunitReportsWithSuitesTest.java │ │ │ ├── JUnitReportBuilderTest.java │ │ │ └── HelperTest.java │ │ └── resources │ │ └── valid-report-2.xml ├── LICENSE └── pom.xml ├── rspec-reporting-handlebars ├── src │ └── main │ │ ├── resources │ │ └── rspec-reporting │ │ │ ├── footer.hbs │ │ │ ├── analitics.hbs │ │ │ ├── scrollTopScript.hbs │ │ │ ├── menu.hbs │ │ │ ├── highchartsScripts.hbs │ │ │ ├── style.hbs │ │ │ ├── requiredScripts.hbs │ │ │ ├── testOverviewReport.hbs │ │ │ └── testCaseSummaryReport.hbs │ │ └── java │ │ └── com │ │ └── github │ │ └── bogdanlivadariu │ │ └── reporting │ │ └── rspec │ │ ├── helpers │ │ ├── Constants.java │ │ └── Helpers.java │ │ ├── xml │ │ └── models │ │ │ ├── PropertyModel.java │ │ │ ├── BaseModel.java │ │ │ ├── TestCaseModel.java │ │ │ ├── TestSuitesModel.java │ │ │ └── TestSuiteModel.java │ │ └── builder │ │ └── AllRSpecJUnitReports.java ├── LICENSE └── pom.xml ├── cucumber-reporting-handlebars ├── src │ ├── main │ │ ├── resources │ │ │ └── cucumber-reporting │ │ │ │ ├── footer.hbs │ │ │ │ ├── analitics.hbs │ │ │ │ ├── scrollTopScript.hbs │ │ │ │ ├── menu.hbs │ │ │ │ ├── highchartsScripts.hbs │ │ │ │ ├── style.hbs │ │ │ │ ├── highchartsOverviewScripts.hbs │ │ │ │ └── requiredScripts.hbs │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── bogdanlivadariu │ │ │ └── reporting │ │ │ └── cucumber │ │ │ ├── json │ │ │ └── models │ │ │ │ ├── StepRow.java │ │ │ │ ├── StepArgument.java │ │ │ │ ├── Row.java │ │ │ │ ├── Argument.java │ │ │ │ ├── Match.java │ │ │ │ ├── Tag.java │ │ │ │ ├── Embedding.java │ │ │ │ ├── Result.java │ │ │ │ ├── DocString.java │ │ │ │ ├── Step.java │ │ │ │ └── Feature.java │ │ │ ├── helpers │ │ │ ├── SpecialProperties.java │ │ │ └── Constants.java │ │ │ └── builder │ │ │ └── AllFeatureReports.java │ └── test │ │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── bogdanlivadariu │ │ │ └── reporting │ │ │ └── cucumber │ │ │ └── builder │ │ │ └── CucumberJsTest.java │ │ └── resources │ │ └── cucumber-js.json ├── README.md ├── LICENSE └── pom.xml ├── .gitignore ├── LICENSE ├── README.md └── pom.xml /commons-reporting-handlebars/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/README.md: -------------------------------------------------------------------------------- 1 | # testng-reporting-handlebars 2 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Pconsume-incrementals 2 | -Pmight-produce-incrementals 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @jenkinsci/bootstraped-multi-test-results-report-plugin-developers 2 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | _extends: .github 2 | tag-template: bootstraped-multi-test-results-report-$NEXT_MINOR_VERSION 3 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | buildPlugin(useContainerAgent: true, configurations: [ 2 | [platform: 'linux', jdk: '11'], 3 | [platform: 'linux', jdk: '17'] 4 | ]) 5 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/webapp/junit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/bootstraped-multi-test-results-report-plugin/HEAD/bootstraped-multi-test-results-report/src/main/webapp/junit.png -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/webapp/rspec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/bootstraped-multi-test-results-report-plugin/HEAD/bootstraped-multi-test-results-report/src/main/webapp/rspec.png -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/webapp/testng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/bootstraped-multi-test-results-report-plugin/HEAD/bootstraped-multi-test-results-report/src/main/webapp/testng.png -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/webapp/cucumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkinsci/bootstraped-multi-test-results-report-plugin/HEAD/bootstraped-multi-test-results-report/src/main/webapp/cucumber.png -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/resources/index.jelly: -------------------------------------------------------------------------------- 1 | 2 |
3 |

This plugin generates HTML reports using handlebars templates with bootstrap components.

4 |
5 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/footer.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/footer.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/footer.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/footer.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/README.md: -------------------------------------------------------------------------------- 1 | # cucumber reporting with bootstrap components and handlebars as template engine 2 | 3 | This is a module to generate cucumber html reports from cucumber.json files, 4 | using handlebars to compute the HTML, and bootstrap components to render the HTML content. 5 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/StepRow.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | public class StepRow { 4 | private String[] cells; 5 | 6 | public String[] getCells() { 7 | return cells; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/StepArgument.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | public class StepArgument { 4 | private StepRow[] rows; 5 | 6 | public StepRow[] getRows() { 7 | return rows; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /commons-reporting-handlebars/README.md: -------------------------------------------------------------------------------- 1 | # Commons reporting handlebars 2 | 3 | ## This is a helper module, used across all report builders, that contains utilities & sources that helps generate the desired reports. 4 | 5 | ## In this module there will be present the resources for jQuery, Bootstrap, etc; resources that will get unzipped & copied in each report folder for every type of report. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .log 3 | .idea 4 | /target/ 5 | .classpath 6 | .project 7 | .settings/* 8 | *.html 9 | bootstraped-multi-test-results-report/target/ 10 | rspec-reporting-handlebars/target/ 11 | testng-reporting-handlebars/target/ 12 | junit-reporting-handlebars/target/ 13 | cucumber-reporting-handlebars/target/ 14 | *.prefs 15 | commons-reporting-handlebars/src/main/resources/web/ 16 | *.iml 17 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Row.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | public class Row { 4 | 5 | private String[] cells; 6 | 7 | private Integer line; 8 | 9 | public Integer getLine() { 10 | return line; 11 | } 12 | 13 | public String[] getCells() { 14 | return cells; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Argument.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | public class Argument { 4 | 5 | private String val; 6 | 7 | private Integer offset = 0; 8 | 9 | public String getVal() { 10 | return val; 11 | } 12 | 13 | public Integer getOffset() { 14 | return offset; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.jenkins.tools.incrementals 4 | git-changelist-maven-extension 5 | 1.6 6 | 7 | 8 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Match.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | public class Match { 4 | 5 | private String location; 6 | 7 | private Argument[] arguments; 8 | 9 | public String getLocation() { 10 | return location; 11 | } 12 | 13 | public Argument[] getArguments() { 14 | return arguments; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/analitics.hbs: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/analitics.hbs: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/analitics.hbs: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/analitics.hbs: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Tag.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | /** 4 | * Represents a tag for a {@link Feature} or {@link Element} 5 | */ 6 | public class Tag { 7 | 8 | private String name; 9 | 10 | private Integer line; 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public Integer getLine() { 17 | return line; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Embedding.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | /** 4 | * Represents an attachment/embedding of a step. 5 | */ 6 | public class Embedding { 7 | 8 | private String mimeType; 9 | 10 | private String data; 11 | 12 | public String getMimeType() { 13 | return mimeType; 14 | } 15 | 16 | public String getData() { 17 | return data; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/helpers/Constants.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.helpers; 2 | 3 | public class Constants { 4 | public static final String PASSED = "passed"; 5 | 6 | public static final String FAILED = "failed"; 7 | 8 | public static final String ERRORED = "errored"; 9 | 10 | public static final String SKIPPED = "skipped"; 11 | 12 | public static final String UNDEFINED = "undefined"; 13 | 14 | private Constants() {} 15 | } 16 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/helpers/Constants.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.helpers; 2 | 3 | public class Constants { 4 | public static final String PASSED = "passed"; 5 | 6 | public static final String FAILED = "failed"; 7 | 8 | public static final String ERRORED = "errored"; 9 | 10 | protected static final String SKIPPED = "skipped"; 11 | 12 | public static final String UNDEFINED = "undefined"; 13 | 14 | private Constants() {} 15 | } 16 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/ParamModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | 7 | @JacksonXmlRootElement(localName = "param") 8 | public class ParamModel { 9 | @JacksonXmlProperty 10 | private String index; 11 | 12 | @JacksonXmlProperty 13 | private String value; 14 | } 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: maven 6 | directory: / 7 | schedule: 8 | interval: monthly 9 | ignore: 10 | # Must be updated together with jakarta.xml.bind:jakarta.xml.bind-api 11 | - dependency-name: com.sun.xml.bind:jaxb-impl 12 | versions: [">=4.0.1"] 13 | - package-ecosystem: github-actions 14 | directory: / 15 | schedule: 16 | interval: monthly 17 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | # Automates creation of Release Drafts using Release Drafter 2 | # More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc 3 | 4 | on: 5 | push: 6 | branches: 7 | - master 8 | 9 | jobs: 10 | update_release_draft: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # Drafts your next Release notes as Pull Requests are merged into the default branch 14 | - uses: release-drafter/release-drafter@v5 15 | env: 16 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 17 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/MessageModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; 5 | 6 | @JacksonXmlRootElement(localName = "message") 7 | public class MessageModel { 8 | 9 | @JacksonXmlText 10 | private String value; 11 | 12 | public String getValue() { 13 | return value; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/LineModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; 5 | 6 | @JacksonXmlRootElement(localName = "line") 7 | public class LineModel { 8 | @JacksonXmlText 9 | private String value; 10 | 11 | public String getValue() { 12 | return value.replaceAll("\n", "").trim(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/FullStacktraceModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; 5 | 6 | @JacksonXmlRootElement(localName = "full-stacktrace") 7 | public class FullStacktraceModel { 8 | 9 | @JacksonXmlText 10 | private String value; 11 | 12 | public String getValue() { 13 | return value; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/helpers/Constants.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.helpers; 2 | 3 | import org.testng.reporters.XMLReporterConfig; 4 | 5 | public class Constants { 6 | public static final String SKIPPED = XMLReporterConfig.TEST_SKIPPED; 7 | 8 | public static final String PASSED = XMLReporterConfig.TEST_PASSED; 9 | 10 | public static final String FAILED = XMLReporterConfig.TEST_FAILED; 11 | 12 | public static final String UNDEFINED = "UNDEFINED"; 13 | 14 | private Constants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/xml/models/PropertyModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.xml.models; 2 | 3 | import jakarta.xml.bind.annotation.*; 4 | 5 | @XmlRootElement(name = "property") 6 | @XmlAccessorType(XmlAccessType.FIELD) 7 | public class PropertyModel 8 | { 9 | @XmlAttribute 10 | private String name; 11 | 12 | @XmlAttribute 13 | private String value; 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public String getValue() { 20 | return value; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/scrollTopScript.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/scrollTopScript.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/scrollTopScript.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/scrollTopScript.hbs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Result.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | /** 4 | * Represents the result of a {@link Step} 5 | */ 6 | public class Result { 7 | 8 | private long duration; 9 | 10 | private String status; 11 | 12 | private String errorMessage; 13 | 14 | public long getDuration() { 15 | return duration; 16 | } 17 | 18 | public String getStatus() { 19 | return status; 20 | } 21 | 22 | public String getErrorMessage() { 23 | return errorMessage; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/helpers/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.helpers; 2 | 3 | import java.math.BigInteger; 4 | import java.nio.charset.StandardCharsets; 5 | import java.security.MessageDigest; 6 | import java.security.NoSuchAlgorithmException; 7 | 8 | public class StringUtils { 9 | public static String getMd5From(String source) throws NoSuchAlgorithmException { 10 | MessageDigest md5 = MessageDigest.getInstance("MD5"); 11 | md5.update(StandardCharsets.UTF_8.encode(source)); 12 | return String.format("%032x", new BigInteger(1, md5.digest())); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/rspec/RSpecTestReportBuildStepDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.rspec; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.tasks.BuildStepDescriptor; 5 | import hudson.tasks.Publisher; 6 | 7 | public class RSpecTestReportBuildStepDescriptor extends BuildStepDescriptor { 8 | 9 | @Override 10 | public String getDisplayName() { 11 | return "Publish RSpec reports generated with handlebars"; 12 | } 13 | 14 | @Override public boolean isApplicable(Class aClass) { 15 | return true; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/junit/JUnitTestReportBuildStepDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.junit; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.tasks.BuildStepDescriptor; 5 | import hudson.tasks.Publisher; 6 | 7 | public class JUnitTestReportBuildStepDescriptor extends BuildStepDescriptor { 8 | 9 | @Override 10 | public String getDisplayName() { 11 | return "Publish JUnit reports generated with handlebars"; 12 | } 13 | 14 | @Override public boolean isApplicable(Class aClass) { 15 | return true; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/xml/models/PropertyModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 4 | 5 | //@XmlRootElement(name = "property") 6 | //@XmlAccessorType(XmlAccessType.FIELD) 7 | @JacksonXmlRootElement(localName = "property") 8 | public class PropertyModel { 9 | // @XmlAttribute 10 | private String name; 11 | 12 | // @XmlAttribute 13 | private String value; 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public String getValue() { 20 | return value; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/menu.hbs: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/testng/TestNGTestReportBuildStepDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.testng; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.tasks.BuildStepDescriptor; 5 | import hudson.tasks.Publisher; 6 | 7 | public class TestNGTestReportBuildStepDescriptor extends BuildStepDescriptor { 8 | 9 | @Override 10 | public String getDisplayName() { 11 | return "Publish TestNG reports generated with handlebars"; 12 | } 13 | 14 | @Override 15 | public boolean isApplicable(Class jobType) { 16 | return true; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/cucumber/CucumberTestReportBuildStepDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.cucumber; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.tasks.BuildStepDescriptor; 5 | import hudson.tasks.Publisher; 6 | 7 | public class CucumberTestReportBuildStepDescriptor extends BuildStepDescriptor { 8 | 9 | @Override 10 | public String getDisplayName() { 11 | return "Publish Cucumber reports generated with handlebars"; 12 | } 13 | 14 | @Override 15 | public boolean isApplicable(Class jobType) { 16 | return true; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/DocString.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | import com.google.gson.GsonBuilder; 4 | 5 | import static com.google.gson.JsonParser.parseString; 6 | 7 | public class DocString { 8 | 9 | private String value; 10 | 11 | private String contentType; 12 | 13 | private Integer line; 14 | 15 | public String getValue() { 16 | return new GsonBuilder().setPrettyPrinting().create().toJson(parseString(value)); 17 | } 18 | 19 | public String getContentType() { 20 | return contentType; 21 | } 22 | 23 | public Integer getLine() { 24 | return line; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/ParamsModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | 7 | import java.util.List; 8 | 9 | @JacksonXmlRootElement(localName = "params") 10 | public class ParamsModel { 11 | @JacksonXmlElementWrapper(localName = "param", useWrapping = false) 12 | @JacksonXmlProperty(localName = "param") 13 | private List params; 14 | 15 | public List getParams() { 16 | return params; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/menu.hbs: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/menu.hbs: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /.github/workflows/jenkins-security-scan.yml: -------------------------------------------------------------------------------- 1 | # More information about the Jenkins security scan can be found at the developer docs: https://www.jenkins.io/redirect/jenkins-security-scan/ 2 | 3 | name: Jenkins Security Scan 4 | on: 5 | push: 6 | branches: 7 | - "master" 8 | pull_request: 9 | types: [ opened, synchronize, reopened ] 10 | workflow_dispatch: 11 | 12 | permissions: 13 | security-events: write 14 | contents: read 15 | actions: read 16 | 17 | jobs: 18 | security-scan: 19 | uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2 20 | with: 21 | java-cache: 'maven' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate. 22 | java-version: 11 # What version of Java to set up for the build. 23 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/MethodModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 5 | 6 | @JacksonXmlRootElement(localName = "method") 7 | public class MethodModel { 8 | private String signature; 9 | 10 | private String name; 11 | 12 | @JacksonXmlProperty(localName = "class") 13 | private String clazz; 14 | 15 | public String getSignature() { 16 | return signature; 17 | } 18 | 19 | public String getName() { 20 | return name; 21 | } 22 | 23 | public String getClazz() { 24 | return clazz; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/junit/JUnitTestReportBaseAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.junit; 2 | 3 | import com.github.bogdanlivadariu.reporting.junit.builder.JUnitReportBuilder; 4 | import hudson.model.Action; 5 | 6 | public abstract class JUnitTestReportBaseAction implements Action { 7 | protected static final String DISPLAY_NAME = "View JUnit Reports"; 8 | 9 | protected static final String ICON_LOCATON = "/plugin/bootstraped-multi-test-results-report/junit.png"; 10 | 11 | public String getUrlName() { 12 | return JUnitReportBuilder.SUITE_OVERVIEW; 13 | } 14 | 15 | public String getDisplayName() { 16 | return DISPLAY_NAME; 17 | } 18 | 19 | public String getIconFileName() { 20 | return ICON_LOCATON; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/rspec/RSpecTestReportBaseAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.rspec; 2 | 3 | import com.github.bogdanlivadariu.reporting.rspec.builder.RSpecReportBuilder; 4 | import hudson.model.Action; 5 | 6 | public abstract class RSpecTestReportBaseAction implements Action { 7 | protected static final String DISPLAY_NAME = "View RSpec Reports"; 8 | 9 | protected static final String ICON_LOCATON = "/plugin/bootstraped-multi-test-results-report/rspec.png"; 10 | 11 | public String getUrlName() { 12 | return RSpecReportBuilder.SUITES_OVERVIEW; 13 | } 14 | 15 | public String getDisplayName() { 16 | return DISPLAY_NAME; 17 | } 18 | 19 | public String getIconFileName() { 20 | return ICON_LOCATON; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/helpers/SpecialProperties.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.helpers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class SpecialProperties { 7 | 8 | public enum SpecialKeyProperties { 9 | IGNORE_UNDEFINED_STEPS 10 | } 11 | 12 | private Map specialProperties = 13 | new HashMap<>(); 14 | 15 | public Map getProperties() { 16 | return specialProperties; 17 | } 18 | 19 | public boolean getPropertyValue(SpecialKeyProperties key) { 20 | try { 21 | return getProperties().get(key); 22 | } catch (NullPointerException e) { 23 | return false; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/ReporterOutputModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @JacksonXmlRootElement(localName = "reporter-output") 11 | public class ReporterOutputModel { 12 | @JacksonXmlElementWrapper(localName = "line", useWrapping = false) 13 | @JacksonXmlProperty(localName = "line") 14 | private final List lines = new ArrayList<>(); 15 | 16 | public List getLines() { 17 | return lines; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/xml/models/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.xml.models; 2 | 3 | import jakarta.xml.bind.annotation.*; 4 | 5 | @XmlAccessorType(XmlAccessType.FIELD) 6 | public class BaseModel { 7 | @XmlAttribute 8 | private String message; 9 | 10 | @XmlAttribute 11 | private String type; 12 | 13 | @XmlValue 14 | private String value; 15 | 16 | public String getMessage() { 17 | return message; 18 | } 19 | 20 | public String getType() { 21 | return type; 22 | } 23 | 24 | public String getValue() { 25 | return value; 26 | } 27 | 28 | @XmlRootElement(name = "error") 29 | public static class ErrorModel {} 30 | 31 | @XmlRootElement(name = "failure") 32 | public static class FailureModel {} 33 | } 34 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/cucumber/CucumberTestReportBaseAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.cucumber; 2 | 3 | import com.github.bogdanlivadariu.reporting.cucumber.builder.CucumberReportBuilder; 4 | import hudson.model.Action; 5 | 6 | public abstract class CucumberTestReportBaseAction implements Action { 7 | protected static final String DISPLAY_NAME = "View Cucumber Reports"; 8 | 9 | protected static final String ICON_LOCATON = "/plugin/bootstraped-multi-test-results-report/cucumber.png"; 10 | 11 | public String getUrlName() { 12 | return CucumberReportBuilder.FEATURES_OVERVIEW_HTML; 13 | } 14 | 15 | public String getDisplayName() { 16 | return DISPLAY_NAME; 17 | } 18 | 19 | public String getIconFileName() { 20 | return ICON_LOCATON; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/testng/TestNGTestReportBaseAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.testng; 2 | 3 | import com.github.bogdanlivadariu.reporting.testng.builder.TestNgReportBuilder; 4 | import hudson.model.Action; 5 | 6 | public abstract class TestNGTestReportBaseAction implements Action { 7 | protected static final String ICON_LOCATON = "/plugin/bootstraped-multi-test-results-report/testng.png"; 8 | 9 | protected static final String DISPLAY_NAME = "View TestNG Reports"; 10 | 11 | @Override 12 | public String getUrlName() { 13 | return TestNgReportBuilder.TESTS_BY_CLASS_OVERVIEW; 14 | } 15 | 16 | @Override 17 | public String getDisplayName() { 18 | return DISPLAY_NAME; 19 | } 20 | 21 | @Override 22 | public String getIconFileName() { 23 | return ICON_LOCATON; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/ExceptionModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 5 | 6 | @JacksonXmlRootElement(localName = "exception") 7 | public class ExceptionModel { 8 | @JacksonXmlProperty(localName = "message") 9 | public MessageModel message; 10 | @JacksonXmlProperty(localName = "full-stacktrace") 11 | public FullStacktraceModel fullStacktrace; 12 | @JacksonXmlProperty(localName = "class") 13 | private String clazz; 14 | 15 | public String getClazz() { 16 | return clazz; 17 | } 18 | 19 | public MessageModel getMessage() { 20 | return message; 21 | } 22 | 23 | public FullStacktraceModel getFullStacktrace() { 24 | return fullStacktrace; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/GroupModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @JacksonXmlRootElement(localName = "message") 10 | public class GroupModel { 11 | private String name; 12 | 13 | @JacksonXmlElementWrapper(localName = "method", useWrapping = false) 14 | private final List methods = new ArrayList<>(); 15 | 16 | public GroupModel(String name) { 17 | this.name = name; 18 | } 19 | 20 | public GroupModel() { 21 | } 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public List getMethods() { 28 | return methods; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /commons-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/commons/ResourceUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.commons; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import java.io.File; 6 | import java.io.IOException; 7 | 8 | import org.apache.commons.io.FileUtils; 9 | import org.junit.Test; 10 | 11 | import com.github.bogdanlivadariu.reporting.commons.ResourceUtil; 12 | import com.github.bogdanlivadariu.reporting.commons.ResourceUtil.WEB_RESOURCE; 13 | 14 | public class ResourceUtilTest { 15 | @Test 16 | public void testResourceCopy() throws IOException, InstantiationException, IllegalAccessException { 17 | File target = new File("tmpDir"); 18 | WEB_RESOURCE resource = WEB_RESOURCE.JQUERY; 19 | 20 | ResourceUtil.copyResource(resource, target.getAbsolutePath()); 21 | assertTrue(target.listFiles()[0].getName().contains(resource.toString())); 22 | 23 | FileUtils.deleteDirectory(target); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/junit/JUnitTestReportProjectAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.junit; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.model.ProminentProjectAction; 5 | import hudson.model.Run; 6 | 7 | import java.util.Optional; 8 | 9 | public class JUnitTestReportProjectAction extends JUnitTestReportBaseAction implements ProminentProjectAction { 10 | 11 | private final AbstractProject project; 12 | 13 | public JUnitTestReportProjectAction(AbstractProject project) { 14 | this.project = project; 15 | } 16 | 17 | public String getUrlName() { 18 | return Optional.ofNullable(project) 19 | .map(AbstractProject::getLastBuild) 20 | .map(Run::getId) 21 | .map(it -> it + "/junit-reports-with-handlebars/testSuitesOverview.html") 22 | .orElse("if-this-happens-contact-dev"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/rspec/RSpecTestReportProjectAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.rspec; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.model.ProminentProjectAction; 5 | import hudson.model.Run; 6 | 7 | import java.util.Optional; 8 | 9 | public class RSpecTestReportProjectAction extends RSpecTestReportBaseAction implements ProminentProjectAction { 10 | 11 | private final AbstractProject project; 12 | 13 | public RSpecTestReportProjectAction(AbstractProject project) { 14 | this.project = project; 15 | } 16 | 17 | public String getUrlName() { 18 | return Optional.ofNullable(project) 19 | .map(AbstractProject::getLastBuild) 20 | .map(Run::getId) 21 | .map(it -> it + "/rspec-reports-with-handlebars/testsByClassOverview.html") 22 | .orElse("if-this-happens-contact-dev"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/testng/TestNGTestReportProjectAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.testng; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.model.ProminentProjectAction; 5 | import hudson.model.Run; 6 | 7 | import java.util.Optional; 8 | 9 | public class TestNGTestReportProjectAction extends TestNGTestReportBaseAction implements ProminentProjectAction { 10 | 11 | private final AbstractProject project; 12 | 13 | public TestNGTestReportProjectAction(AbstractProject project) { 14 | this.project = project; 15 | } 16 | 17 | public String getUrlName() { 18 | return Optional.ofNullable(project) 19 | .map(AbstractProject::getLastBuild) 20 | .map(Run::getId) 21 | .map(it -> it + "/testng-reports-with-handlebars/testsByClassOverview.html") 22 | .orElse("if-this-happens-contact-dev"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/cucumber/CucumberTestReportProjectAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting.cucumber; 2 | 3 | import hudson.model.AbstractProject; 4 | import hudson.model.ProminentProjectAction; 5 | import hudson.model.Run; 6 | 7 | import java.util.Optional; 8 | 9 | public class CucumberTestReportProjectAction extends CucumberTestReportBaseAction implements ProminentProjectAction { 10 | 11 | private final AbstractProject project; 12 | 13 | public CucumberTestReportProjectAction(AbstractProject project) { 14 | this.project = project; 15 | } 16 | 17 | public String getUrlName() { 18 | return Optional.ofNullable(project) 19 | .map(AbstractProject::getLastBuild) 20 | .map(Run::getId) 21 | .map(it -> it + "/cucumber-reports-with-handlebars/featuresOverview.html") 22 | .orElse("if-this-happens-contact-dev"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bogdan Livadariu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bogdan Livadariu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bogdan Livadariu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bogdan Livadariu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bogdan Livadariu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/xml/models/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText; 7 | 8 | public class BaseModel { 9 | 10 | @JacksonXmlProperty 11 | private String message; 12 | 13 | @JacksonXmlProperty 14 | private String type; 15 | 16 | @JacksonXmlText 17 | private String value; 18 | 19 | public String getMessage() { 20 | return message; 21 | } 22 | 23 | public String getType() { 24 | return type; 25 | } 26 | 27 | public String getValue() { 28 | return value; 29 | } 30 | 31 | @JacksonXmlRootElement(localName = "error") 32 | public static class ErrorModel extends BaseModel { 33 | } 34 | 35 | @JacksonXmlRootElement(localName = "failure") 36 | public static class FailureModel extends BaseModel { 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/resources/com/github/bogdanlivadariu/jenkins/reporting/junit/JUnitTestReportPublisher/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/resources/com/github/bogdanlivadariu/jenkins/reporting/rspec/RSpecTestReportPublisher/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/resources/com/github/bogdanlivadariu/jenkins/reporting/testng/TestNGTestReportPublisher/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/SafeArchiveServingRunAction.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting; 2 | 3 | import hudson.model.Run; 4 | import jenkins.model.RunAction2; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.security.NoSuchAlgorithmException; 9 | import java.util.logging.Level; 10 | import java.util.logging.Logger; 11 | 12 | public class SafeArchiveServingRunAction extends SafeArchiveServingAction implements RunAction2 { 13 | 14 | private static final Logger LOGGER = Logger.getLogger(SafeArchiveServingRunAction.class.getName()); 15 | 16 | public SafeArchiveServingRunAction(File rootDir, String urlName, String indexFile, String iconName, String title, 17 | String... safeExtensions) { 18 | super(rootDir, urlName, indexFile, iconName, title, safeExtensions); 19 | } 20 | 21 | @Override 22 | public void onAttached(Run r) { 23 | try { 24 | processDirectory(); 25 | } catch (IOException | NoSuchAlgorithmException ex) { 26 | LOGGER.log(Level.WARNING, "Exception scanning " + r.getRootDir(), ex); 27 | } 28 | } 29 | 30 | @Override 31 | public void onLoad(Run r) { 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/menu.hbs: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/highchartsScripts.hbs: -------------------------------------------------------------------------------- 1 | 51 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/resources/com/github/bogdanlivadariu/jenkins/reporting/cucumber/CucumberTestReportPublisher/config.jelly: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /bootstraped-multi-test-results-report/src/main/java/com/github/bogdanlivadariu/jenkins/reporting/Helper.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.jenkins.reporting; 2 | 3 | import org.apache.tools.ant.DirectoryScanner; 4 | 5 | import java.io.File; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by bobo on 24/01/2017. 11 | */ 12 | public class Helper { 13 | public static List fullPathToFiles(String[] files, File targetBuildDirectory) { 14 | List fullPathList = new ArrayList(); 15 | for (String file : files) { 16 | fullPathList.add(new File(targetBuildDirectory, file).getAbsolutePath()); 17 | } 18 | return fullPathList; 19 | } 20 | 21 | public static String[] findFiles(File targetDirectory, String fileIncludePattern, String fileExcludePattern, 22 | final String DEFAULT_FILE_INCLUDE_PATTERN) { 23 | DirectoryScanner scanner = new DirectoryScanner(); 24 | if (fileIncludePattern == null || fileIncludePattern.isEmpty()) { 25 | scanner.setIncludes(new String[] {DEFAULT_FILE_INCLUDE_PATTERN}); 26 | } else { 27 | scanner.setIncludes(new String[] {fileIncludePattern}); 28 | } 29 | if (fileExcludePattern != null) { 30 | scanner.setExcludes(new String[] {fileExcludePattern}); 31 | } 32 | scanner.setBasedir(targetDirectory); 33 | scanner.scan(); 34 | return scanner.getIncludedFiles(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /commons-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/commons/ResourceUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.commons; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | import org.apache.commons.io.FileUtils; 7 | 8 | public class ResourceUtil { 9 | 10 | public static enum WEB_RESOURCE { 11 | BOOTSTRAP_THEME_CSS("bootstrap-theme.min.css"), 12 | BOOTSTRAP_TOGGLE_JS("bootstrap-toggle.min.js"), 13 | BOOTSTRAP_TOGGLE_CSS("bootstrap-toggle.min.css"), 14 | BOOTSTRAP_MIN_CSS("bootstrap.min.css"), 15 | BOOTSTRAP_MIN_JS("bootstrap.min.js"), 16 | HIGHCHARTS_EXPORTING("exporting.js"), 17 | HIGHCHARTS_3D("highcharts-3d.js"), 18 | HIGHCHARTS_JS("highcharts.js"), 19 | JQUERY("jquery.min.js"); 20 | 21 | private final String name; 22 | 23 | private WEB_RESOURCE(String name) { 24 | this.name = name; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | return this.name; 30 | } 31 | } 32 | 33 | public static void copyResource(WEB_RESOURCE source, String destPath) throws IOException { 34 | File sourceFile = 35 | new File(ResourceUtil.class.getResource("/web/" + source.toString()).getPath()); 36 | File destFile = new File(destPath); 37 | File tmpFile = new File(destFile.getAbsoluteFile() + File.separator + sourceFile.getName()); 38 | 39 | FileUtils.copyFile(sourceFile, tmpFile); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/highchartsScripts.hbs: -------------------------------------------------------------------------------- 1 | 56 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/highchartsScripts.hbs: -------------------------------------------------------------------------------- 1 | 56 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/highchartsScripts.hbs: -------------------------------------------------------------------------------- 1 | 56 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/testng/TestNgReportBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng; 2 | 3 | import com.github.bogdanlivadariu.reporting.testng.builder.TestNgReportBuilder; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import javax.xml.stream.XMLStreamException; 7 | import java.io.IOException; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | import static org.junit.jupiter.api.Assertions.assertThrows; 13 | 14 | public class TestNgReportBuilderTest { 15 | @Test 16 | public void npeTest() { 17 | assertThrows(NullPointerException.class, () -> { 18 | List xmlReports = null; 19 | new TestNgReportBuilder(xmlReports, "out"); 20 | }); 21 | } 22 | 23 | @Test 24 | public void processedReportsTest() throws IOException, XMLStreamException { 25 | List xmlReports = new ArrayList<>(); 26 | String report = this.getClass().getClassLoader().getResource("testng-results.xml").getPath(); 27 | xmlReports.add(report); 28 | 29 | 30 | TestNgReportBuilder builder = new TestNgReportBuilder(xmlReports, "out"); 31 | 32 | System.out.println(builder); 33 | 34 | assertEquals(1, builder.getProcessedTestNgReports().size(), "reports count is not correct"); 35 | 36 | xmlReports.clear(); 37 | builder = new TestNgReportBuilder(xmlReports, "out"); 38 | 39 | assertEquals(0, builder.getProcessedTestNgReports().size(), "reports count is not correct"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/helpers/Constants.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.helpers; 2 | 3 | public class Constants { 4 | 5 | public static final String PASSED = "passed"; 6 | 7 | public static final String FAILED = "failed"; 8 | 9 | public static final String SKIPPED = "skipped"; 10 | 11 | public static final String FEATURES_OVERVIEW = "Features Overview Report"; 12 | 13 | public static final String FEATURES_PASSED_OVERVIEW = "Passed Features Overview Report"; 14 | 15 | public static final String FEATURES_FAILED_OVERVIEW = "Failed Features Overview Report"; 16 | 17 | public static final String FEATURE_SUMMARY_REPORT = "Feature Summary Report"; 18 | 19 | public static final String UNTAGGED = "untagged"; 20 | 21 | public static final String UNDEFINED = "undefined"; 22 | 23 | public static final String THIS_STEP_HAS_BEEN_SKIPPED = "This step has been skipped"; 24 | 25 | public static final String THIS_STEP_HAS_PASSED = "This step has passed"; 26 | 27 | public static final String THIS_STEP_HAS_FAILED = "This step has failed"; 28 | 29 | public static final String THIS_STEP_HAS_NOT_BEEN_DEFINED = "This step has not been defined"; 30 | 31 | public static final String COLLAPSE = "collapse"; 32 | 33 | public static final String COLLAPSE_IN = "collapse in"; 34 | 35 | public static final String INFO = "info"; 36 | 37 | public static final String SUCCESS = "success"; 38 | 39 | public static final String DANGER = "danger"; 40 | 41 | public static final String WARNING = "warning"; 42 | 43 | private Constants() { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/cli/TestNgReportBuilderCli.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.cli; 2 | 3 | import com.github.bogdanlivadariu.reporting.testng.builder.TestNgReportBuilder; 4 | import org.apache.commons.io.FileUtils; 5 | 6 | import javax.xml.stream.FactoryConfigurationError; 7 | import javax.xml.stream.XMLStreamException; 8 | import java.io.File; 9 | import java.io.IOException; 10 | import java.security.NoSuchAlgorithmException; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | public class TestNgReportBuilderCli { 15 | 16 | public static void main(String[] args) 17 | throws FactoryConfigurationError, XMLStreamException, IOException, NoSuchAlgorithmException { 18 | List xmlReports = new ArrayList(); 19 | String[] extensions = {"xml"}; 20 | String xmlPath = System.getProperty("xmlPath"); 21 | String outputPath = System.getProperty("reportsOutputPath"); 22 | if (xmlPath == null || outputPath == null) { 23 | throw new Error("xmlPath or reportsOutputPath variables have not been set"); 24 | } 25 | Object[] files = FileUtils.listFiles(new File(xmlPath), extensions, false).toArray(); 26 | System.out.println("Found " + files.length + " xml files"); 27 | for (Object absFilePath : files) { 28 | System.out.println("Found an xml: " + absFilePath); 29 | xmlReports.add(((File) absFilePath).getAbsolutePath()); 30 | } 31 | 32 | TestNgReportBuilder repo = new TestNgReportBuilder(xmlReports, outputPath); 33 | repo.writeReportsOnDisk(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Step.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | /** 4 | * Represents a step of a scenario. 5 | */ 6 | public class Step { 7 | 8 | private String name; 9 | 10 | private Integer line; 11 | 12 | private String keyword; 13 | 14 | private Boolean hidden; 15 | 16 | private Result result; 17 | 18 | private Match match; 19 | 20 | private DocString docString; 21 | 22 | private Integer[] matchedColumns; 23 | 24 | private Row[] rows; 25 | 26 | private StepArgument[] arguments; 27 | 28 | private Embedding[] embeddings; 29 | 30 | public String getName() { 31 | return name; 32 | } 33 | 34 | public Integer getLine() { 35 | return line; 36 | } 37 | 38 | public String getKeyword() { 39 | return keyword; 40 | } 41 | 42 | public Boolean isHidden() { 43 | return hidden; 44 | } 45 | 46 | public Result getResult() { 47 | return result; 48 | } 49 | 50 | public Object getMatch() { 51 | return match; 52 | } 53 | 54 | public Integer[] getMatchedColumns() { 55 | return matchedColumns; 56 | } 57 | 58 | public Row[] getRows() { 59 | return rows; 60 | } 61 | 62 | public Embedding[] getEmbeddings() { 63 | if (embeddings == null) { 64 | return new Embedding[0]; 65 | } 66 | return embeddings; 67 | } 68 | 69 | public Boolean getHidden() { 70 | return hidden; 71 | } 72 | 73 | public DocString getDocString() { 74 | return docString; 75 | } 76 | 77 | public StepArgument[] getArguments() { 78 | return arguments; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/style.hbs: -------------------------------------------------------------------------------- 1 | #feature-container { 2 | padding: 5px; 3 | width: 90%; 4 | margin-left: auto; 5 | margin-right: auto; 6 | margin-bottom: 80px; 7 | } 8 | 9 | #table-container_wrapper .row:nth-of-type(1) { 10 | margin-right: 2px; 11 | margin-left: 2px; 12 | margin-top: 10px; 13 | } 14 | 15 | #table-container_wrapper .row:nth-of-type(3) { 16 | margin-left: 5px; 17 | margin-right: 5px; 18 | } 19 | 20 | .panel-heading { 21 | width: auto; 22 | } 23 | #container-chart { 24 | width: 98%; 25 | } 26 | table tr { 27 | height: 25px; 28 | } 29 | #charts { 30 | padding 15px; 31 | } 32 | #charts div { 33 | float: left; 34 | width: 49%; 35 | } 36 | .back-to-top { 37 | background: none; 38 | margin: 0; 39 | position: fixed; 40 | bottom: 0; 41 | right: 0; 42 | width: 70px; 43 | height: 70px; 44 | z-index: 100; 45 | display: none; 46 | text-decoration: none; 47 | } 48 | .back-to-top i { 49 | font-size: 60px; 50 | } 51 | .forDrop { 52 | cursor: pointer; 53 | cursor: hand; 54 | } 55 | #tags-toggle { 56 | cursor: pointer; 57 | cursor: hand; 58 | } 59 | pre { 60 | max-height: 450px; 61 | } 62 | .step-location { 63 | color: #aaa; 64 | font-family: verdana; 65 | font-size: 11px; 66 | margin-left: 15px; 67 | } 68 | html { 69 | position: relative; 70 | min-height: 100%; 71 | } 72 | .footer { 73 | position: absolute; 74 | bottom: 0; 75 | width: 100%; 76 | float: left; 77 | height: 60px; 78 | background-color: #f5f5f5; 79 | display: -webkit-box; 80 | display: -webkit-flex; 81 | display: -moz-box; 82 | display: -ms-flexbox; 83 | display: flex; 84 | -webkit-flex-align: center; 85 | -ms-flex-align: center; 86 | -webkit-align-items: center; 87 | align-items: center; 88 | text-align: center; 89 | } 90 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/style.hbs: -------------------------------------------------------------------------------- 1 | #feature-container { 2 | padding: 5px; 3 | width: 90%; 4 | margin-left: auto; 5 | margin-right: auto; 6 | margin-bottom: 80px; 7 | } 8 | 9 | #table-container_wrapper .row:nth-of-type(1) { 10 | margin-right: 2px; 11 | margin-left: 2px; 12 | margin-top: 10px; 13 | } 14 | 15 | #table-container_wrapper .row:nth-of-type(3) { 16 | margin-left: 5px; 17 | margin-right: 5px; 18 | } 19 | 20 | .panel-heading { 21 | width: auto; 22 | } 23 | #container-chart { 24 | width: 98%; 25 | } 26 | table tr { 27 | height: 25px; 28 | } 29 | #charts { 30 | padding 15px; 31 | } 32 | #charts div { 33 | float: left; 34 | width: 49%; 35 | } 36 | .back-to-top { 37 | background: none; 38 | margin: 0; 39 | position: fixed; 40 | bottom: 0; 41 | right: 0; 42 | width: 70px; 43 | height: 70px; 44 | z-index: 100; 45 | display: none; 46 | text-decoration: none; 47 | } 48 | .back-to-top i { 49 | font-size: 60px; 50 | } 51 | .forDrop { 52 | cursor: pointer; 53 | cursor: hand; 54 | } 55 | #tags-toggle { 56 | cursor: pointer; 57 | cursor: hand; 58 | } 59 | pre { 60 | max-height: 450px; 61 | } 62 | .step-location { 63 | color: #aaa; 64 | font-family: verdana; 65 | font-size: 11px; 66 | margin-left: 15px; 67 | } 68 | html { 69 | position: relative; 70 | min-height: 100%; 71 | } 72 | .footer { 73 | position: absolute; 74 | bottom: 0; 75 | width: 100%; 76 | float: left; 77 | height: 60px; 78 | background-color: #f5f5f5; 79 | display: -webkit-box; 80 | display: -webkit-flex; 81 | display: -moz-box; 82 | display: -ms-flexbox; 83 | display: flex; 84 | -webkit-flex-align: center; 85 | -ms-flex-align: center; 86 | -webkit-align-items: center; 87 | align-items: center; 88 | text-align: center; 89 | } 90 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/style.hbs: -------------------------------------------------------------------------------- 1 | #feature-container { 2 | padding: 5px; 3 | width: 90%; 4 | margin-left: auto; 5 | margin-right: auto; 6 | margin-bottom: 80px; 7 | } 8 | 9 | #table-container_wrapper .row:nth-of-type(1) { 10 | margin-right: 2px; 11 | margin-left: 2px; 12 | margin-top: 10px; 13 | } 14 | 15 | #table-container_wrapper .row:nth-of-type(3) { 16 | margin-left: 5px; 17 | margin-right: 5px; 18 | } 19 | 20 | .panel-heading { 21 | width: auto; 22 | } 23 | #container-chart { 24 | width: 98%; 25 | } 26 | table tr { 27 | height: 25px; 28 | } 29 | #charts { 30 | padding 15px; 31 | } 32 | #charts div { 33 | float: left; 34 | width: 49%; 35 | } 36 | .back-to-top { 37 | background: none; 38 | margin: 0; 39 | position: fixed; 40 | bottom: 0; 41 | right: 0; 42 | width: 70px; 43 | height: 70px; 44 | z-index: 100; 45 | display: none; 46 | text-decoration: none; 47 | } 48 | .back-to-top i { 49 | font-size: 60px; 50 | } 51 | .forDrop { 52 | cursor: pointer; 53 | cursor: hand; 54 | } 55 | #tags-toggle { 56 | cursor: pointer; 57 | cursor: hand; 58 | } 59 | pre { 60 | max-height: 450px; 61 | } 62 | .step-location { 63 | color: #aaa; 64 | font-family: verdana; 65 | font-size: 11px; 66 | margin-left: 15px; 67 | } 68 | html { 69 | position: relative; 70 | min-height: 100%; 71 | } 72 | .footer { 73 | position: absolute; 74 | bottom: 0; 75 | width: 100%; 76 | float: left; 77 | height: 60px; 78 | background-color: #f5f5f5; 79 | display: -webkit-box; 80 | display: -webkit-flex; 81 | display: -moz-box; 82 | display: -ms-flexbox; 83 | display: flex; 84 | -webkit-flex-align: center; 85 | -ms-flex-align: center; 86 | -webkit-align-items: center; 87 | align-items: center; 88 | text-align: center; 89 | } 90 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/style.hbs: -------------------------------------------------------------------------------- 1 | #feature-container { 2 | padding: 5px; 3 | width: 90%; 4 | margin-left: auto; 5 | margin-right: auto; 6 | margin-bottom: 80px; 7 | } 8 | 9 | 10 | #table-feature-container_wrapper .row:nth-of-type(1) { 11 | margin-right: 2px; 12 | margin-left: 2px; 13 | margin-top: 10px; 14 | } 15 | 16 | #table-feature-container_wrapper .row:nth-of-type(3) { 17 | margin-left: 5px; 18 | margin-right: 5px; 19 | } 20 | 21 | .panel-heading { 22 | width: auto; 23 | } 24 | #container-chart { 25 | width: 98%; 26 | } 27 | table tr { 28 | height: 25px; 29 | } 30 | #charts { 31 | padding 15px; 32 | } 33 | #charts div { 34 | float: left; 35 | width: 49%; 36 | } 37 | .back-to-top { 38 | background: none; 39 | margin: 0; 40 | position: fixed; 41 | bottom: 0; 42 | right: 0; 43 | width: 70px; 44 | height: 70px; 45 | z-index: 100; 46 | display: none; 47 | text-decoration: none; 48 | } 49 | .back-to-top i { 50 | font-size: 60px; 51 | } 52 | .forDrop { 53 | cursor: pointer; 54 | cursor: hand; 55 | } 56 | #tags-toggle { 57 | cursor: pointer; 58 | cursor: hand; 59 | } 60 | pre { 61 | max-height: 450px; 62 | } 63 | .step-location { 64 | color: #aaa; 65 | font-family: verdana; 66 | font-size: 11px; 67 | margin-left: 15px; 68 | } 69 | html { 70 | position: relative; 71 | min-height: 100%; 72 | } 73 | .footer { 74 | position: absolute; 75 | bottom: 0; 76 | width: 100%; 77 | float: left; 78 | height: 60px; 79 | background-color: #f5f5f5; 80 | display: -webkit-box; 81 | display: -webkit-flex; 82 | display: -moz-box; 83 | display: -ms-flexbox; 84 | display: flex; 85 | -webkit-flex-align: center; 86 | -ms-flex-align: center; 87 | -webkit-align-items: center; 88 | align-items: center; 89 | text-align: center; 90 | } 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bootstraped-multi-test-results-report 2 | 3 | [![codecov.io](https://codecov.io/github/web-innovate/bootstraped-multi-test-results-report/coverage.svg?branch=master)](https://codecov.io/github/web-innovate/bootstraped-multi-test-results-report?branch=master) 4 | 5 | | maven module | maven latest versions | 6 | | ------------ | --------------------- | 7 | | [cucumber-reporting-handlebars](./cucumber-reporting-handlebars) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/cucumber-reporting-handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/cucumber-reporting-handlebars) | 8 | | [junit-reporting-handlebars](./junit-reporting-handlebars) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/junit-reporting-handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/junit-reporting-handlebars) | 9 | | [rspec-reporting-handlebars](./rspec-reporting-handlebars) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/rspec-reporting-handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/rspec-reporting-handlebars) | 10 | | [testng-reporting-handlebars](./testng-reporting-handlebars) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/testng-reporting-handlebars/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.bogdanlivadariu/testng-reporting-handlebars) | 11 | 12 | 13 | The project offers the possibility to build test reports using a bootstrap components, offering rendering support on a wide range of devices. 14 | 15 | Once you have installed this plugin, and configured it with the proper location of your json test report files, 16 | after the build is finished, then the following menu will be present on your build/project. 17 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/builder/AllJUnitReports.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.builder; 2 | 3 | import java.util.List; 4 | 5 | import com.github.bogdanlivadariu.reporting.junit.xml.models.TestSuiteModel; 6 | 7 | public class AllJUnitReports { 8 | private List allTestSuites; 9 | 10 | private int suitesCount; 11 | 12 | private int totalTests; 13 | 14 | private int totalFailures; 15 | 16 | private int totalErrors; 17 | 18 | private int totalSkipped; 19 | 20 | private String pageTitle; 21 | 22 | private Double totalTime = 0.0; 23 | 24 | public AllJUnitReports(String pageTitle, List allTestSuites) { 25 | this.pageTitle = pageTitle; 26 | this.allTestSuites = allTestSuites; 27 | this.suitesCount = allTestSuites.size(); 28 | for (TestSuiteModel ts : this.allTestSuites) { 29 | totalTests += Integer.parseInt(ts.getTests()); 30 | totalFailures += Integer.parseInt(ts.getFailures()); 31 | totalErrors += Integer.parseInt(ts.getErrors()); 32 | totalSkipped += Integer.parseInt(ts.getSkipped()); 33 | totalTime += Double.parseDouble(ts.getTime()); 34 | } 35 | } 36 | 37 | public List getAllTestSuites() { 38 | return allTestSuites; 39 | } 40 | 41 | public String getPageTitle() { 42 | return pageTitle; 43 | } 44 | 45 | public String getTotalTime() { 46 | return totalTime.toString(); 47 | } 48 | 49 | public int getSuitesCount() { 50 | return suitesCount; 51 | } 52 | 53 | public int getTotalTests() { 54 | return totalTests; 55 | } 56 | 57 | public int getTotalFailures() { 58 | return totalFailures; 59 | } 60 | 61 | public int getTotalErrors() { 62 | return totalErrors; 63 | } 64 | 65 | public int getTotalSkipped() { 66 | return totalSkipped; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/builder/AllRSpecJUnitReports.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.builder; 2 | 3 | import java.util.List; 4 | 5 | import com.github.bogdanlivadariu.reporting.rspec.xml.models.TestSuiteModel; 6 | 7 | public class AllRSpecJUnitReports { 8 | private List allTestSuites; 9 | 10 | private int suitesCount; 11 | 12 | private int totalTests; 13 | 14 | private int totalFailures; 15 | 16 | private int totalErrors; 17 | 18 | private int totalSkipped; 19 | 20 | private String pageTitle; 21 | 22 | private Double totalTime = 0.0; 23 | 24 | public AllRSpecJUnitReports(String pageTitle, List allTestSuites) { 25 | this.pageTitle = pageTitle; 26 | this.allTestSuites = allTestSuites; 27 | this.suitesCount = allTestSuites.size(); 28 | 29 | for (TestSuiteModel ts : allTestSuites) { 30 | totalTests += Integer.parseInt(ts.getTests()); 31 | totalFailures += Integer.parseInt(ts.getFailures()); 32 | totalErrors += Integer.parseInt(ts.getErrors()); 33 | totalSkipped += Integer.parseInt(ts.getSkipped()); 34 | totalTime += Double.parseDouble(ts.getTime()); 35 | } 36 | 37 | } 38 | 39 | public List getAllTestSuites() { 40 | return allTestSuites; 41 | } 42 | 43 | public String getPageTitle() { 44 | return pageTitle; 45 | } 46 | 47 | public String getTotalTime() { 48 | return totalTime.toString(); 49 | } 50 | 51 | public int getSuitesCount() { 52 | return suitesCount; 53 | } 54 | 55 | public int getTotalTests() { 56 | return totalTests; 57 | } 58 | 59 | public int getTotalFailures() { 60 | return totalFailures; 61 | } 62 | 63 | public int getTotalErrors() { 64 | return totalErrors; 65 | } 66 | 67 | public int getTotalSkipped() { 68 | return totalSkipped; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/junit/builder/AllJunitReportsTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.builder; 2 | 3 | import org.junit.jupiter.api.BeforeEach; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.io.IOException; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | 12 | public class AllJunitReportsTest { 13 | private final String reportPath = this.getClass().getClassLoader().getResource("valid-report-1.xml").getPath(); 14 | private List xmlReports; 15 | private JUnitReportBuilder builder; 16 | 17 | private AllJUnitReports reports; 18 | 19 | @BeforeEach 20 | public void setUp() throws IOException { 21 | xmlReports = new ArrayList<>(); 22 | xmlReports.add(reportPath); 23 | builder = new JUnitReportBuilder(xmlReports, "out"); 24 | reports = new AllJUnitReports("title", builder.getProcessedTestSuites()); 25 | } 26 | 27 | @Test 28 | public void restSuitesSizeTest() { 29 | assertEquals(reports.getAllTestSuites().size(), 1, "reports count is not right"); 30 | assertEquals(reports.getSuitesCount(), 1); 31 | assertEquals(reports.getTotalErrors(), 0); 32 | } 33 | 34 | @Test 35 | public void pageTitleTest() { 36 | assertEquals(reports.getPageTitle(), "title"); 37 | } 38 | 39 | @Test 40 | public void totalErrorsTest() { 41 | assertEquals(reports.getTotalErrors(), 0); 42 | } 43 | 44 | @Test 45 | public void totalFailuresTest() { 46 | assertEquals(reports.getTotalFailures(), 7); 47 | } 48 | 49 | @Test 50 | public void totalSkippedTest() { 51 | assertEquals(reports.getTotalSkipped(), 0); 52 | } 53 | 54 | @Test 55 | public void totalTestsTest() { 56 | assertEquals(reports.getTotalTests(), 13); 57 | } 58 | 59 | @Test 60 | public void totalTimeTest() { 61 | assertEquals(reports.getTotalTime(), "0.813"); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/junit/builder/AllJunitReportsWithSuitesTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.builder; 2 | 3 | import org.junit.jupiter.api.BeforeEach; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.io.IOException; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | import static org.junit.jupiter.api.Assertions.assertEquals; 11 | 12 | public class AllJunitReportsWithSuitesTest { 13 | private final String reportPath = this.getClass().getClassLoader().getResource("valid-report-2.xml").getPath(); 14 | private List xmlReports; 15 | private JUnitReportBuilder builder; 16 | 17 | private AllJUnitReports reports; 18 | 19 | @BeforeEach 20 | public void setUp() throws IOException { 21 | xmlReports = new ArrayList<>(); 22 | xmlReports.add(reportPath); 23 | builder = new JUnitReportBuilder(xmlReports, "out"); 24 | reports = new AllJUnitReports("title", builder.getProcessedTestSuites()); 25 | } 26 | 27 | @Test 28 | public void restSuitesSizeTest() { 29 | assertEquals(reports.getAllTestSuites().size(), 2, "reports count is not right"); 30 | assertEquals(reports.getSuitesCount(), 2); 31 | assertEquals(reports.getTotalErrors(), 0); 32 | } 33 | 34 | @Test 35 | public void pageTitleTest() { 36 | assertEquals(reports.getPageTitle(), "title"); 37 | } 38 | 39 | @Test 40 | public void totalErrorsTest() { 41 | assertEquals(reports.getSuitesCount(), 2); 42 | } 43 | 44 | @Test 45 | public void totalFailuresTest() { 46 | assertEquals(reports.getTotalFailures(), 2); 47 | } 48 | 49 | @Test 50 | public void totalSkippedTest() { 51 | assertEquals(reports.getTotalSkipped(), 0); 52 | } 53 | 54 | @Test 55 | public void totalTestsTest() { 56 | assertEquals(reports.getTotalTests(), 8); 57 | } 58 | 59 | @Test 60 | public void totalTimeTest() { 61 | assertEquals(reports.getTotalTime(), "8.1"); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/testng/AllTestNgReportsTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng; 2 | 3 | import com.github.bogdanlivadariu.reporting.testng.builder.AllTestNgReports; 4 | import com.github.bogdanlivadariu.reporting.testng.builder.TestNgReportBuilder; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import javax.xml.stream.XMLStreamException; 9 | import java.io.IOException; 10 | import java.security.NoSuchAlgorithmException; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | import static org.junit.jupiter.api.Assertions.assertEquals; 15 | 16 | public class AllTestNgReportsTest { 17 | 18 | private final String reportPath = this.getClass().getClassLoader().getResource("testng-results.xml").getPath(); 19 | private List xmlReports; 20 | private TestNgReportBuilder builder; 21 | 22 | private AllTestNgReports reports; 23 | 24 | @BeforeEach 25 | public void setUp() throws IOException, XMLStreamException, NoSuchAlgorithmException { 26 | xmlReports = new ArrayList<>(); 27 | xmlReports.add(reportPath); 28 | builder = new TestNgReportBuilder(xmlReports, "out"); 29 | reports = new AllTestNgReports("title", builder.getProcessedTestNgReports()); 30 | 31 | builder.writeReportsOnDisk(); 32 | } 33 | 34 | @Test 35 | public void ceva() { 36 | System.out.println(reports); 37 | } 38 | 39 | @Test 40 | public void pageTitleTest() { 41 | assertEquals(reports.getPageTitle(), "title"); 42 | } 43 | 44 | @Test 45 | public void totalFailuresTest() { 46 | assertEquals(reports.getTotalFailed(), 2); 47 | } 48 | 49 | @Test 50 | public void totalSkippedTest() { 51 | assertEquals(reports.getTotalSkipped(), 1); 52 | } 53 | 54 | @Test 55 | public void totalTestsTest() { 56 | assertEquals(reports.getTotalTests(), 41); 57 | } 58 | 59 | @Test 60 | public void totalTimeTest() { 61 | assertEquals(reports.getTotalTime(), 280060L); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/junit/builder/JUnitReportBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.builder; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | import static org.junit.jupiter.api.Assertions.assertThrows; 11 | 12 | /** 13 | * Unit test for simple App. 14 | */ 15 | public class JUnitReportBuilderTest { 16 | 17 | @Test 18 | public void npeTest() throws Exception { 19 | assertThrows(NullPointerException.class, () -> { 20 | List xmlReports = null; 21 | new JUnitReportBuilder(xmlReports, "out"); 22 | }); 23 | } 24 | 25 | @Test 26 | public void processedReportsTest() throws IOException { 27 | List xmlReports = new ArrayList<>(); 28 | String report = this.getClass().getClassLoader().getResource("valid-report-1.xml").getPath(); 29 | xmlReports.add(report); 30 | JUnitReportBuilder builder = new JUnitReportBuilder(xmlReports, "out"); 31 | assertEquals(1, builder.getProcessedTestSuites().size(), "reports count is not right"); 32 | xmlReports.clear(); 33 | builder = new JUnitReportBuilder(xmlReports, "out"); 34 | assertEquals(0, builder.getProcessedTestSuites().size(), "reports count is not right"); 35 | } 36 | 37 | @Test 38 | public void processedReportsSuitesTest() throws IOException { 39 | List xmlReports = new ArrayList<>(); 40 | String report = this.getClass().getClassLoader().getResource("valid-report-2.xml").getPath(); 41 | xmlReports.add(report); 42 | JUnitReportBuilder builder = new JUnitReportBuilder(xmlReports, "out"); 43 | assertEquals(2, builder.getProcessedTestSuites().size(), "reports count is not right"); 44 | xmlReports.clear(); 45 | builder = new JUnitReportBuilder(xmlReports, "out"); 46 | assertEquals(0, builder.getProcessedTestSuites().size(), "reports count is not right"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/TestModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @JacksonXmlRootElement(localName = "test") 11 | public class TestModel { 12 | 13 | @JacksonXmlElementWrapper(localName = "class", useWrapping = false) 14 | @JacksonXmlProperty(localName = "class") 15 | private final List classes = new ArrayList<>(); 16 | private String name; 17 | @JacksonXmlProperty(localName = "duration-ms") 18 | private String durationMs; 19 | @JacksonXmlProperty(localName = "started-at") 20 | private String startedAt; 21 | @JacksonXmlProperty(localName = "finished-at") 22 | private String finishedAt; 23 | private int totalPassed = 0; 24 | 25 | private int totalFailed = 0; 26 | 27 | private int totalSkipped = 0; 28 | 29 | public void postProcess() { 30 | for (ClassModel cm : getClasses()) { 31 | cm.postProcess(); 32 | totalPassed += cm.getTotalPassed(); 33 | totalFailed += cm.getTotalFailed(); 34 | totalSkipped += cm.getTotalSkipped(); 35 | } 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public String getDurationMs() { 43 | return durationMs; 44 | } 45 | 46 | public String getStartedAt() { 47 | return startedAt; 48 | } 49 | 50 | public String getFinishedAt() { 51 | return finishedAt; 52 | } 53 | 54 | public List getClasses() { 55 | return classes; 56 | } 57 | 58 | public int getTotalPassed() { 59 | return totalPassed; 60 | } 61 | 62 | public int getTotalFailed() { 63 | return totalFailed; 64 | } 65 | 66 | public int getTotalSkipped() { 67 | return totalSkipped; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/builder/AllTestNgReports.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.builder; 2 | 3 | import java.util.List; 4 | 5 | import com.github.bogdanlivadariu.reporting.testng.xml.models.TestngResultsModel; 6 | 7 | public class AllTestNgReports { 8 | 9 | private List allTestSuites; 10 | 11 | private int suitesCount; 12 | 13 | private int totalTests; 14 | 15 | private int totalFailed = 0; 16 | 17 | private int totalPassed = 0; 18 | 19 | private int totalSkipped = 0; 20 | 21 | private int totalClasses = 0; 22 | 23 | private String pageTitle; 24 | 25 | private Long totalTime = (long) 0; 26 | 27 | public AllTestNgReports(String pageTitle, List allTestngResults) { 28 | this.pageTitle = pageTitle; 29 | this.allTestSuites = allTestngResults; 30 | this.suitesCount = allTestngResults.size(); 31 | 32 | for (TestngResultsModel ts : allTestngResults) { 33 | totalPassed += ts.getTotalClassesPassed(); 34 | totalFailed += ts.getTotalClassesFailed(); 35 | totalSkipped += ts.getTotalClassesSkipped(); 36 | totalTests += ts.getTotalClassesTests(); 37 | totalTime += ts.getTotalTime(); 38 | totalClasses += ts.getTotalClasses(); 39 | } 40 | 41 | } 42 | 43 | public String getPageTitle() { 44 | return pageTitle; 45 | } 46 | 47 | public Long getTotalTime() { 48 | return totalTime; 49 | } 50 | 51 | public int getSuitesCount() { 52 | return suitesCount; 53 | } 54 | 55 | public int getTotalTests() { 56 | return totalTests; 57 | } 58 | 59 | public int getTotalFailed() { 60 | return totalFailed; 61 | } 62 | 63 | public int getTotalPassed() { 64 | return totalPassed; 65 | } 66 | 67 | public int getTotalSkipped() { 68 | return totalSkipped; 69 | } 70 | 71 | public List getAllTestSuites() { 72 | return allTestSuites; 73 | } 74 | 75 | public int getTotalClasses() { 76 | return totalClasses; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/xml/models/TestCaseModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.xml.models; 2 | 3 | import java.util.UUID; 4 | 5 | import jakarta.xml.bind.annotation.*; 6 | 7 | import com.github.bogdanlivadariu.reporting.rspec.helpers.Constants; 8 | import static com.github.bogdanlivadariu.reporting.rspec.xml.models.BaseModel.*; 9 | 10 | @XmlRootElement(name = "testcase") 11 | @XmlAccessorType(XmlAccessType.FIELD) 12 | public class TestCaseModel { 13 | @XmlElement(name = "system-out") 14 | private String systemOut; 15 | 16 | @XmlAttribute 17 | private String time; 18 | 19 | @XmlElement(name = "failure") 20 | private FailureModel failure; 21 | 22 | @XmlAttribute 23 | private String classname; 24 | 25 | @XmlAttribute 26 | private String name; 27 | 28 | @XmlElement(name = "system-err") 29 | private String systemErr; 30 | 31 | @XmlElement(name = "error") 32 | private ErrorModel error; 33 | 34 | private String overallStatus; 35 | 36 | private String uniqueID; 37 | 38 | public ErrorModel getError() { 39 | return error; 40 | } 41 | 42 | public String getUniqueID() { 43 | return uniqueID; 44 | } 45 | 46 | public void postProcess() { 47 | if (failure != null) { 48 | overallStatus = Constants.FAILED; 49 | } else if (error != null) { 50 | overallStatus = Constants.ERRORED; 51 | } else { 52 | overallStatus = Constants.PASSED; 53 | } 54 | uniqueID = UUID.randomUUID().toString(); 55 | } 56 | 57 | public String getSystemOut() { 58 | return systemOut; 59 | } 60 | 61 | public String getTime() { 62 | return time.replace(",", ""); 63 | } 64 | 65 | public FailureModel getFailure() { 66 | return failure; 67 | } 68 | 69 | public String getClassname() { 70 | return classname; 71 | } 72 | 73 | public String getName() { 74 | return name; 75 | } 76 | 77 | public String getSystemErr() { 78 | return systemErr; 79 | } 80 | 81 | public String getOverallStatus() { 82 | return overallStatus; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/xml/models/TestSuitesModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.xml.models; 2 | 3 | import com.github.bogdanlivadariu.reporting.rspec.helpers.Constants; 4 | 5 | import jakarta.xml.bind.annotation.*; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | import java.util.UUID; 9 | 10 | @XmlRootElement(name = "testsuites") 11 | @XmlAccessorType(XmlAccessType.FIELD) 12 | public class TestSuitesModel { 13 | 14 | @XmlAttribute 15 | private String failures = "0"; 16 | 17 | @XmlAttribute 18 | private String skipped = "0"; 19 | 20 | @XmlAttribute 21 | private String tests = "0"; 22 | 23 | @XmlAttribute 24 | private String errors = "0"; 25 | 26 | @XmlAttribute 27 | private String time; 28 | 29 | @XmlAttribute 30 | private String timestamp; 31 | 32 | private String uniqueID; 33 | 34 | private String overallStatus; 35 | 36 | @XmlElement(name = "testsuite") 37 | private List testsuites; 38 | 39 | public String getErrors() { 40 | return errors; 41 | } 42 | 43 | public String getOverallStatus() { 44 | return overallStatus; 45 | } 46 | 47 | public String getUniqueID() { 48 | return uniqueID; 49 | } 50 | 51 | public List getTestsuites() { 52 | return testsuites == null ? new ArrayList() : testsuites; 53 | } 54 | 55 | public String getFailures() { 56 | return failures; 57 | } 58 | 59 | public String getSkipped() { 60 | return skipped; 61 | } 62 | 63 | public String getTests() { 64 | return tests; 65 | } 66 | 67 | public String getTime() { 68 | return time; 69 | } 70 | 71 | public String getTimestamp() { 72 | return timestamp; 73 | } 74 | 75 | public void postProcess() { 76 | uniqueID = UUID.randomUUID().toString(); 77 | for (TestSuiteModel ts : getTestsuites()) { 78 | ts.postProcess(); 79 | } 80 | if (Integer.parseInt(failures) > 0) { 81 | overallStatus = Constants.FAILED; 82 | } else { 83 | overallStatus = Constants.PASSED; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/TestMethodModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 5 | 6 | import java.util.UUID; 7 | 8 | @JacksonXmlRootElement(localName = "test-method") 9 | public class TestMethodModel { 10 | private final String uniqueID; 11 | private String status; 12 | private String signature; 13 | private String name; 14 | 15 | @JacksonXmlProperty(localName = "params") 16 | private ParamsModel params; 17 | @JacksonXmlProperty(localName = "is-config") 18 | private boolean isConfig; 19 | @JacksonXmlProperty(localName = "duration-ms") 20 | private Long durationMs; 21 | @JacksonXmlProperty(localName = "started-at") 22 | private String startedAt; 23 | @JacksonXmlProperty(localName = "finished-at") 24 | private String finishedAt; 25 | @JacksonXmlProperty(localName = "reporter-output") 26 | private ReporterOutputModel reporterOutput; 27 | @JacksonXmlProperty(localName = "exception") 28 | private ExceptionModel exception; 29 | 30 | @JacksonXmlProperty(localName = "depends-on-methods") 31 | private String dependsOnMethods; 32 | 33 | public TestMethodModel() { 34 | uniqueID = UUID.randomUUID().toString(); 35 | } 36 | 37 | public String getStatus() { 38 | return status; 39 | } 40 | 41 | public String getSignature() { 42 | return signature; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public boolean getIsConfig() { 50 | return isConfig; 51 | } 52 | 53 | public Long getDurationMs() { 54 | return durationMs; 55 | } 56 | 57 | public String getStartedAt() { 58 | return startedAt; 59 | } 60 | 61 | public String getFinishedAt() { 62 | return finishedAt; 63 | } 64 | 65 | public ReporterOutputModel getReporterOutput() { 66 | return reporterOutput; 67 | } 68 | 69 | public ExceptionModel getException() { 70 | return exception; 71 | } 72 | 73 | public String getUniqueID() { 74 | return uniqueID; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/xml/models/TestCaseModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 4 | import com.github.bogdanlivadariu.reporting.junit.helpers.Constants; 5 | 6 | import java.util.UUID; 7 | 8 | import static com.github.bogdanlivadariu.reporting.junit.xml.models.BaseModel.ErrorModel; 9 | import static com.github.bogdanlivadariu.reporting.junit.xml.models.BaseModel.FailureModel; 10 | 11 | //@XmlRootElement(name = "testcase") 12 | //@XmlAccessorType(XmlAccessType.FIELD) 13 | @JacksonXmlRootElement(localName = "testcase") 14 | public class TestCaseModel { 15 | // @XmlElement(name = "system-out") 16 | private String systemOut; 17 | 18 | private String time; 19 | 20 | private FailureModel failure; 21 | 22 | private String classname; 23 | 24 | private String name; 25 | 26 | // @XmlElement(name = "system-err") 27 | private String systemErr; 28 | 29 | // @XmlElement(name = "error") 30 | private ErrorModel error; 31 | 32 | private String overallStatus; 33 | 34 | private String uniqueID; 35 | 36 | public ErrorModel getError() { 37 | return error; 38 | } 39 | 40 | public String getUniqueID() { 41 | return uniqueID; 42 | } 43 | 44 | public void postProcess() { 45 | if (failure != null) { 46 | overallStatus = Constants.FAILED; 47 | } else if (error != null) { 48 | overallStatus = Constants.ERRORED; 49 | } else { 50 | overallStatus = Constants.PASSED; 51 | } 52 | uniqueID = UUID.randomUUID().toString(); 53 | } 54 | 55 | public String getSystemOut() { 56 | return systemOut; 57 | } 58 | 59 | public String getTime() { 60 | return time.replace(",", ""); 61 | } 62 | 63 | public FailureModel getFailure() { 64 | return failure; 65 | } 66 | 67 | public String getClassname() { 68 | return classname; 69 | } 70 | 71 | public String getName() { 72 | return name; 73 | } 74 | 75 | public String getSystemErr() { 76 | return systemErr; 77 | } 78 | 79 | public String getOverallStatus() { 80 | return overallStatus; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/highchartsOverviewScripts.hbs: -------------------------------------------------------------------------------- 1 | 94 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/helpers/Helpers.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.helpers; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Calendar; 5 | import java.util.Date; 6 | import java.util.TimeZone; 7 | 8 | import com.github.jknack.handlebars.Handlebars; 9 | import com.github.jknack.handlebars.Helper; 10 | 11 | public class Helpers { 12 | private Handlebars handlebar; 13 | 14 | public Helpers(Handlebars handlebar) { 15 | this.handlebar = handlebar; 16 | } 17 | 18 | public Handlebars registerHelpers() { 19 | handlebar.registerHelper("date", (Helper) (arg0, arg1) -> { 20 | int totalSecs = (int) Double.parseDouble(arg0); 21 | int hours = totalSecs / 3600; 22 | int minutes = (totalSecs % 3600) / 60; 23 | int seconds = totalSecs % 60; 24 | int miliSec = (int) ((Double.parseDouble(arg0) - totalSecs) * 1000); 25 | 26 | return String.format("%02d h : %02d m : %02d s : %02d ms", hours, minutes, seconds, miliSec); 27 | }); 28 | 29 | handlebar.registerHelper("result-color", (Helper) (arg0, arg1) -> checkStatus(arg0, "info", "warning","success", "danger")); 30 | 31 | handlebar.registerHelper("resolve-tooltip", (Helper) (arg0, arg1) -> "This test has " + arg0); 32 | 33 | handlebar.registerHelper("resolve-title", (Helper) (arg0, arg1) -> checkStatus(arg0, null, "This step has been skipped", "This step has passed", "This step has failed")); 34 | 35 | handlebar.registerHelper("is-collapsed", (Helper) (arg0, arg1) -> checkStatus(arg0, null, null, "collapse", "collapse in")); 36 | 37 | handlebar.registerHelper("now", (context, options) -> { 38 | Calendar cal = Calendar.getInstance(); 39 | Date date = cal.getTime(); 40 | String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").format(date); 41 | TimeZone tz = cal.getTimeZone(); 42 | return now + " " + tz.getID(); 43 | }); 44 | 45 | return handlebar; 46 | } 47 | 48 | private CharSequence checkStatus(String arg0, String retVaule1, String retVaule2, String retVaule3, String retVaule4) { 49 | switch (arg0.toLowerCase()) { 50 | case Constants.SKIPPED: 51 | return retVaule1; 52 | case Constants.ERRORED: 53 | return retVaule2; 54 | case Constants.PASSED: 55 | return retVaule3; 56 | case Constants.FAILED: 57 | return retVaule4; 58 | default: 59 | break; 60 | } 61 | return Constants.UNDEFINED; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/test/resources/valid-report-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/helpers/Helpers.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.helpers; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Calendar; 5 | import java.util.Date; 6 | import java.util.TimeZone; 7 | 8 | import com.github.jknack.handlebars.Handlebars; 9 | import com.github.jknack.handlebars.Helper; 10 | 11 | public class Helpers { 12 | private Handlebars handlebar; 13 | 14 | public Helpers(Handlebars handlebar) { 15 | this.handlebar = handlebar; 16 | } 17 | 18 | public Handlebars registerHelpers() { 19 | handlebar.registerHelper("date", (Helper) (arg0, arg1) -> { 20 | int totalSecs = (int) Double.parseDouble(arg0); 21 | int hours = totalSecs / 3600; 22 | int minutes = (totalSecs % 3600) / 60; 23 | int seconds = totalSecs % 60; 24 | int miliSec = (int) ((Double.parseDouble(arg0) - totalSecs) * 1000); 25 | 26 | return String.format("%02d h : %02d m : %02d s : %02d ms", hours, minutes, seconds, miliSec); 27 | }); 28 | 29 | handlebar.registerHelper("result-color", (Helper) (arg0, arg1) -> checkStatus(arg0, "info", "warning", "success", "danger")); 30 | 31 | handlebar.registerHelper("resolve-tooltip", (Helper) (arg0, arg1) -> "This test has " + arg0); 32 | 33 | handlebar.registerHelper("resolve-title", (Helper) (arg0, arg1) -> checkStatus(arg0, "This step has been skipped", null, "This step has passed", "This step has failed")); 34 | 35 | handlebar.registerHelper("is-collapsed", (Helper) (arg0, arg1) -> checkStatus(arg0, null, null, "collapse", "collapse in")); 36 | 37 | handlebar.registerHelper("now", (context, options) -> { 38 | Calendar cal = Calendar.getInstance(); 39 | Date date = cal.getTime(); 40 | String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").format(date); 41 | TimeZone tz = cal.getTimeZone(); 42 | return now + " " + tz.getID(); 43 | }); 44 | 45 | return handlebar; 46 | } 47 | 48 | private CharSequence checkStatus(String arg0, String retValue1, String retValue2, String retValue3, String retValue4) { 49 | switch (arg0.toLowerCase()) { 50 | case Constants.SKIPPED: 51 | return retValue1; 52 | case Constants.ERRORED: 53 | return retValue2; 54 | case Constants.PASSED: 55 | return retValue3; 56 | case Constants.FAILED: 57 | return retValue4; 58 | default: 59 | break; 60 | } 61 | return Constants.UNDEFINED; 62 | } 63 | public Handlebars getInstance() { 64 | return handlebar; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.github.bogdanlivadariu 5 | bootstraped-multi-test-results-report-reactor-parent 6 | 2.2.3-SNAPSHOT 7 | 8 | com.github.bogdanlivadariu 9 | cucumber-reporting-handlebars 10 | jar 11 | cucumber-handlebars 12 | Module used to generate cucumber reports using handlebars 13 | https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin/tree/master/cucumber-reporting-handlebars 14 | 15 | 16 | MIT 17 | https://opensource.org/license/mit/ 18 | repo 19 | 20 | 21 | 22 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 23 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 24 | git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 25 | ${scmTag} 26 | 27 | 28 | 29 | bogdanlivadariu 30 | Bogdan Livadariu 31 | bogdan.livadariu@gmail.com 32 | 33 | 34 | 35 | UTF-8 36 | 37 | 38 | 39 | com.github.jknack 40 | handlebars 41 | ${handlebars.version} 42 | 43 | 44 | commons-io 45 | commons-io 46 | 2.11.0 47 | 48 | 49 | com.google.code.gson 50 | gson 51 | ${gson.version} 52 | 53 | 54 | joda-time 55 | joda-time 56 | ${joda-time.version} 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/junit/builder/HelperTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.builder; 2 | 3 | import com.github.bogdanlivadariu.reporting.junit.helpers.Helpers; 4 | import com.github.jknack.handlebars.Handlebars; 5 | import org.junit.jupiter.api.BeforeAll; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.io.IOException; 9 | 10 | import static com.github.bogdanlivadariu.reporting.junit.helpers.Constants.*; 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | public class HelperTest { 14 | private static Handlebars instance; 15 | 16 | @BeforeAll 17 | public static void setup() { 18 | Helpers a = new Helpers(new Handlebars()); 19 | instance = a.registerHelpers(); 20 | } 21 | 22 | @Test 23 | public void resolveTooltipTest() throws IOException { 24 | String helperName = "resolve-tooltip"; 25 | assertEquals("This test has Failed", 26 | instance.helper(helperName).apply("Failed", null)); 27 | 28 | assertEquals("This test has 123!@", 29 | instance.helper(helperName).apply("123!@", null)); 30 | } 31 | 32 | @Test 33 | public void isCollapsedTest() throws IOException { 34 | String helperName = "is-collapsed"; 35 | assertEquals("collapse", 36 | instance.helper(helperName).apply(PASSED, null)); 37 | 38 | assertEquals("collapse in", 39 | instance.helper(helperName).apply(FAILED, null)); 40 | 41 | assertEquals(null, 42 | instance.helper(helperName).apply(SKIPPED, null)); 43 | 44 | assertEquals(null, 45 | instance.helper(helperName).apply(ERRORED, null)); 46 | } 47 | 48 | @Test 49 | public void resolveTitleTest() throws IOException { 50 | String helperName = "resolve-title"; 51 | assertEquals("This step has passed", 52 | instance.helper(helperName).apply(PASSED, null)); 53 | 54 | assertEquals("This step has failed", 55 | instance.helper(helperName).apply(FAILED, null)); 56 | 57 | assertEquals("This step has been skipped", 58 | instance.helper(helperName).apply(SKIPPED, null)); 59 | 60 | assertEquals(null, 61 | instance.helper(helperName).apply(ERRORED, null)); 62 | } 63 | 64 | @Test 65 | public void resultColorTest() throws IOException { 66 | String helperName = "result-color"; 67 | assertEquals("success", 68 | instance.helper(helperName).apply(PASSED, null)); 69 | 70 | assertEquals("danger", 71 | instance.helper(helperName).apply(FAILED, null)); 72 | 73 | assertEquals("info", 74 | instance.helper(helperName).apply(SKIPPED, null)); 75 | 76 | assertEquals("warning", 77 | instance.helper(helperName).apply(ERRORED, null)); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/rspec/xml/models/TestSuiteModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.rspec.xml.models; 2 | 3 | import java.util.List; 4 | import java.util.UUID; 5 | 6 | import jakarta.xml.bind.annotation.*; 7 | 8 | import com.github.bogdanlivadariu.reporting.rspec.helpers.Constants; 9 | 10 | @XmlRootElement(name = "testsuite") 11 | @XmlAccessorType(XmlAccessType.FIELD) 12 | public class TestSuiteModel { 13 | @XmlAttribute 14 | private String failures = "0"; 15 | 16 | @XmlAttribute 17 | private String time; 18 | 19 | @XmlAttribute 20 | private String errors = "0"; 21 | 22 | @XmlAttribute 23 | private String tests = "0"; 24 | 25 | @XmlAttribute 26 | private String skipped = "0"; 27 | 28 | @XmlAttribute 29 | private String name; 30 | 31 | private String uniqueID; 32 | 33 | private String overallStatus; 34 | 35 | @XmlElementWrapper(name = "properties") 36 | @XmlElement(name = "property") 37 | private List properties; 38 | 39 | @XmlElement(name = "testcase") 40 | private List testcase; 41 | 42 | public void postProcess() { 43 | if (Integer.parseInt(failures) > 0) { 44 | overallStatus = Constants.FAILED; 45 | } else { 46 | overallStatus = Constants.PASSED; 47 | } 48 | for (TestCaseModel tc : testcase) { 49 | tc.postProcess(); 50 | } 51 | uniqueID = UUID.randomUUID().toString(); 52 | } 53 | 54 | public String getUniqueID() { 55 | return uniqueID; 56 | } 57 | 58 | public String getFailures() { 59 | return failures; 60 | } 61 | 62 | public String getTime() { 63 | Double val = 0.0; 64 | for (TestCaseModel tc : getTestcase()) { 65 | val += Double.parseDouble(tc.getTime()); 66 | } 67 | return val.toString(); 68 | } 69 | 70 | public String getErrors() { 71 | return errors; 72 | } 73 | 74 | public String getTests() { 75 | return tests; 76 | } 77 | 78 | public String getSkipped() { 79 | return skipped; 80 | } 81 | 82 | public String getName() { 83 | return name; 84 | } 85 | 86 | public List getProperties() { 87 | return properties; 88 | } 89 | 90 | public List getTestcase() { 91 | return testcase; 92 | } 93 | 94 | public String getOverallStatus() { 95 | return overallStatus; 96 | } 97 | 98 | public void setProperties(List properties) { 99 | this.properties = properties; 100 | } 101 | 102 | public void setTestcase(List testcase) { 103 | this.testcase = testcase; 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/TestngResultsModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @JacksonXmlRootElement(localName = "testng-results") 11 | public class TestngResultsModel { 12 | @JacksonXmlElementWrapper(localName = "suite", useWrapping = false) 13 | @JacksonXmlProperty(localName = "suite") 14 | private final List suites = new ArrayList<>(); 15 | @JacksonXmlProperty 16 | private String skipped; 17 | @JacksonXmlProperty 18 | private String failed; 19 | @JacksonXmlProperty 20 | private String total; 21 | @JacksonXmlProperty 22 | private String passed; 23 | @JacksonXmlProperty 24 | private String ignored; 25 | @JacksonXmlProperty(localName = "reporter-output") 26 | private ReporterOutputModel reporterOutput; 27 | private Long totalTime = (long) 0; 28 | private int totalClasses; 29 | 30 | private int totalClassesTests = 0; 31 | 32 | private int totalClassesFailed = 0; 33 | 34 | private int totalClassesPassed = 0; 35 | 36 | private int totalClassesSkipped = 0; 37 | 38 | public void postProcess() { 39 | for (SuiteModel sm : getSuites()) { 40 | sm.postProcess(); 41 | totalTime += sm.getDurationMs(); 42 | totalClasses += sm.getTotalClasses(); 43 | totalClassesTests += sm.getTotalTests(); 44 | totalClassesFailed += sm.getTotalFailed(); 45 | totalClassesPassed += sm.getTotalPassed(); 46 | totalClassesSkipped += sm.getTotalSkipped(); 47 | } 48 | } 49 | 50 | public String getSkipped() { 51 | return skipped; 52 | } 53 | 54 | public String getFailed() { 55 | return failed; 56 | } 57 | 58 | public String getTotal() { 59 | return total; 60 | } 61 | 62 | public String getPassed() { 63 | return passed; 64 | } 65 | 66 | public List getSuites() { 67 | return suites; 68 | } 69 | 70 | public Long getTotalTime() { 71 | return totalTime; 72 | } 73 | 74 | public int getTotalClasses() { 75 | return totalClasses; 76 | } 77 | 78 | public int getTotalClassesTests() { 79 | return totalClassesTests; 80 | } 81 | 82 | public int getTotalClassesFailed() { 83 | return totalClassesFailed; 84 | } 85 | 86 | public int getTotalClassesPassed() { 87 | return totalClassesPassed; 88 | } 89 | 90 | public int getTotalClassesSkipped() { 91 | return totalClassesSkipped; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/requiredScripts.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 82 | 83 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.github.bogdanlivadariu 5 | bootstraped-multi-test-results-report-reactor-parent 6 | 2.2.3-SNAPSHOT 7 | 8 | junit-reporting-handlebars 9 | jar 10 | junit-reporting-handlebars 11 | Module used to generate JUnit reports using handlebars 12 | https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin/tree/master/junit-reporting-handlebars 13 | 14 | 15 | MIT 16 | https://opensource.org/license/mit/ 17 | repo 18 | 19 | 20 | 21 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 22 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 23 | git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 24 | ${scmTag} 25 | 26 | 27 | 28 | bogdanlivadariu 29 | Bogdan Livadariu 30 | bogdan.livadariu@gmail.com 31 | 32 | 33 | 34 | UTF-8 35 | 36 | 37 | 38 | commons-io 39 | commons-io 40 | 2.11.0 41 | 42 | 43 | com.github.jknack 44 | handlebars 45 | ${handlebars.version} 46 | 47 | 48 | antlr 49 | antlr 50 | 51 | 52 | 53 | 54 | org.apache.logging.log4j 55 | log4j-core 56 | ${log4j-core.version} 57 | 58 | 59 | com.fasterxml.jackson.dataformat 60 | jackson-dataformat-xml 61 | ${jackson-xml.version} 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/ClassModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | import org.testng.reporters.XMLReporterConfig; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | 12 | @JacksonXmlRootElement(localName = "suite") 13 | public class ClassModel { 14 | 15 | @JacksonXmlElementWrapper(localName = "test-method", useWrapping = false) 16 | @JacksonXmlProperty(localName = "test-method") 17 | private final List testMethods = new ArrayList<>(); 18 | private String name; 19 | private String overallStatus = XMLReporterConfig.TEST_PASSED; 20 | 21 | private int totalPassed = 0; 22 | 23 | private int totalFailed = 0; 24 | 25 | private int totalSkipped = 0; 26 | 27 | private int totalTests = 0; 28 | 29 | private long totalDuration = 0; 30 | 31 | public void postProcess() { 32 | for (TestMethodModel tm : getTestMethods()) { 33 | String status = tm.getStatus(); 34 | if (status.equalsIgnoreCase(XMLReporterConfig.TEST_FAILED) 35 | || status.equalsIgnoreCase(XMLReporterConfig.TEST_SKIPPED)) { 36 | overallStatus = XMLReporterConfig.TEST_FAILED; 37 | break; 38 | } 39 | } 40 | for (TestMethodModel tm : getTestMethods()) { 41 | // if the test is a setup / teardown do not count it 42 | totalDuration += tm.getDurationMs(); 43 | if (tm.getIsConfig()) { 44 | continue; 45 | } 46 | totalTests++; 47 | 48 | switch (tm.getStatus().toUpperCase()) { 49 | case XMLReporterConfig.TEST_PASSED: 50 | totalPassed++; 51 | break; 52 | case XMLReporterConfig.TEST_FAILED: 53 | totalFailed++; 54 | break; 55 | case XMLReporterConfig.TEST_SKIPPED: 56 | totalSkipped++; 57 | break; 58 | default: 59 | break; 60 | } 61 | } 62 | } 63 | 64 | public String getName() { 65 | return name.replaceAll(" ", "_"); 66 | } 67 | 68 | public List getTestMethods() { 69 | return testMethods; 70 | } 71 | 72 | public String getOverallStatus() { 73 | return overallStatus; 74 | } 75 | 76 | public int getTotalPassed() { 77 | return totalPassed; 78 | } 79 | 80 | public int getTotalFailed() { 81 | return totalFailed; 82 | } 83 | 84 | public int getTotalSkipped() { 85 | return totalSkipped; 86 | } 87 | 88 | public int getTotalTests() { 89 | return totalTests; 90 | } 91 | 92 | public long getTotalDuration() { 93 | return totalDuration; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.github.bogdanlivadariu 5 | bootstraped-multi-test-results-report-reactor-parent 6 | 2.2.3-SNAPSHOT 7 | 8 | rspec-reporting-handlebars 9 | jar 10 | rspec-reporting-handlebars 11 | Module used to generate RSpec reports using handlebars 12 | https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin/tree/master/rspec-reporting-handlebars 13 | 14 | 15 | MIT 16 | https://opensource.org/license/mit/ 17 | repo 18 | 19 | 20 | 21 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 22 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 23 | git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 24 | ${scmTag} 25 | 26 | 27 | 28 | bogdanlivadariu 29 | Bogdan Livadariu 30 | bogdan.livadariu@gmail.com 31 | 32 | 33 | 34 | UTF-8 35 | 36 | 37 | 38 | commons-io 39 | commons-io 40 | 2.11.0 41 | 42 | 43 | com.github.jknack 44 | handlebars 45 | ${handlebars.version} 46 | 47 | 48 | org.apache.logging.log4j 49 | log4j-core 50 | ${log4j-core.version} 51 | 52 | 53 | 54 | 55 | jakarta.xml.bind 56 | jakarta.xml.bind-api 57 | 4.0.0 58 | 59 | 60 | 61 | 62 | com.sun.xml.bind 63 | jaxb-impl 64 | 4.0.1 65 | runtime 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/test/java/com/github/bogdanlivadariu/reporting/cucumber/builder/CucumberJsTest.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.builder; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertFalse; 5 | import static org.junit.jupiter.api.Assertions.assertTrue; 6 | 7 | import java.io.IOException; 8 | import java.util.ArrayList; 9 | import java.util.Arrays; 10 | import java.util.List; 11 | 12 | import com.github.bogdanlivadariu.reporting.cucumber.helpers.SpecialProperties; 13 | import com.github.bogdanlivadariu.reporting.cucumber.json.models.Tag; 14 | import org.junit.jupiter.api.BeforeEach; 15 | import org.junit.jupiter.api.Test; 16 | 17 | public class CucumberJsTest { 18 | 19 | private CucumberReportBuilder builder; 20 | 21 | private AllFeatureReports reports; 22 | 23 | @BeforeEach 24 | public void setUp() throws IOException { 25 | List jsonReports = new ArrayList<>(); 26 | 27 | String cucumberJsReport = AllFeatureReportsTest.class.getResource("/cucumber-js.json").getPath(); 28 | 29 | jsonReports.add(cucumberJsReport); 30 | 31 | builder = new CucumberReportBuilder(jsonReports, "output", new SpecialProperties()); 32 | reports = new AllFeatureReports("title", builder.getProcessedFeatures()); 33 | 34 | } 35 | 36 | @Test 37 | public void featureSizeTest() { 38 | assertEquals(1, reports.getFeatures().size()); 39 | assertEquals("title", reports.getPageTitle()); 40 | } 41 | 42 | @Test 43 | public void scenariosTest() { 44 | assertEquals(Integer.valueOf(1), reports.getScenariosTotal()); 45 | assertEquals(Integer.valueOf(1), reports.getScenariosTotalFailed()); 46 | assertEquals(Integer.valueOf(0), reports.getScenariosTotalPassed()); 47 | } 48 | 49 | @Test 50 | public void featureTagTest() { 51 | List existingTags = new ArrayList<>(); 52 | for (Tag t : reports.getFeatures().get(0).getTags()) { 53 | existingTags.add(t.getName() + t.getLine()); 54 | } 55 | assertEquals(Arrays.asList("@letter_tag3"), existingTags); 56 | } 57 | 58 | @Test 59 | public void scenariosTagTest() { 60 | List existingTags = new ArrayList<>(); 61 | for (Tag t : reports.getFeatures().get(0).getElements()[0].getTags()) { 62 | existingTags.add(t.getName() + t.getLine()); 63 | } 64 | assertEquals(Arrays.asList("@PROD3"), existingTags); 65 | } 66 | 67 | @Test 68 | public void stepsTest() { 69 | assertEquals(Integer.valueOf(6), reports.getStepsTotal()); 70 | assertEquals(Integer.valueOf(0), reports.getStepsTotalFailed()); 71 | assertEquals(Integer.valueOf(4), reports.getStepsTotalPassed()); 72 | assertEquals(Integer.valueOf(1), reports.getStepsTotalSkipped()); 73 | assertEquals(Integer.valueOf(1), reports.getStepsTotalUndefined()); 74 | } 75 | 76 | @Test 77 | public void hidenTest() { 78 | assertTrue(reports.getFeatures().get(0).getElements()[0].getSteps()[5].isHidden()); 79 | } 80 | 81 | @Test 82 | public void builderShouldFail() throws IOException { 83 | assertFalse(builder.writeReportsOnDisk()); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/test/resources/cucumber-js.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "Campaign-Letter-Library", 4 | "name": "Campaign Letter Library", 5 | "description": "", 6 | "line": 1, 7 | "keyword": "Feature", 8 | "uri": "/home/apentsak/Work/AGIT/registry-tests-ui/tests-ui-js/src/test/features/letterlibrary_campaign.feature", 9 | "tags": [ 10 | { 11 | "line": 3, 12 | "name": "@letter_tag" 13 | } 14 | ], 15 | "elements": [ 16 | { 17 | "name": "Save with empty Title and Content", 18 | "id": "Campaign-Letter-Library;save-with-empty-title-and-content", 19 | "line": 16, 20 | "keyword": "Scenario", 21 | "description": "", 22 | "type": "scenario", 23 | "tags": [ 24 | { 25 | "name": "@PROD", 26 | "line": 3 27 | } 28 | ], 29 | "steps": [ 30 | { 31 | "name": "I am on the login page", 32 | "line": 5, 33 | "keyword": "Given ", 34 | "result": { 35 | "status": "skipped", 36 | "duration": 2802379579 37 | }, 38 | "match": { 39 | "location": "/home/apentsak/Work/AGIT/registry-tests-ui/tests-ui-js/src/test/features/step_definitions/assessments/assessments_steps.js:40" 40 | } 41 | }, 42 | { 43 | "name": "User has logged into the System as \"Administrator\" and \"123qweasd\" password", 44 | "line": 6, 45 | "keyword": "Then ", 46 | "result": { 47 | "status": "passed", 48 | "duration": 14285269526 49 | }, 50 | "match": { 51 | "location": "/home/apentsak/Work/AGIT/registry-tests-ui/tests-ui-js/src/test/features/step_definitions/assessments/assessments_steps.js:51" 52 | } 53 | }, 54 | { 55 | "name": "User open \"Campaign Letter Library\" page", 56 | "line": 7, 57 | "keyword": "And ", 58 | "result": { 59 | "status": "passed", 60 | "duration": 4269813014 61 | }, 62 | "match": { 63 | "location": "/home/apentsak/Work/AGIT/registry-tests-ui/tests-ui-js/src/test/features/step_definitions/letterlibrary/letterlibrary_steps.js:8" 64 | } 65 | }, 66 | { 67 | "name": "User add population \"Tesha\"", 68 | "line": 8, 69 | "keyword": "Then ", 70 | "result": { 71 | "status": "passed", 72 | "duration": 101267676 73 | }, 74 | "match": { 75 | "location": "/home/apentsak/Work/AGIT/registry-tests-ui/tests-ui-js/src/test/features/step_definitions/letterlibrary/letterlibrary_steps.js:14" 76 | } 77 | }, 78 | { 79 | "name": "User click \"Save\" button", 80 | "line": 9, 81 | "keyword": "When ", 82 | "result": { 83 | "status": "undefined" 84 | } 85 | }, 86 | { 87 | "keyword": "After ", 88 | "hidden": true, 89 | "result": { 90 | "status": "passed", 91 | "duration": 463463047 92 | }, 93 | "match": { 94 | "location": "/home/apentsak/Work/AGIT/registry-tests-ui/tests-ui-js/src/test/features/step_definitions/support/world.js:11" 95 | } 96 | } 97 | ] 98 | } 99 | ] 100 | } 101 | ] -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/requiredScripts.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 89 | 90 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/requiredScripts.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 89 | 90 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/xml/models/SuiteModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; 5 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 6 | import org.testng.reporters.XMLReporterConfig; 7 | 8 | import java.util.*; 9 | 10 | @JacksonXmlRootElement(localName = "suite") 11 | public class SuiteModel { 12 | 13 | @JacksonXmlElementWrapper(localName = "test", useWrapping = false) 14 | @JacksonXmlProperty(localName = "test") 15 | private final List tests = new ArrayList<>(); 16 | @JacksonXmlElementWrapper(localName = "groups") 17 | private final List groups = new ArrayList<>(); 18 | private String name; 19 | @JacksonXmlProperty(localName = "duration-ms") 20 | private Long durationMs; 21 | @JacksonXmlProperty(localName = "started-at") 22 | private String startedAt; 23 | @JacksonXmlProperty(localName = "finished-at") 24 | private String finishedAt; 25 | private int totalPassed = 0; 26 | 27 | private int totalFailed = 0; 28 | 29 | private int totalSkipped = 0; 30 | 31 | private int totalTests = 0; 32 | 33 | private String overallStatus; 34 | 35 | private String uniqueID; 36 | 37 | private int totalClasses = 0; 38 | 39 | private LinkedHashMap> groupedTestMethods; 40 | 41 | // @SuppressWarnings("unchecked") 42 | // public static > T cast(Object obj) { 43 | // return (T) obj; 44 | // } 45 | 46 | public void postProcess() { 47 | groupedTestMethods = new LinkedHashMap<>(); 48 | uniqueID = UUID.randomUUID().toString(); 49 | for (TestModel tm : getTests()) { 50 | tm.postProcess(); 51 | totalPassed += tm.getTotalPassed(); 52 | totalFailed += tm.getTotalFailed(); 53 | totalSkipped += tm.getTotalSkipped(); 54 | totalClasses += tm.getClasses().size(); 55 | } 56 | if (totalFailed > 0 || totalSkipped > 0) { 57 | overallStatus = XMLReporterConfig.TEST_FAILED; 58 | } 59 | totalTests = totalPassed + totalFailed + totalSkipped; 60 | } 61 | 62 | public String getName() { 63 | return name; 64 | } 65 | 66 | public Long getDurationMs() { 67 | return durationMs; 68 | } 69 | 70 | public String getStartedAt() { 71 | return startedAt; 72 | } 73 | 74 | public String getFinishedAt() { 75 | return finishedAt; 76 | } 77 | 78 | public List getTests() { 79 | return tests; 80 | } 81 | 82 | public int getTotalPassed() { 83 | return totalPassed; 84 | } 85 | 86 | public int getTotalFailed() { 87 | return totalFailed; 88 | } 89 | 90 | public int getTotalSkipped() { 91 | return totalSkipped; 92 | } 93 | 94 | public List getGroups() { 95 | return groups; 96 | } 97 | 98 | public int getTotalTests() { 99 | return totalTests; 100 | } 101 | 102 | public String getOverallStatus() { 103 | return overallStatus; 104 | } 105 | 106 | public String getUniqueID() { 107 | return uniqueID; 108 | } 109 | 110 | public Map> getGroupedTestMethods() { 111 | return groupedTestMethods; 112 | } 113 | 114 | public int getTotalClasses() { 115 | return totalClasses; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/testOverviewReport.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{this.pageTitle}} 5 | 6 | 7 | 8 | {{> rspec-reporting/requiredScripts}} 9 | {{> rspec-reporting/menu}} 10 | 11 |
12 | 32 | {{> rspec-reporting/highchartsScripts}} 33 | 34 |
35 | 36 |
RSpec test report
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {{#each allTestSuites}} 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {{/each}} 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 |
Overall status
Test Suite NameTestsFailuresErrorsSkippedDuration
{{name}}{{tests}}{{failures}}{{errors}}{{skipped}}{{#date time}}{{/date}}
TOTALS: {{suitesCount}}{{totalTests}}{{totalFailures}}{{totalErrors}}{{totalSkipped}}{{#date totalTime}}{{/date}}
78 |
79 | 82 | 83 | 90 | 91 | {{> rspec-reporting/analitics}} 92 | {{> rspec-reporting/scrollTopScript}} 93 | {{> rspec-reporting/footer}} 94 | 95 | 96 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/testOverviewReport.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{this.pageTitle}} 5 | 6 | 7 | 8 | {{> junit-reporting/requiredScripts}} 9 | {{> junit-reporting/menu}} 10 | 11 |
12 | 32 | {{> junit-reporting/highchartsScripts}} 33 | 34 |
35 | 36 |
JUnit test report
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | {{#each allTestSuites}} 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | {{/each}} 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 |
Overall status
Test Suite NameTestsFailuresErrorsSkippedDuration
{{name}}{{tests}}{{failures}}{{errors}}{{skipped}}{{#date time}}{{/date}}
TOTALS: {{suitesCount}}{{totalTests}}{{totalFailures}}{{totalErrors}}{{totalSkipped}}{{#date totalTime}}{{/date}}
78 |
79 | 82 | 83 | 90 | 91 | {{> junit-reporting/analitics}} 92 | {{> junit-reporting/scrollTopScript}} 93 | {{> junit-reporting/footer}} 94 | 95 | 96 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/junit/xml/models/TestSuitesModel.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.junit.xml.models; 2 | 3 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; 4 | import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; 5 | import com.github.bogdanlivadariu.reporting.junit.helpers.Constants; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.UUID; 10 | 11 | //@XmlRootElement(name = "testsuites") 12 | //@XmlAccessorType(XmlAccessType.FIELD) 13 | @JacksonXmlRootElement(localName = "testsuites") 14 | public class TestSuitesModel { 15 | // @XmlAttribute 16 | private String failures; 17 | 18 | // @XmlAttribute 19 | private String time; 20 | 21 | // @XmlAttribute 22 | private String errors; 23 | 24 | // @XmlAttribute 25 | private String tests; 26 | 27 | // @XmlAttribute 28 | private String name; 29 | 30 | private String uniqueID; 31 | 32 | private String overallStatus; 33 | 34 | // @XmlElement(name = "testsuite") 35 | @JacksonXmlElementWrapper(localName = "testsuite", useWrapping = false) 36 | private List testsuite; 37 | 38 | private Boolean hasMissingAttributes() { 39 | return failures == null || time == null || errors == null || tests == null; 40 | } 41 | 42 | public void postProcess() { 43 | uniqueID = UUID.randomUUID().toString(); 44 | 45 | if (hasMissingAttributes()) { 46 | int failuresCount = 0; 47 | int errorsCount = 0; 48 | Double totalTime = 0.0; 49 | 50 | for (TestSuiteModel suite : getTestsuite()) { 51 | if (suite.getOverallStatus().equals(Constants.FAILED)) { 52 | failuresCount++; 53 | } else if (suite.getOverallStatus().equals(Constants.ERRORED)) { 54 | errorsCount++; 55 | } 56 | totalTime += Double.parseDouble(suite.getTime()); 57 | } 58 | 59 | // update fields if necessary 60 | if (failures == null) { 61 | failures = Integer.toString(failuresCount); 62 | } 63 | if (tests == null) { 64 | tests = Integer.toString(getTestsuite().size()); 65 | } 66 | if (time == null) { 67 | time = Double.toString(totalTime); 68 | } 69 | if (errors == null) { 70 | errors = Integer.toString(errorsCount); 71 | } 72 | } 73 | 74 | if (Integer.parseInt(failures) > 0 || Integer.parseInt(errors) > 0) { 75 | overallStatus = Constants.FAILED; 76 | } else { 77 | overallStatus = Constants.PASSED; 78 | } 79 | } 80 | 81 | public String getUniqueID() { 82 | return uniqueID; 83 | } 84 | 85 | public String getFailures() { 86 | return failures; 87 | } 88 | 89 | public String getTime() { 90 | return time.replace(",", ""); 91 | } 92 | 93 | public String getErrors() { 94 | return errors; 95 | } 96 | 97 | public String getTests() { 98 | return tests; 99 | } 100 | 101 | public String getName() { 102 | return name; 103 | } 104 | 105 | public List getTestsuite() { 106 | return testsuite == null ? new ArrayList() : testsuite; 107 | } 108 | 109 | public void setTestsuite(List testsuite) { 110 | this.testsuite = testsuite; 111 | } 112 | 113 | public String getOverallStatus() { 114 | return overallStatus; 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/builder/AllFeatureReports.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.builder; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.LinkedHashSet; 6 | import java.util.List; 7 | import java.util.Set; 8 | 9 | import com.github.bogdanlivadariu.reporting.cucumber.helpers.Constants; 10 | import com.github.bogdanlivadariu.reporting.cucumber.json.models.Feature; 11 | import com.github.bogdanlivadariu.reporting.cucumber.json.models.Tag; 12 | 13 | public class AllFeatureReports { 14 | 15 | private String pageTitle; 16 | 17 | private List features; 18 | 19 | private Integer scenariosTotal = 0; 20 | 21 | private Integer scenariosTotalPassed = 0; 22 | 23 | private Integer scenariosTotalFailed = 0; 24 | 25 | private Integer stepsTotal = 0; 26 | 27 | private Integer stepsTotalPassed = 0; 28 | 29 | private Integer stepsTotalFailed = 0; 30 | 31 | private Integer stepsTotalSkipped = 0; 32 | 33 | private Integer stepsTotalUndefined = 0; 34 | 35 | private long totalDuration; 36 | 37 | private Set allTags = new LinkedHashSet(); 38 | 39 | public AllFeatureReports(String pageTitle, List features) { 40 | this.features = features; 41 | this.pageTitle = pageTitle; 42 | for (Feature feature : this.features) { 43 | scenariosTotal += feature.getElements().length; 44 | scenariosTotalPassed += feature.getScenariosPassedCount(); 45 | scenariosTotalFailed += feature.getScenariosFailedCount(); 46 | 47 | stepsTotal += feature.getStepsTotalCount(); 48 | stepsTotalPassed += feature.getStepsPassedCount(); 49 | stepsTotalFailed += feature.getStepsFailedCount(); 50 | stepsTotalSkipped += feature.getStepsSkippedCount(); 51 | stepsTotalUndefined += feature.getStepsUndefinedCount(); 52 | 53 | totalDuration += feature.getTotalDuration(); 54 | 55 | if (feature.getTags().length < 1) { 56 | allTags.add(Constants.UNTAGGED); 57 | } else { 58 | for (Tag tag : feature.getTags()) { 59 | allTags.add(tag.getName()); 60 | } 61 | } 62 | } 63 | } 64 | 65 | public List getFeatures() { 66 | return features; 67 | } 68 | 69 | public Integer getScenariosTotal() { 70 | return scenariosTotal; 71 | } 72 | 73 | public Integer getScenariosTotalPassed() { 74 | return scenariosTotalPassed; 75 | } 76 | 77 | public Integer getScenariosTotalFailed() { 78 | return scenariosTotalFailed; 79 | } 80 | 81 | public Integer getStepsTotal() { 82 | return stepsTotal; 83 | } 84 | 85 | public Integer getStepsTotalPassed() { 86 | return stepsTotalPassed; 87 | } 88 | 89 | public Integer getStepsTotalFailed() { 90 | return stepsTotalFailed; 91 | } 92 | 93 | public Integer getStepsTotalSkipped() { 94 | return stepsTotalSkipped; 95 | } 96 | 97 | public Integer getStepsTotalUndefined() { 98 | return stepsTotalUndefined; 99 | } 100 | 101 | public long getTotalDuration() { 102 | return totalDuration; 103 | } 104 | 105 | public Integer getFeaturesCount() { 106 | return features.size(); 107 | } 108 | 109 | public String getPageTitle() { 110 | return pageTitle; 111 | } 112 | 113 | public List getAllTags() { 114 | // Collections.sort(allTags); 115 | List sortegTags = new ArrayList(allTags); 116 | Collections.sort(sortegTags); 117 | return sortegTags; 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/testng/helpers/Helpers.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.testng.helpers; 2 | 3 | import com.github.jknack.handlebars.Handlebars; 4 | import com.github.jknack.handlebars.Helper; 5 | 6 | import java.security.NoSuchAlgorithmException; 7 | import java.text.SimpleDateFormat; 8 | import java.util.Calendar; 9 | import java.util.Date; 10 | import java.util.TimeZone; 11 | 12 | import static com.github.bogdanlivadariu.reporting.testng.helpers.Constants.*; 13 | 14 | public class Helpers { 15 | public static final String PROBLEM_SETTING_STATUS = 16 | "there was a problem setting the tooltip of the test, status might differ, investigate"; 17 | 18 | private final Handlebars handlebar; 19 | 20 | public Helpers(Handlebars handlebar) { 21 | this.handlebar = handlebar; 22 | } 23 | 24 | public Handlebars registerHelpers() { 25 | handlebar.registerHelper("date", (Helper) (arg0, arg1) -> { 26 | int totalSecs = (int) arg0.doubleValue() / 1000; 27 | int hours = totalSecs / 3600; 28 | int minutes = (totalSecs % 3600) / 60; 29 | int seconds = totalSecs % 60; 30 | int miliSec = (int) arg0.doubleValue() % 1000; 31 | 32 | return String.format("%02d h : %02d m : %02d s : %02d ms", hours, minutes, seconds, miliSec); 33 | }); 34 | 35 | handlebar.registerHelper("result-color", (Helper) (arg0, arg1) -> checkStatus(arg0.toLowerCase(), "info", "success", "danger", null)); 36 | 37 | handlebar.registerHelper("is-config", (Helper) (arg0, arg1) -> getIsConfigApplyResult(arg0)); 38 | 39 | handlebar.registerHelper("resolve-tooltip", (Helper) (arg0, arg1) -> checkStatus(arg0.toLowerCase(), "This test has been skipped", "This test has passed", 40 | "This test has failed", PROBLEM_SETTING_STATUS)); 41 | 42 | handlebar.registerHelper("resolve-title", (Helper) (arg0, arg1) -> checkStatus(arg0.toLowerCase(), "This step has been skipped", "This step has passed", 43 | "This step has failed", null)); 44 | 45 | handlebar.registerHelper("is-collapsed", (Helper) (arg0, arg1) -> checkStatus(arg0.toLowerCase(), null, "collapse", "collapse in", null)); 46 | 47 | handlebar.registerHelper("now", (context, options) -> { 48 | Calendar cal = Calendar.getInstance(); 49 | Date date = cal.getTime(); 50 | String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").format(date); 51 | TimeZone tz = cal.getTimeZone(); 52 | return now + " " + tz.getID(); 53 | }); 54 | 55 | handlebar.registerHelper("md5", md5Helper()); 56 | 57 | return handlebar; 58 | } 59 | 60 | private Helper md5Helper() { 61 | return (arg0, arg1) -> { 62 | try { 63 | return StringUtils.getMd5From(arg0 + arg1.param(0)); 64 | } catch (NoSuchAlgorithmException e) { 65 | return "ERR"; 66 | } 67 | }; 68 | } 69 | 70 | private CharSequence getIsConfigApplyResult(Boolean arg0) { 71 | if (arg0) { 72 | return "collapseMagic2 collapse"; 73 | } else { 74 | return "nada"; 75 | } 76 | } 77 | 78 | private CharSequence checkStatus(String arg0, String retValue1, String retValue2, String retValue3, 79 | String retValue4) { 80 | switch (arg0.toUpperCase()) { 81 | case SKIPPED: 82 | return retValue1; 83 | case PASSED: 84 | return retValue2; 85 | case FAILED: 86 | return retValue3; 87 | default: 88 | break; 89 | } 90 | return retValue4 == null ? UNDEFINED : retValue4; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | com.github.bogdanlivadariu 4 | bootstraped-multi-test-results-report-reactor-parent 5 | Bootstrap multi test report builder 6 | 12 | 2.2.3-SNAPSHOT 13 | pom 14 | Parent module for com.github.bogdanlivadariu jenkins dependency modules 15 | https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin 16 | 17 | 18 | 19 | MIT 20 | https://opensource.org/license/mit/ 21 | repo 22 | 23 | 24 | 25 | scm:git:https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin.git 26 | https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin.git 27 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report-plugin.git 28 | ${scmTag} 29 | 30 | 31 | 32 | bogdanlivadariu 33 | Bogdan Livadariu 34 | bogdan.livadariu@gmail.com 35 | 36 | 37 | 38 | 2.2.1 39 | 2.2.1 40 | 2.2.1 41 | 2.2.1 42 | 4.3.1 43 | 7.7.1 44 | 2.12.5 45 | 2.20.0 46 | 2.10.1 47 | 2.14.2 48 | 49 | 50 | 51 | cucumber-reporting-handlebars 52 | junit-reporting-handlebars 53 | testng-reporting-handlebars 54 | rspec-reporting-handlebars 55 | bootstraped-multi-test-results-report 56 | 57 | 58 | 59 | org.junit.jupiter 60 | junit-jupiter-api 61 | 5.9.2 62 | test 63 | 64 | 65 | 66 | 67 | 68 | org.apache.maven.plugins 69 | maven-compiler-plugin 70 | 3.11.0 71 | 72 | 11 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/testsByNameOverview.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{this.pageTitle}} 5 | 6 | 7 | 8 | {{> testng-reporting/requiredScripts}} 9 | {{> testng-reporting/menu}} 10 | 11 |
12 | 29 | 30 | {{> testng-reporting/highchartsScripts}} 31 | 32 |
33 | 34 |
TestNG test report
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | {{#each allTestSuites}} 54 | {{#each suites}} 55 | {{#each tests}} 56 | {{#each classes}} 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 69 | 70 | {{/each}} 71 | {{/each}} 72 | {{/each}} 73 | {{/each}} 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 87 | 88 | 89 |
Overall status
Test nameTestsPassedFailuresSkippedDuration
{{../name}}{{totalTests}}{{totalPassed}}{{totalFailed}}{{totalSkipped}} 65 | 66 | {{#date totalDuration}}{{/date}} 67 | 68 |
TOTALS: {{totalClasses}}{{totalTests}}{{totalPassed}}{{totalFailed}}{{totalSkipped}} 83 | 84 | {{#date totalTime}}{{/date}} 85 | 86 |
90 |
91 | 94 | 95 | 102 | 103 | {{> testng-reporting/analitics}} 104 | {{> testng-reporting/scrollTopScript}} 105 | {{> testng-reporting/footer}} 106 | 107 | 108 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/src/main/resources/testng-reporting/testsByClassOverview.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{this.pageTitle}} 5 | 6 | 7 | 8 | {{> testng-reporting/requiredScripts}} 9 | {{> testng-reporting/menu}} 10 | 11 |
12 | 29 | 30 | {{> testng-reporting/highchartsScripts}} 31 | 32 |
33 | 34 |
TestNG test report
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {{#each allTestSuites}} 55 | {{#each suites}} 56 | {{#each tests}} 57 | {{#each classes}} 58 | 59 | 60 | 61 | 62 | 63 | 64 | 69 | 70 | {{/each}} 71 | {{/each}} 72 | {{/each}} 73 | {{/each}} 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 87 | 88 | 89 |
Overall status
Test nameTestsPassedFailuresSkippedDuration
{{name}}{{totalTests}}{{totalPassed}}{{totalFailed}}{{totalSkipped}} 65 | 66 | {{#date totalDuration}}{{/date}} 67 | 68 |
TOTALS: {{totalClasses}}{{totalTests}}{{totalPassed}}{{totalFailed}}{{totalSkipped}} 83 | 84 | {{#date totalTime}}{{/date}} 85 | 86 |
90 |
91 | 94 | 95 | 102 | 103 | {{> testng-reporting/analitics}} 104 | {{> testng-reporting/scrollTopScript}} 105 | {{> testng-reporting/footer}} 106 | 107 | 108 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/java/com/github/bogdanlivadariu/reporting/cucumber/json/models/Feature.java: -------------------------------------------------------------------------------- 1 | package com.github.bogdanlivadariu.reporting.cucumber.json.models; 2 | 3 | import static com.github.bogdanlivadariu.reporting.cucumber.helpers.Constants.FAILED; 4 | import static com.github.bogdanlivadariu.reporting.cucumber.helpers.Constants.PASSED; 5 | 6 | import java.util.UUID; 7 | 8 | import com.github.bogdanlivadariu.reporting.cucumber.helpers.Constants; 9 | import com.github.bogdanlivadariu.reporting.cucumber.helpers.SpecialProperties; 10 | 11 | /** 12 | * Represents a Feature. 13 | */ 14 | public class Feature { 15 | 16 | private String pageTitle; 17 | 18 | private String uniqueID; 19 | 20 | private String id; 21 | 22 | private String name; 23 | 24 | private String description; 25 | 26 | private Integer line; 27 | 28 | private String keyword; 29 | 30 | private Tag[] tags; 31 | 32 | private String uri; 33 | 34 | private Element[] elements; 35 | 36 | private long totalDuration; 37 | 38 | private String overallStatus = PASSED; 39 | 40 | private Integer scenariosPassedCount = 0; 41 | 42 | private Integer scenariosFailedCount = 0; 43 | 44 | private Integer stepsTotalCount = 0; 45 | 46 | private Integer stepsPassedCount = 0; 47 | 48 | private Integer stepsFailedCount = 0; 49 | 50 | private Integer stepsSkippedCount = 0; 51 | 52 | private Integer stepsUndefinedCount = 0; 53 | 54 | private String outputFileLocation; 55 | 56 | public String getOutputFileLocation() { 57 | return outputFileLocation; 58 | } 59 | 60 | public void setOutputFileLocation(String outputFileLocation) { 61 | this.outputFileLocation = outputFileLocation; 62 | } 63 | 64 | public Feature postProcess(SpecialProperties props) { 65 | pageTitle = Constants.FEATURE_SUMMARY_REPORT; 66 | uniqueID = UUID.randomUUID().toString(); 67 | outputFileLocation = "feature-reports/" + uniqueID + ".html"; 68 | for (Element el : elements) { 69 | el.postProcess(props); 70 | totalDuration += el.getTotalDuration(); 71 | stepsTotalCount += el.getStepsTotalCount(); 72 | stepsPassedCount += el.getStepsPassedCount(); 73 | stepsFailedCount += el.getStepsFailedCount(); 74 | stepsSkippedCount += el.getStepsSkippedCount(); 75 | stepsUndefinedCount += el.getStepsUndefinedCount(); 76 | 77 | if (el.getOverallStatus().equals(PASSED)) { 78 | scenariosPassedCount++; 79 | } else { 80 | scenariosFailedCount++; 81 | } 82 | } 83 | 84 | if (scenariosFailedCount > 0) { 85 | overallStatus = FAILED; 86 | } 87 | return this; 88 | } 89 | 90 | public Integer getScenariosCount() { 91 | return elements.length; 92 | } 93 | 94 | public String getId() { 95 | return id; 96 | } 97 | 98 | public String getName() { 99 | return name; 100 | } 101 | 102 | public String getDescription() { 103 | return description; 104 | } 105 | 106 | public Integer getLine() { 107 | return line; 108 | } 109 | 110 | public String getKeyword() { 111 | return keyword; 112 | } 113 | 114 | public Tag[] getTags() { 115 | return tags == null ? new Tag[] {} : tags; 116 | } 117 | 118 | public String getUri() { 119 | return uri; 120 | } 121 | 122 | public Element[] getElements() { 123 | return elements; 124 | } 125 | 126 | public Integer getStepsSkippedCount() { 127 | return stepsSkippedCount; 128 | } 129 | 130 | public Integer getStepsUndefinedCount() { 131 | return stepsUndefinedCount; 132 | } 133 | 134 | public Integer getStepsFailedCount() { 135 | return stepsFailedCount; 136 | } 137 | 138 | public Integer getStepsPassedCount() { 139 | return stepsPassedCount; 140 | } 141 | 142 | public Integer getScenariosFailedCount() { 143 | return scenariosFailedCount; 144 | } 145 | 146 | public Integer getStepsTotalCount() { 147 | return stepsTotalCount; 148 | } 149 | 150 | public long getTotalDuration() { 151 | return totalDuration; 152 | } 153 | 154 | public Integer getScenariosPassedCount() { 155 | return scenariosPassedCount; 156 | } 157 | 158 | public String getOverallStatus() { 159 | return overallStatus; 160 | } 161 | 162 | public String getUniqueID() { 163 | return uniqueID; 164 | } 165 | 166 | public String getPageTitle() { 167 | return pageTitle; 168 | } 169 | 170 | } 171 | -------------------------------------------------------------------------------- /cucumber-reporting-handlebars/src/main/resources/cucumber-reporting/requiredScripts.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 112 | 113 | -------------------------------------------------------------------------------- /testng-reporting-handlebars/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.github.bogdanlivadariu 5 | bootstraped-multi-test-results-report-reactor-parent 6 | 2.2.3-SNAPSHOT 7 | 8 | 9 | testng-reporting-handlebars 10 | jar 11 | testng-reporting-handlebars 12 | Module used to generate TestNG reports using handlebars 13 | https://github.com/jenkinsci/bootstraped-multi-test-results-report-plugin/tree/master/testng-reporting-handlebars 14 | 15 | 16 | MIT 17 | https://opensource.org/license/mit/ 18 | repo 19 | 20 | 21 | 22 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 23 | scm:git:git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 24 | git@github.com:jenkinsci/bootstraped-multi-test-results-report.git 25 | ${scmTag} 26 | 27 | 28 | 29 | bogdanlivadariu 30 | Bogdan Livadariu 31 | bogdan.livadariu@gmail.com 32 | 33 | 34 | 35 | UTF-8 36 | 11 37 | 11 38 | 39 | 40 | 41 | 42 | maven-assembly-plugin 43 | 44 | 45 | 46 | true 47 | com.github.bogdanlivadariu.reporting.testng.cli.TestNgReportBuilderCli 48 | 49 | 50 | 51 | 52 | jar-with-dependencies 53 | 54 | 55 | 56 | 57 | make-my-jar-with-dependencies 58 | package 59 | 60 | single 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | commons-io 70 | commons-io 71 | 2.11.0 72 | 73 | 74 | com.github.jknack 75 | handlebars 76 | ${handlebars.version} 77 | 78 | 79 | antlr 80 | antlr 81 | 82 | 83 | 84 | 85 | org.apache.logging.log4j 86 | log4j-core 87 | ${log4j-core.version} 88 | 89 | 90 | joda-time 91 | joda-time 92 | ${joda-time.version} 93 | 94 | 95 | org.testng 96 | testng 97 | ${testng.version} 98 | 99 | 100 | com.fasterxml.jackson.dataformat 101 | jackson-dataformat-xml 102 | ${jackson-xml.version} 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /rspec-reporting-handlebars/src/main/resources/rspec-reporting/testCaseSummaryReport.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test suite report 5 | 6 | 7 | 8 | {{> rspec-reporting/menu}} 9 | {{> rspec-reporting/requiredScripts}} 10 |
11 | 30 | 31 |
32 |
33 | 41 | {{#date time}}{{/date}} 42 |

43 |

44 | {{name}} 45 |

46 |

47 |
48 |
49 |
    50 | {{#each testcase}} 51 |
  • 55 | 56 | 57 | {{name}} 58 | 59 | 60 | {{#date time}}{{/date}} 61 | 62 |
    63 | {{#if failure}} 64 |
      65 |
    • 67 |
      68 | Message: 69 |
      {{failure.value}}
      70 |
      71 | {{#if systemOut}} 72 | System-out: 73 |
      {{systemOut}}
      74 | {{/if}} 75 | {{#if systemErr}} 76 | System-Err: 77 |
      {{systemErr}}
      78 | {{/if}} 79 |
    • 80 |
    81 | {{/if}} 82 | {{#if error}} 83 |
      84 |
    • 86 |
      87 | Message: 88 |
      {{error.value}}
      89 |
      90 | {{#if systemOut}} 91 | System-out: 92 |
      {{systemOut}}
      93 | {{/if}} 94 | {{#if systemErr}} 95 | System-Err: 96 |
      {{systemErr}}
      97 | {{/if}} 98 |
    • 99 |
    100 | {{/if}} 101 |
    102 |
  • 103 | {{/each}} 104 |
105 |
106 |
107 | 110 | {{> rspec-reporting/highchartsScripts}} 111 | {{> rspec-reporting/analitics}} 112 | {{> rspec-reporting/scrollTopScript}} 113 | {{> rspec-reporting/footer}} 114 | 115 | 116 | -------------------------------------------------------------------------------- /junit-reporting-handlebars/src/main/resources/junit-reporting/testCaseSummaryReport.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test suite report 5 | 6 | 7 | 8 | {{> junit-reporting/menu}} 9 | {{> junit-reporting/requiredScripts}} 10 |
11 | 30 | 31 |
32 |
33 | 41 | {{#date time}}{{/date}} 42 |

43 |

44 | {{name}} 45 |

46 |

47 |
48 |
49 |
    50 | {{#each testcase}} 51 |
  • 55 | 56 | 57 | {{name}} 58 | 59 | 60 | {{#date time}}{{/date}} 61 | 62 |
    63 | {{#if failure}} 64 |
      65 |
    • 67 |
      68 | Message: {{failure.message}} 69 |
      {{failure.value}}
      70 |
      71 | {{#if systemOut}} 72 | System-out: 73 |
      {{systemOut}}
      74 | {{/if}} 75 | {{#if systemErr}} 76 | System-Err: 77 |
      {{systemErr}}
      78 | {{/if}} 79 |
    • 80 |
    81 | {{/if}} 82 | {{#if error}} 83 |
      84 |
    • 86 |
      87 | Message: 88 |
      {{error.value}}
      89 |
      90 | {{#if systemOut}} 91 | System-out: 92 |
      {{systemOut}}
      93 | {{/if}} 94 | {{#if systemErr}} 95 | System-Err: 96 |
      {{systemErr}}
      97 | {{/if}} 98 |
    • 99 |
    100 | {{/if}} 101 |
    102 |
  • 103 | {{/each}} 104 |
105 |
106 |
107 | 110 | {{> junit-reporting/highchartsScripts}} 111 | {{> junit-reporting/analitics}} 112 | {{> junit-reporting/scrollTopScript}} 113 | {{> junit-reporting/footer}} 114 | 115 | 116 | --------------------------------------------------------------------------------