Git Product home page Git Product logo

cucumber-sandwich's Introduction

Build Status Maven Central Maven Dependencies

Live Demo

Generate Pretty HTML Reports For Cucumber On The Fly

This project generates pretty cucumber html reports on the fly. It monitors your cucumber json report directory for change and then publishes a new report if your report json files change.

Background

I wanted a way of quickly seeing my cucumber reports results when running locally where we didn't have maven available so the maven mojo could not be used.

Install

  1. download/clone this project
  2. mvn clean install

You should see a file like this: cucumber-sandwich-0.0.1-SNAPSHOT-jar-with-dependencies.jar rename this file to cucumber-sandwich.jar

Use

Use the cucumber-sandwich.jar like this:

java -jar cucumber-sandwich.jar -f path/to/the/folder/containing/cucumber.json -o /path/to/generate/html/reports/into

It's probably best to stick that in a .bat or .sh script for easy running. Also note there is no checking done to verify if the json files are cucumber ones and it picks up any json files in the input directory. So make sure you generate your cucumber.json files in a directory without other json files.

You can also add an option -n flag to just run once instead of listening for changes:

 java -jar cucumber-sandwich.jar -n -f path/to/the/folder/containing/json -o path/to/folder/to/generate/reports/into

An example with real paths would be:

 java -jar cucumber-sandwich.jar -f /home/kings/cucumber/json -o /home/kings/cucumber/reports -n

You can specify where the cucumber.json goes in your runner e.g.

 import cucumber.junit.Cucumber;
 import org.junit.runner.RunWith;

 @RunWith(Cucumber.class)
 @CucumberOptions(plugin = {"json:path/to/cucumber.json"})
 public class SomeTest {
 }

Develop

Interested in contributing to the cucumber-reporting? Just contact me or send a pull request.

cucumber-sandwich's People

Contributors

damianszczepanik avatar kingsleyh avatar tsundberg 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.