Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

report_builder

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

report_builder

bundlerRubygems
Version
0.1.6
Version published
Maintainers
1
Created
Source

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:

OptionTypeDefaultValues
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, :retry (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]falsetrue / 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:

OptionValuesExplanation
-s, --sourcex,y,zList of json path or files
-o, --out[PATH]NAMEReport path with name without extension
--json_out[PATH]NAMESame as the -o option but will only apply the json report format
--html_out[PATH]NAMESame as the -o option but will only apply the html report format
--retry_out[PATH]NAMESame as the -o option but will only apply the retry report format
-f, --formatx,y,zList of report format - html,json,retry
-t, --tabsx,y,zList of report tabs - overview,features,scenarios,errors
-c, --compressReduce report size if embedding images
-T, --titleTITLEReport title
-I, --infoa:x,b:y,c:zList of additional info about test - key:value
-h, --helpShow available command line switches
-v, --versionShow 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.

Collaborators

License

Copyright (c) 2017 MIT LICENSE

FAQs

Package last updated on 12 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts