Module: ReportBuilder
- Defined in:
- lib/report_builder.rb,
lib/report_builder/builder.rb
Overview
ReportBuilder Main module
Defined Under Namespace
Classes: Builder
Class Method Summary collapse
-
.build_report(options = nil) ⇒ Object
Build Report.
- .builder ⇒ Object
-
.configure {|defaults| ... } ⇒ Object
Configure ReportBuilder.
-
.set_option(option, value) ⇒ Object
Set single option.
Class Method Details
.build_report(options = nil) ⇒ Object
Build Report
Example:
= {
json_path: 'cucumber_sample/logs',
report_path: 'my_test_report',
report_types: ['json', 'html'],
report_title: 'My Test Results',
include_images: true,
additional_info: {'browser' => 'Chrome', 'environment' => 'Stage 5'}
}
ReportBuilder.build_report
60 61 62 |
# File 'lib/report_builder.rb', line 60 def self.build_report( = nil) builder.build_report() end |
.builder ⇒ Object
64 65 66 |
# File 'lib/report_builder.rb', line 64 def self.builder @builder ||= Builder.new end |
.configure {|defaults| ... } ⇒ Object
Configure ReportBuilder
Example:
ReportBuilder.configure do |config|
config.json_path = 'cucumber_sample/logs'
config.report_path = 'my_test_report'
config.report_types = [:JSON, :HTML]
config.report_title = 'My Test Results'
config.include_images = true
config.additional_info = {Browser: 'Chrome', Environment: 'Stage 5'}
end
21 22 23 24 25 |
# File 'lib/report_builder.rb', line 21 def self.configure defaults = builder. yield defaults if block_given? builder. = defaults.marshal_dump end |
.set_option(option, value) ⇒ Object
Set single option
Example:
ReportBuilder.set_option('include_images', false)
37 38 39 40 |
# File 'lib/report_builder.rb', line 37 def self.set_option(option, value) builder. ||= builder..marshal_dump builder.[option] = value end |