Coder Social home page Coder Social logo

ryderstorm / reportbuilder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rajatthareja/reportbuilder

0.0 1.0 0.0 14.33 MB

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

License: MIT License

Ruby 24.84% CSS 0.28% JavaScript 8.38% HTML 66.50%

reportbuilder's Introduction

ReportBuilder

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

Ruby gem to merge Cucumber JSON reports and build mobile-friendly HTML Test Report, JSON report and retry file.

Sample Reports

Features Report

Grouped Features 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/input_path [String]/[Array]/[Hash] (current directory) input json files path / array of json files or path / hash of json files or path
report_path [String] 'test_report' reports output file path with file name without extension
json_report_path [String] (report_path) json report output file path with file name without extension
html_report_path [String] (report_path) html report output file path with file name without extension
retry_report_path [String] (report_path) retry report output file path with file name without extension
report_types [Array] [:html] :json, :html, :retry (output file types)
report_title [String] 'Test Results' report and html title
include_images [Boolean] true true / false (If false, the size of HTML report is reduced by excluding embedded images)
voice_commands [Boolean] false true / false (Enable voice commands for easy navigation and search)
additional_info [Hash] {} additional info for report summary
additional_css [String] nil additional CSS string or CSS file path or CSS file url for customizing html report
additional_js [String] nil additional JS string or JS file path or JS file url for customizing html report
color [String] brown report color, Ex: indigo, cyan, purple, grey, lime etc.

Code Examples:

     require 'report_builder'
    
    # Ex 1:
    ReportBuilder.configure do |config|
      config.input_path = 'results/cucumber_json'
      config.report_path = 'my_test_report'
      config.report_types = [:retry, :html]
      config.report_title = 'My Test Results'
      config.additional_info = {browser: 'Chrome', environment: 'Stage 5'}
    end
    
    ReportBuilder.build_report
    
    # Ex 2:
    ReportBuilder.input_path = 'results/cucumber_json'
    ReportBuilder.report_path = 'my_test_report'
    ReportBuilder.report_types = [:retry, :html]
    ReportBuilder.report_title = 'My Test Results'
    ReportBuilder.additional_info = {Browser: 'Chrome', Environment: 'Stage 5'}
    
    ReportBuilder.build_report
    
    # Ex 3:
    options = {
       input_path: 'results/cucumber_json',
       report_path: 'my_test_report',
       report_types: ['retry', 'html'],
       report_title: 'My Test Results',
       additional_info: {'Browser' => 'Chrome', 'Environment' => 'Stage 5'}
     }
    
    ReportBuilder.build_report options
    
    # Ex 4:
    ReportBuilder.input_path = 'results/cucumber_json'
    
    ReportBuilder.configure do |config|
      config.report_path = 'my_test_report'
      config.report_types = [:json, :html]
    end
    
   options = {
       report_title: 'My Test Results'
   }
   
   ReportBuilder.build_report options
        

Grouped Features Report Example:

ReportBuilder.configure do |config|
     config.input_path = {
      'Group A' => ['path/of/json/files/dir1', 'path/of/json/files/dir2'],
      'Group B' => ['path/of/json/file1', 'path/of/json/file2'],
      'Group C' => 'path/of/json/files/dir'}
  end

ReportBuilder.build_report

CLI Options:

Option Values Explanation
-s, --source x,y,z List of input json path or files
-o, --out [PATH]NAME Reports path with name without extension
--json_out [PATH]NAME JSON report path with name without extension
--html_out [PATH]NAME HTML report path with name without extension
--retry_out [PATH]NAME Retry report path with name without extension
-f, --format x,y,z List of report format - html,json,retry
--[no-]images Reduce HTML report size by excluding embedded images
-T, --title TITLE Report title
-c, --color COLOR Report color
-I, --info a:x,b:y,c:z List of additional info about test - key:value
--css CSS/PATH/URL Additional CSS string or CSS file path or CSS file url for customizing html report
--js JS/PATH/URL Additional JS string or JS file path or JS file url for customizing html report
-vc, --voice_commands Enable voice commands for easy navigation and search
-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

Hook Example:

require 'report_builder'
    
at_exit do
  ReportBuilder.configure do |config|
    config.input_path = 'results/cucumber_json'
    config.report_path = 'results/report'
  end
  ReportBuilder.build_report
end

Voice Commands:

Use voice commands for easy navigation and search

  • show ( overview, features, summary, errors )
  • search { Keywords }

Report Builder Java API

Report Builder Java

Contributing

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

Collaborators

License

Copyright (c) 2017 MIT LICENSE

reportbuilder's People

Contributors

cheezy avatar chhatbarjignesh avatar colintsteele avatar drkcloudstrife avatar enkessler avatar gitter-badger avatar jflohre avatar kramarol avatar mascolim avatar rajatthareja avatar ryderstorm avatar sofiawan avatar tk8817 avatar

Watchers

 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.