Git Product home page Git Product logo

cucumber-reporting's Introduction

Travis Status AppVeyor Status Shippable Status Live Demo

Coverage Status Maintainability Rating Security Rating Codacy Codebeat Vulnerabilities

Maven Central License Contributors

Publish pretty cucumber reports

This is a Java report publisher primarily created to publish cucumber reports on the Jenkins build server. It publishes pretty html reports with charts showing the results of cucumber runs. It has been split out into a standalone package so it can be used for Jenkins and maven command line as well as any other packaging that might be useful. Generated report has no dependency so can be viewed offline.

Background

Cucumber is a test automation tool following the principles of Behavioural Driven Design and living documentation. Specifications are written in a concise human readable form and executed in continuous integration.

This project allows you to publish the results of a cucumber run as pretty html reports. In order for this to work you must generate a cucumber json report. The project converts the json report into an overview html linking to separate feature files with stats and results.

Install

Add a maven dependency to your pom

<dependency>
    <groupId>net.masterthought</groupId>
    <artifactId>cucumber-reporting</artifactId>
    <version>(check version above)</version>
</dependency>

Read this if you need further detailed configuration instructions for using the Jenkins version of this project

Usage

File reportOutputDirectory = new File("target");
List<String> jsonFiles = new ArrayList<>();
jsonFiles.add("cucumber-report-1.json");
jsonFiles.add("cucumber-report-2.json");

String buildNumber = "1";
String projectName = "cucumberProject";

Configuration configuration = new Configuration(reportOutputDirectory, projectName);
// optional configuration - check javadoc for details
configuration.addPresentationModes(PresentationMode.RUN_WITH_JENKINS);
// do not make scenario failed when step has status SKIPPED
configuration.setNotFailingStatuses(Collections.singleton(Status.SKIPPED));
configuration.setBuildNumber(buildNumber);
// addidtional metadata presented on main page
configuration.addClassifications("Platform", "Windows");
configuration.addClassifications("Browser", "Firefox");
configuration.addClassifications("Branch", "release/1.0");

// optionally add metadata presented on main page via properties file
List<String> classificationFiles = new ArrayList<>();
classificationFiles.add("properties-1.properties");
classificationFiles.add("properties-2.properties");
configuration.addClassificationFiles(classificationFiles);

ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration);
Reportable result = reportBuilder.generateReports();
// and here validate 'result' to decide what to do if report has failed

There is a feature overview page:

feature overview page

And there are also feature specific results pages:

feature specific page passing

And useful information for failures:

feature specific page passing

If you have tags in your cucumber features you can see a tag overview:

Tag overview

And you can drill down into tag specific reports:

Tag report

Trends report

Continuous delivery and live demo

You can play with the live demo report before you decide if this is worth to use. Report is generated every time new change is merged into the main development branch so it always refers to the most recent version of this project. Sample configuration is provided by sample code.

Code quality

Once you developed your new feature or improvement you should test it by providing several unit or integration tests.

codecov.io

BrowserStack

We use BrowserStack to examine HTML report against different browsers and platforms. BrowserStack

Contribution

Interested in contributing to the cucumber-reporting? Great! Start here.

cucumber-reporting's People

Contributors

damianszczepanik avatar kingsleyh avatar tommywo avatar midopa avatar snyk-bot avatar mpkorstanje avatar mathias21 avatar jan-molak avatar ekalin avatar farjang avatar rfriend-aimia avatar anoordover avatar radek1st avatar notmattlucas avatar jeaninev avatar rexhoffman avatar jiayongfei avatar achingbrain avatar oltruong avatar psaelens avatar rlespinasse avatar sasjo avatar zbstof avatar sfcme19001 avatar tilln avatar flokaemmerer avatar aleitamar avatar bootstraponline avatar chancevermilion avatar dinatomsk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.