GithubHelp home page GithubHelp logo

mglaze / reportbuilder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rajatthareja/reportbuilder

0.0 0.0 0.0 190 KB

Ruby gem to merge Cucumber JSON reports and build single HTML Test Report

License: MIT License

Ruby 100.00%

reportbuilder's Introduction

ReportBuilder

Gem Version Join the chat at https://gitter.im/rajatthareja/ReportBuilder

Ruby gem to merge Cucumber JSON reports and build single HTML Test Report

Installation

gem install report_builder

Information

Usage

Note: Works with cucumber(>= 2.1.0) test results in JSON format.

Config Options:

Option Type Default Values
json_path [String] / [Array] (current directory) json files path / array of json files or path
report_path [String] 'test_report' output file path with file name without extension
report_types [Array] [:html] :json, :html (output file types)
report_tabs [Array] [:overview, :features] :overview, :features, :scenarios, :errors (tabs to build)
report_title [String] 'Test Results' report and html title
compress_images [Boolean] false true / false (If true, the size of HTML report is reduced but takes more time to build report)
additional_info [Hash] {} additional info for report summary

Code Examples:

     require 'report_builder'
    
    # Ex 1:
    ReportBuilder.configure do |config|
      config.json_path = 'cucumber_sample/logs'
      config.report_path = 'my_test_report'
      config.report_types = [:json, :html]
      config.report_tabs = [:overview, :features, :scenarios, :errors]
      config.report_title = 'My Test Results'
      config.compress_images = false
      config.additional_info = {browser: 'Chrome', environment: 'Stage 5'}
    end
    
    ReportBuilder.build_report
    
    # Ex 2:
    options = {
       json_path:    'cucumber_sample/logs',
       report_path:  'my_test_report',
       report_types: ['json', 'html'],
       report_tabs:  [ 'overview', 'features', 'scenarios', 'errors'],
       report_title: 'My Test Results',
       compress_images: false,
       additional_info: {'browser' => 'Chrome', 'environment' => 'Stage 5'}
     }
    
    ReportBuilder.build_report options
        

CLI Options:

Option Values Explanation
-s, --source x,y,z List of json path or files
-o, --out [PATH]NAME Report path with name without extension
-f, --format x,y,z List of report format - html,json
-t, --tabs x,y,z List of report tabs - overview,features,scenarios,errors
-c, --compress Reduce report size if embedding images
-T, --title TITLE Report title
-I, --info a:x,b:y,c:z List of additional info about test - key:value
-h, --help Show available command line switches
-v, --version Show gem version

CLI Example:

     report_builder
     report_builder -s 'path/of/json/files/dir'
     report_builder -s 'path/of/json/files/dir' -o my_report_file
     report_builder -s 'path/of/json/files/dir' -o my_report_file -t overview,features,scenarios,errors

Rake Example:

Add in Rakefile

    require 'report_builder'
    load 'report_builder.rake'

Then run rake task report_builder

    rake report_builder
    rake report_builder['path/of/json/files/dir']
    rake report_builder['path/of/json/files/dir','report_file']

Contributing

We're open to any contribution. It has to be tested properly though.

Maintainer

License

Copyright (c) 2016 MIT LICENSE

reportbuilder's People

Contributors

gitter-badger avatar kramarol avatar rajatthareja avatar tk8817 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.