report_builder 1.4 → 1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +35 -1
- data/README.md +68 -53
- data/bin/report_builder +18 -16
- data/lib/report_builder.rb +388 -26
- data/lib/report_builder/builder.rb +103 -79
- data/report_builder.gemspec +4 -4
- data/template/error.erb +6 -6
- data/template/feature.erb +7 -9
- data/template/footer.erb +30 -4
- data/template/group_errors.erb +1 -1
- data/template/group_features.erb +2 -2
- data/template/group_report.erb +5 -5
- data/template/group_summary.erb +1 -1
- data/template/head.erb +2 -2
- data/template/header.erb +9 -9
- data/template/hook.erb +4 -1
- data/template/report.erb +5 -5
- data/template/step.erb +4 -0
- data/template/summary.erb +7 -1
- data/template/summary_row.erb +12 -2
- metadata +17 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 0aa1ff8b4caff189599fe6e76c52a49c43dbdbd47d8e099ab9aa81055d0703cd
|
|
4
|
+
data.tar.gz: 3e1fbfed2f713b8319b1fa01e3a9ab9d3fabdf80a48e00c64d8fd7c48019c614
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57bff744c235ba470d960f116eb5d28883e224d0d72910012e5264e24ae0c51e68618366255746bc07803aa7d934b55667e4b3df9bc6c1b9a66b523d171c4cef
|
|
7
|
+
data.tar.gz: b9cf16c68a1fd6e92c97f037f2dd55ccbb321fda0574e5fef651702982939758c786d8f60da6f5d884ed9d682fd17327716eedf10a50d6c5ea13ba266305f3dc
|
data/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,41 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
|
|
6
|
-
## [Unreleased](https://github.com/rajatthareja/ReportBuilder/compare/v1.
|
|
6
|
+
## [Unreleased](https://github.com/rajatthareja/ReportBuilder/compare/v1.9...master)
|
|
7
|
+
|
|
8
|
+
## [1.9](https://github.com/rajatthareja/ReportBuilder/compare/v1.8...v1.9) - 2020-06-06
|
|
9
|
+
### Changed
|
|
10
|
+
- Json 1.8.1 to 2.3.0
|
|
11
|
+
- Include last fail run instead of first
|
|
12
|
+
- [Few other small changes](https://github.com/rajatthareja/ReportBuilder/compare/v1.8...v1.9)
|
|
13
|
+
|
|
14
|
+
## [1.8](https://github.com/rajatthareja/ReportBuilder/compare/v1.7...v1.8) - 2018-09-02
|
|
15
|
+
### Fixed
|
|
16
|
+
- Before hook embedding
|
|
17
|
+
- Scenario example with tags
|
|
18
|
+
- HTML embedding
|
|
19
|
+
|
|
20
|
+
## [1.7](https://github.com/rajatthareja/ReportBuilder/compare/v1.6...v1.7) - 2018-08-07
|
|
21
|
+
### Changed
|
|
22
|
+
- Required Ruby Version from (>= 1.9.1) to (>= 1.9.3)
|
|
23
|
+
### Fixed
|
|
24
|
+
- Image - ERB Encoding Compatibility Error
|
|
25
|
+
### Added
|
|
26
|
+
- Support for step doc string
|
|
27
|
+
|
|
28
|
+
## [1.6](https://github.com/rajatthareja/ReportBuilder/compare/v1.5...v1.6) - 2018-03-29
|
|
29
|
+
### Changed
|
|
30
|
+
- Removed duplicate flaky scenarios
|
|
31
|
+
### Added
|
|
32
|
+
- Configuration Options Setter and Getter
|
|
33
|
+
|
|
34
|
+
## [1.5](https://github.com/rajatthareja/ReportBuilder/compare/v1.4...v1.5) - 2018-03-03
|
|
35
|
+
### Added
|
|
36
|
+
- Voice Commands
|
|
37
|
+
- Tabs name
|
|
38
|
+
- Color option
|
|
39
|
+
### Fixed
|
|
40
|
+
- js and css cli option
|
|
7
41
|
|
|
8
42
|
## [1.4](https://github.com/rajatthareja/ReportBuilder/compare/v1.3...v1.4) - 2017-10-29
|
|
9
43
|
### Fixed
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ReportBuilder
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/rb/report_builder)
|
|
4
4
|
[](https://travis-ci.org/rajatthareja/ReportBuilder)
|
|
5
5
|
[](https://ci.appveyor.com/project/rajatthareja/reportbuilder)
|
|
6
6
|
[](https://gitter.im/rajatthareja/ReportBuilder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
@@ -9,9 +9,9 @@ Ruby gem to merge Cucumber JSON reports and build mobile-friendly HTML Test Repo
|
|
|
9
9
|
|
|
10
10
|
## Sample Reports
|
|
11
11
|
|
|
12
|
-
**[Features Report](
|
|
12
|
+
**[Features Report](https://reportbuilder.rajatthareja.com/sample/report.html)**
|
|
13
13
|
|
|
14
|
-
**[Grouped Features Report](
|
|
14
|
+
**[Grouped Features Report](https://reportbuilder.rajatthareja.com/sample/group_report.html)**
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ gem install report_builder
|
|
|
24
24
|
## Information
|
|
25
25
|
|
|
26
26
|
* RDoc documentation [available on RubyDoc.info](http://www.rubydoc.info/gems/report_builder)
|
|
27
|
-
* Source code [available on GitHub](
|
|
27
|
+
* Source code [available on GitHub](https://github.com/rajatthareja/ReportBuilder)
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
@@ -42,9 +42,11 @@ gem install report_builder
|
|
|
42
42
|
| report_types | [Array] | [:html] | :json, :html, :retry (output file types) |
|
|
43
43
|
| report_title | [String] | 'Test Results' | report and html title |
|
|
44
44
|
| include_images | [Boolean] | true | true / false (If false, the size of HTML report is reduced by excluding embedded images) |
|
|
45
|
+
| voice_commands | [Boolean] | false | true / false (Enable voice commands for easy navigation and search) |
|
|
45
46
|
| additional_info | [Hash] | {} | additional info for report summary |
|
|
46
47
|
| additional_css | [String] | nil | additional CSS string or CSS file path or CSS file url for customizing html report |
|
|
47
48
|
| additional_js | [String] | nil | additional JS string or JS file path or JS file url for customizing html report |
|
|
49
|
+
| color | [String] | brown | report color, Ex: indigo, cyan, purple, grey, lime etc. |
|
|
48
50
|
|
|
49
51
|
### Code Examples:
|
|
50
52
|
|
|
@@ -54,27 +56,48 @@ gem install report_builder
|
|
|
54
56
|
|
|
55
57
|
# Ex 1:
|
|
56
58
|
ReportBuilder.configure do |config|
|
|
57
|
-
config.
|
|
59
|
+
config.input_path = 'results/cucumber_json'
|
|
58
60
|
config.report_path = 'my_test_report'
|
|
59
|
-
config.report_types = [:
|
|
61
|
+
config.report_types = [:retry, :html]
|
|
60
62
|
config.report_title = 'My Test Results'
|
|
61
|
-
config.include_images = false
|
|
62
63
|
config.additional_info = {browser: 'Chrome', environment: 'Stage 5'}
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
ReportBuilder.build_report
|
|
66
67
|
|
|
67
68
|
# Ex 2:
|
|
69
|
+
ReportBuilder.input_path = 'results/cucumber_json'
|
|
70
|
+
ReportBuilder.report_path = 'my_test_report'
|
|
71
|
+
ReportBuilder.report_types = [:retry, :html]
|
|
72
|
+
ReportBuilder.report_title = 'My Test Results'
|
|
73
|
+
ReportBuilder.additional_info = {Browser: 'Chrome', Environment: 'Stage 5'}
|
|
74
|
+
|
|
75
|
+
ReportBuilder.build_report
|
|
76
|
+
|
|
77
|
+
# Ex 3:
|
|
68
78
|
options = {
|
|
69
|
-
|
|
70
|
-
report_path:
|
|
71
|
-
report_types: ['
|
|
79
|
+
input_path: 'results/cucumber_json',
|
|
80
|
+
report_path: 'my_test_report',
|
|
81
|
+
report_types: ['retry', 'html'],
|
|
72
82
|
report_title: 'My Test Results',
|
|
73
|
-
|
|
74
|
-
additional_info: {'browser' => 'Chrome', 'environment' => 'Stage 5'}
|
|
83
|
+
additional_info: {'Browser' => 'Chrome', 'Environment' => 'Stage 5'}
|
|
75
84
|
}
|
|
76
85
|
|
|
77
86
|
ReportBuilder.build_report options
|
|
87
|
+
|
|
88
|
+
# Ex 4:
|
|
89
|
+
ReportBuilder.input_path = 'results/cucumber_json'
|
|
90
|
+
|
|
91
|
+
ReportBuilder.configure do |config|
|
|
92
|
+
config.report_path = 'my_test_report'
|
|
93
|
+
config.report_types = [:json, :html]
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
options = {
|
|
97
|
+
report_title: 'My Test Results'
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
ReportBuilder.build_report options
|
|
78
101
|
|
|
79
102
|
```
|
|
80
103
|
|
|
@@ -83,7 +106,7 @@ gem install report_builder
|
|
|
83
106
|
```ruby
|
|
84
107
|
|
|
85
108
|
ReportBuilder.configure do |config|
|
|
86
|
-
|
|
109
|
+
config.input_path = {
|
|
87
110
|
'Group A' => ['path/of/json/files/dir1', 'path/of/json/files/dir2'],
|
|
88
111
|
'Group B' => ['path/of/json/file1', 'path/of/json/file2'],
|
|
89
112
|
'Group C' => 'path/of/json/files/dir'}
|
|
@@ -96,21 +119,23 @@ ReportBuilder.build_report
|
|
|
96
119
|
|
|
97
120
|
### CLI Options:
|
|
98
121
|
|
|
99
|
-
| Option
|
|
100
|
-
|
|
101
|
-
| -s, --source
|
|
102
|
-
| -o, --out
|
|
103
|
-
| --json_out
|
|
104
|
-
| --html_out
|
|
105
|
-
| --retry_out
|
|
106
|
-
| -f, --format
|
|
107
|
-
| --[no-]images
|
|
108
|
-
| -T, --title
|
|
109
|
-
| -
|
|
110
|
-
| --
|
|
111
|
-
| --
|
|
112
|
-
|
|
|
113
|
-
| -
|
|
122
|
+
| Option | Values | Explanation |
|
|
123
|
+
|-----------------------|--------------|------------------------------------------------------------------------------------|
|
|
124
|
+
| -s, --source | x,y,z | List of input json path or files |
|
|
125
|
+
| -o, --out | [PATH]NAME | Reports path with name without extension |
|
|
126
|
+
| --json_out | [PATH]NAME | JSON report path with name without extension |
|
|
127
|
+
| --html_out | [PATH]NAME | HTML report path with name without extension |
|
|
128
|
+
| --retry_out | [PATH]NAME | Retry report path with name without extension |
|
|
129
|
+
| -f, --format | x,y,z | List of report format - html,json,retry |
|
|
130
|
+
| --[no-]images | | Reduce HTML report size by excluding embedded images |
|
|
131
|
+
| -T, --title | TITLE | Report title |
|
|
132
|
+
| -c, --color | COLOR | Report color |
|
|
133
|
+
| -I, --info | a:x,b:y,c:z | List of additional info about test - key:value |
|
|
134
|
+
| --css | CSS/PATH/URL | Additional CSS string or CSS file path or CSS file url for customizing html report |
|
|
135
|
+
| --js | JS/PATH/URL | Additional JS string or JS file path or JS file url for customizing html report |
|
|
136
|
+
| -vc, --voice_commands | | Enable voice commands for easy navigation and search |
|
|
137
|
+
| -h, --help | | Show available command line switches |
|
|
138
|
+
| -v, --version | | Show gem version |
|
|
114
139
|
|
|
115
140
|
### CLI Example:
|
|
116
141
|
|
|
@@ -122,44 +147,34 @@ ReportBuilder.build_report
|
|
|
122
147
|
|
|
123
148
|
```
|
|
124
149
|
|
|
125
|
-
###
|
|
126
|
-
|
|
127
|
-
Add in Rakefile
|
|
150
|
+
### Hook Example:
|
|
128
151
|
|
|
129
152
|
```ruby
|
|
130
153
|
|
|
131
|
-
|
|
154
|
+
require 'report_builder'
|
|
132
155
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
156
|
+
at_exit do
|
|
157
|
+
ReportBuilder.configure do |config|
|
|
158
|
+
config.input_path = 'results/cucumber_json'
|
|
159
|
+
config.report_path = 'results/report'
|
|
160
|
+
end
|
|
161
|
+
ReportBuilder.build_report
|
|
162
|
+
end
|
|
139
163
|
|
|
140
164
|
```
|
|
141
165
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
rake report_builder
|
|
147
|
-
rake report_builder['path/of/json/files/dir']
|
|
148
|
-
rake report_builder['path/of/json/files/dir','report_file']
|
|
166
|
+
### Voice Commands:
|
|
167
|
+
Use voice commands for easy navigation and search
|
|
168
|
+
* show ( overview, features, summary, errors )
|
|
169
|
+
* search { Keywords }
|
|
149
170
|
|
|
150
|
-
|
|
171
|
+
## Report Builder Java API
|
|
172
|
+
[Report Builder Java](https://reportbuilderjava.rajatthareja.com)
|
|
151
173
|
|
|
152
174
|
## Contributing
|
|
153
175
|
|
|
154
176
|
We're open to any contribution. It has to be tested properly though.
|
|
155
177
|
|
|
156
|
-
## Collaborators
|
|
157
|
-
|
|
158
|
-
* [Rajat Thareja](https://github.com/rajatthareja)
|
|
159
|
-
* [Justin Commu](https://github.com/tk8817)
|
|
160
|
-
* [Eric Kessler](https://github.com/enkessler)
|
|
161
|
-
* [Jeff Morgan](https://github.com/cheezy)
|
|
162
|
-
|
|
163
178
|
## License
|
|
164
179
|
|
|
165
180
|
Copyright (c) 2017 [MIT LICENSE](LICENSE)
|
data/bin/report_builder
CHANGED
|
@@ -3,21 +3,14 @@
|
|
|
3
3
|
require 'optparse'
|
|
4
4
|
require 'report_builder'
|
|
5
5
|
|
|
6
|
-
options = {
|
|
7
|
-
:json_path => nil,
|
|
8
|
-
:report_path => 'test_report',
|
|
9
|
-
:report_types => [:html],
|
|
10
|
-
:report_title => 'Test Results',
|
|
11
|
-
:include_images => true,
|
|
12
|
-
:additional_info => {}
|
|
13
|
-
}
|
|
6
|
+
options = { }
|
|
14
7
|
|
|
15
8
|
opt_parser = OptionParser.new do |opts|
|
|
16
9
|
opts.banner = "Usage: \n report_builder [options]"
|
|
17
10
|
opts.separator 'Configuration options:'
|
|
18
11
|
|
|
19
|
-
opts.on('-s','--source x,y,z', Array, 'List of json path or files') do |list|
|
|
20
|
-
options[:
|
|
12
|
+
opts.on('-s', '--source x,y,z', Array, 'List of json path or files') do |list|
|
|
13
|
+
options[:input_path] = list
|
|
21
14
|
end
|
|
22
15
|
|
|
23
16
|
opts.on('-o', '--out [PATH]NAME', String, 'Report path with name without extension') do |report_path|
|
|
@@ -36,7 +29,7 @@ opt_parser = OptionParser.new do |opts|
|
|
|
36
29
|
options[:retry_report_path] = report_path
|
|
37
30
|
end
|
|
38
31
|
|
|
39
|
-
opts.on('-f','--format x,y,z', Array, 'List of report format - html,json,retry') do |list|
|
|
32
|
+
opts.on('-f', '--format x,y,z', Array, 'List of report format - html,json,retry') do |list|
|
|
40
33
|
options[:report_types] = list
|
|
41
34
|
end
|
|
42
35
|
|
|
@@ -44,22 +37,31 @@ opt_parser = OptionParser.new do |opts|
|
|
|
44
37
|
options[:include_images] = include_images
|
|
45
38
|
end
|
|
46
39
|
|
|
40
|
+
opts.on('--voice_commands', 'Enable voice commands for easy navigation and search') do |voice_commands|
|
|
41
|
+
options[:voice_commands] = voice_commands
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
opts.on('-c', '--color COLOR', String, 'Report color') do |color|
|
|
45
|
+
options[:color] = color
|
|
46
|
+
end
|
|
47
|
+
|
|
47
48
|
opts.on('-T', '--title TITLE', String, 'Report title') do |report_title|
|
|
48
49
|
options[:report_title] = report_title
|
|
49
50
|
end
|
|
50
51
|
|
|
51
|
-
opts.on('-I','--info a:x,b:y,c:z', Array, 'List of additional info') do |list|
|
|
52
|
+
opts.on('-I', '--info a:x,b:y,c:z', Array, 'List of additional info') do |list|
|
|
53
|
+
options[:additional_info] = { }
|
|
52
54
|
list.each do |i|
|
|
53
|
-
key, value = i.split(':')
|
|
55
|
+
key, value = i.split(':', 2)
|
|
54
56
|
options[:additional_info][key] = value
|
|
55
57
|
end
|
|
56
58
|
end
|
|
57
59
|
|
|
58
|
-
opts.on('--css', 'Additional CSS string or CSS file path or CSS file url for customizing html report') do |additional_css|
|
|
60
|
+
opts.on('--css CSS', String, 'Additional CSS string or CSS file path or CSS file url for customizing html report') do |additional_css|
|
|
59
61
|
options[:additional_css] = additional_css
|
|
60
62
|
end
|
|
61
63
|
|
|
62
|
-
opts.on('--js', 'Additional JS string or JS file path or JS file url for customizing html report') do |additional_js|
|
|
64
|
+
opts.on('--js JS', String, 'Additional JS string or JS file path or JS file url for customizing html report') do |additional_js|
|
|
63
65
|
options[:additional_js] = additional_js
|
|
64
66
|
end
|
|
65
67
|
|
|
@@ -70,7 +72,7 @@ opt_parser = OptionParser.new do |opts|
|
|
|
70
72
|
exit
|
|
71
73
|
end
|
|
72
74
|
|
|
73
|
-
opts.on_tail('-v','--version', 'Show version') do
|
|
75
|
+
opts.on_tail('-v', '--version', 'Show version') do
|
|
74
76
|
puts 'ReportBuilder v' + Gem.loaded_specs['report_builder'].version.to_s rescue puts "Something want wrong. \nUse 'gem list report_builder'"
|
|
75
77
|
exit
|
|
76
78
|
end
|
data/lib/report_builder.rb
CHANGED
|
@@ -4,64 +4,426 @@ require_relative 'report_builder/builder'
|
|
|
4
4
|
# ReportBuilder Main module
|
|
5
5
|
#
|
|
6
6
|
module ReportBuilder
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# ReportBuilder options
|
|
10
|
+
#
|
|
11
|
+
def self.options
|
|
12
|
+
@options ||= {
|
|
13
|
+
input_path: Dir.pwd,
|
|
14
|
+
report_types: [:html],
|
|
15
|
+
report_title: 'Test Results',
|
|
16
|
+
include_images: true,
|
|
17
|
+
voice_commands: false,
|
|
18
|
+
additional_info: {},
|
|
19
|
+
report_path: 'test_report',
|
|
20
|
+
color: 'brown'
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
7
24
|
##
|
|
8
25
|
# Configure ReportBuilder
|
|
9
26
|
#
|
|
10
27
|
# Example:
|
|
11
28
|
#
|
|
12
29
|
# ReportBuilder.configure do |config|
|
|
13
|
-
# config.
|
|
30
|
+
# config.input_path = 'cucumber_sample/logs'
|
|
14
31
|
# config.report_path = 'my_test_report'
|
|
15
|
-
# config.report_types = [:
|
|
32
|
+
# config.report_types = [:RETRY, :HTML]
|
|
16
33
|
# config.report_title = 'My Test Results'
|
|
17
34
|
# config.include_images = true
|
|
35
|
+
# config.voice_commands = true
|
|
18
36
|
# config.additional_info = {Browser: 'Chrome', Environment: 'Stage 5'}
|
|
19
37
|
# end
|
|
20
38
|
#
|
|
21
39
|
def self.configure
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
# Set single option
|
|
29
|
-
#
|
|
30
|
-
# @param [String] option
|
|
31
|
-
# @param [Object] value
|
|
32
|
-
#
|
|
33
|
-
# Example:
|
|
34
|
-
#
|
|
35
|
-
# ReportBuilder.set_option('include_images', false)
|
|
36
|
-
#
|
|
37
|
-
def self.set_option(option, value)
|
|
38
|
-
builder.options ||= builder.default_options.marshal_dump
|
|
39
|
-
builder.options[option] = value
|
|
40
|
+
options
|
|
41
|
+
more_options = OpenStruct.new
|
|
42
|
+
yield more_options if block_given?
|
|
43
|
+
@options.merge! more_options.marshal_dump
|
|
40
44
|
end
|
|
41
45
|
|
|
42
46
|
##
|
|
43
47
|
# Build Report
|
|
44
48
|
#
|
|
45
|
-
# @param [Hash]
|
|
49
|
+
# @param [Hash] more_options override the default and configured options.
|
|
46
50
|
#
|
|
47
51
|
# Example:
|
|
48
52
|
#
|
|
49
53
|
# options = {
|
|
50
54
|
# json_path: 'cucumber_sample/logs',
|
|
51
55
|
# report_path: 'my_test_report',
|
|
52
|
-
# report_types: ['
|
|
56
|
+
# report_types: ['retry', 'html'],
|
|
53
57
|
# report_title: 'My Test Results',
|
|
54
58
|
# include_images: true,
|
|
59
|
+
# voice_commands: true,
|
|
60
|
+
# color: 'deep-purple',
|
|
55
61
|
# additional_info: {'browser' => 'Chrome', 'environment' => 'Stage 5'}
|
|
56
62
|
# }
|
|
57
63
|
#
|
|
58
64
|
# ReportBuilder.build_report options
|
|
59
65
|
#
|
|
60
|
-
def self.build_report(
|
|
61
|
-
|
|
66
|
+
def self.build_report(more_options = {})
|
|
67
|
+
options
|
|
68
|
+
if more_options.is_a? String
|
|
69
|
+
@options[:input_path] = more_options
|
|
70
|
+
elsif more_options.is_a? Hash
|
|
71
|
+
@options.merge! more_options
|
|
72
|
+
end
|
|
73
|
+
@options[:input_path] = @options[:json_path] if @options[:json_path]
|
|
74
|
+
@options[:report_types] = [@options[:report_types]] unless @options[:report_types].is_a? Array
|
|
75
|
+
@options[:report_types].map!(&:to_s).map!(&:upcase)
|
|
76
|
+
Builder.new.build_report
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
##
|
|
80
|
+
# Set Report Builder input json files path / array of json files or path / hash of json files or path
|
|
81
|
+
#
|
|
82
|
+
# @param [String/Array/Hash] json_path input json files path / array of json files or path / hash of json files or path
|
|
83
|
+
#
|
|
84
|
+
# Example:
|
|
85
|
+
#
|
|
86
|
+
# ReportBuilder.json_path = 'my_project/cucumber_json'
|
|
87
|
+
#
|
|
88
|
+
def self.json_path=(json_path)
|
|
89
|
+
options
|
|
90
|
+
@options[:input_path] = json_path
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
##
|
|
94
|
+
# Returns Report Builder input json files path / array of json files or path / hash of json files or path
|
|
95
|
+
#
|
|
96
|
+
# @return [String/Array/Hash] json_path input json files path / array of json files or path / hash of json files or path
|
|
97
|
+
#
|
|
98
|
+
def self.json_path
|
|
99
|
+
options[:input_path]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
##
|
|
103
|
+
# Set Report Builder input json files path / array of json files or path / hash of json files or path
|
|
104
|
+
#
|
|
105
|
+
# @param [String/Array/Hash] input_path input json files path / array of json files or path / hash of json files or path
|
|
106
|
+
#
|
|
107
|
+
# Example:
|
|
108
|
+
#
|
|
109
|
+
# ReportBuilder.input_path = 'my_project/cucumber_json'
|
|
110
|
+
#
|
|
111
|
+
def self.input_path=(input_path)
|
|
112
|
+
options
|
|
113
|
+
@options[:input_path] = input_path
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
##
|
|
117
|
+
# Returns Report Builder input json files path / array of json files or path / hash of json files or path
|
|
118
|
+
#
|
|
119
|
+
# @return [String/Array/Hash] input_path input json files path / array of json files or path / hash of json files or path
|
|
120
|
+
#
|
|
121
|
+
def self.input_path
|
|
122
|
+
options[:input_path]
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
##
|
|
126
|
+
# Set Report Builder report_types :json, :html, :retry (output file types)
|
|
127
|
+
#
|
|
128
|
+
# @param [Array] report_types :json, :html, :retry (output file types)
|
|
129
|
+
#
|
|
130
|
+
# Example:
|
|
131
|
+
#
|
|
132
|
+
# ReportBuilder.report_types = [:html, :retry]
|
|
133
|
+
#
|
|
134
|
+
def self.report_types=(report_types)
|
|
135
|
+
options
|
|
136
|
+
@options[:report_types] = report_types.is_a? Array ? report_types : [report_types]
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
##
|
|
140
|
+
# Returns Report Builder report_types :json, :html, :retry (output file types)
|
|
141
|
+
#
|
|
142
|
+
# @return [Array] report_types :json, :html, :retry (output file types)
|
|
143
|
+
#
|
|
144
|
+
def self.report_types
|
|
145
|
+
options[:report_types]
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
##
|
|
149
|
+
# Set Report Builder HTML report title
|
|
150
|
+
#
|
|
151
|
+
# @param [String] report_title HTML report title
|
|
152
|
+
#
|
|
153
|
+
# Example:
|
|
154
|
+
#
|
|
155
|
+
# ReportBuilder.report_title = 'My Report'
|
|
156
|
+
#
|
|
157
|
+
def self.report_title=(report_title)
|
|
158
|
+
options
|
|
159
|
+
@options[:report_title] = report_title if report_title.is_a? String
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
##
|
|
163
|
+
# Returns Report Builder HTML report title
|
|
164
|
+
#
|
|
165
|
+
# @return [String] report_title HTML report title
|
|
166
|
+
#
|
|
167
|
+
def self.report_title
|
|
168
|
+
options[:report_title]
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
##
|
|
172
|
+
# Set Report Builder include or excluding embedded images
|
|
173
|
+
#
|
|
174
|
+
# @param [Boolean] include_images include or excluding embedded images
|
|
175
|
+
#
|
|
176
|
+
# Example:
|
|
177
|
+
#
|
|
178
|
+
# ReportBuilder.include_images = false
|
|
179
|
+
#
|
|
180
|
+
def self.include_images=(include_images)
|
|
181
|
+
options
|
|
182
|
+
@options[:include_images] = include_images if !!include_images == include_images
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
##
|
|
186
|
+
# Returns Report Builder include or excluding embedded images
|
|
187
|
+
#
|
|
188
|
+
# @return [Boolean] include_images include or excluding embedded images
|
|
189
|
+
#
|
|
190
|
+
def self.include_images
|
|
191
|
+
options[:include_images]
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
##
|
|
195
|
+
# Set Report Builder enable or disable voice commands
|
|
196
|
+
#
|
|
197
|
+
# @param [Boolean] voice_commands enable or disable voice commands
|
|
198
|
+
#
|
|
199
|
+
# Example:
|
|
200
|
+
#
|
|
201
|
+
# ReportBuilder.voice_commands = true
|
|
202
|
+
#
|
|
203
|
+
def self.voice_commands=(voice_commands)
|
|
204
|
+
options
|
|
205
|
+
@options[:voice_commands] = voice_commands if !!voice_commands == voice_commands
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
##
|
|
209
|
+
# Returns Report Builder enable or disable voice commands
|
|
210
|
+
#
|
|
211
|
+
# @return [Boolean] voice_commands enable or disable voice commands
|
|
212
|
+
#
|
|
213
|
+
def self.voice_commands
|
|
214
|
+
options[:voice_commands]
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
##
|
|
218
|
+
# Set Report Builder additional info for report summary
|
|
219
|
+
#
|
|
220
|
+
# @param [Hash] additional_info additional info for report summary
|
|
221
|
+
#
|
|
222
|
+
# Example:
|
|
223
|
+
#
|
|
224
|
+
# ReportBuilder.additional_info = {'Environment' => 'Abc Environment', 'Browser' => 'Chrome'}
|
|
225
|
+
#
|
|
226
|
+
def self.additional_info=(additional_info)
|
|
227
|
+
options
|
|
228
|
+
@options[:additional_info] = additional_info if additional_info.is_a? Hash
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
##
|
|
232
|
+
# Returns Report Builder additional info for report summary
|
|
233
|
+
#
|
|
234
|
+
# @return [Hash] additional_info additional info for report summary
|
|
235
|
+
#
|
|
236
|
+
def self.additional_info
|
|
237
|
+
options[:additional_info]
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
##
|
|
241
|
+
# Set Report Builder reports output file path with file name without extension
|
|
242
|
+
#
|
|
243
|
+
# @param [String] report_path reports output file path with file name without extension
|
|
244
|
+
#
|
|
245
|
+
# Example:
|
|
246
|
+
#
|
|
247
|
+
# ReportBuilder.report_path = 'reports/report'
|
|
248
|
+
#
|
|
249
|
+
def self.report_path=(report_path)
|
|
250
|
+
options
|
|
251
|
+
options[:report_path] = report_path if report_path.is_a? String
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
##
|
|
255
|
+
# Returns Report Builder reports output file path with file name without extension
|
|
256
|
+
#
|
|
257
|
+
# @return [String] report_path reports output file path with file name without extension
|
|
258
|
+
#
|
|
259
|
+
def self.report_path
|
|
260
|
+
options[:report_path]
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
##
|
|
264
|
+
# Set Report Builder json report output file path with file name without extension
|
|
265
|
+
#
|
|
266
|
+
# @param [String] json_report_path json report output file path with file name without extension
|
|
267
|
+
#
|
|
268
|
+
# Example:
|
|
269
|
+
#
|
|
270
|
+
# ReportBuilder.json_report_path = 'reports/report'
|
|
271
|
+
#
|
|
272
|
+
def self.json_report_path=(json_report_path)
|
|
273
|
+
options
|
|
274
|
+
@options[:json_report_path] = json_report_path if json_report_path.is_a? String
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
##
|
|
278
|
+
# Returns Report Builder json report output file path with file name without extension
|
|
279
|
+
#
|
|
280
|
+
# @return [String] json_report_path json report output file path with file name without extension
|
|
281
|
+
#
|
|
282
|
+
def self.json_report_path
|
|
283
|
+
options[:json_report_path] || options[:report_path]
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
##
|
|
287
|
+
# Set Report Builder html report output file path with file name without extension
|
|
288
|
+
#
|
|
289
|
+
# @param [String] html_report_path html report output file path with file name without extension
|
|
290
|
+
#
|
|
291
|
+
# Example:
|
|
292
|
+
#
|
|
293
|
+
# ReportBuilder.html_report_path = 'reports/report'
|
|
294
|
+
#
|
|
295
|
+
def self.html_report_path=(html_report_path)
|
|
296
|
+
options
|
|
297
|
+
@options[:html_report_path] = html_report_path if html_report_path.is_a? String
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
##
|
|
301
|
+
# Returns Report Builder html report output file path with file name without extension
|
|
302
|
+
#
|
|
303
|
+
# @return [String] html_report_path html report output file path with file name without extension
|
|
304
|
+
#
|
|
305
|
+
def self.html_report_path
|
|
306
|
+
options[:html_report_path] || options[:report_path]
|
|
62
307
|
end
|
|
63
308
|
|
|
64
|
-
|
|
65
|
-
|
|
309
|
+
##
|
|
310
|
+
# Set Report Builder retry report output file path with file name without extension
|
|
311
|
+
#
|
|
312
|
+
# @param [String] retry_report_path retry report output file path with file name without extension
|
|
313
|
+
#
|
|
314
|
+
# Example:
|
|
315
|
+
#
|
|
316
|
+
# ReportBuilder.retry_report_path = 'reports/report'
|
|
317
|
+
#
|
|
318
|
+
def self.retry_report_path=(retry_report_path)
|
|
319
|
+
options
|
|
320
|
+
@options[:retry_report_path] = retry_report_path if retry_report_path.is_a? String
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
##
|
|
324
|
+
# Returns Report Builder retry report output file path with file name without extension
|
|
325
|
+
#
|
|
326
|
+
# @return [String] retry_report_path retry report output file path with file name without extension
|
|
327
|
+
#
|
|
328
|
+
def self.retry_report_path
|
|
329
|
+
options[:retry_report_path] || options[:report_path]
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
##
|
|
333
|
+
# Set Report Builder additional CSS string or CSS file path or CSS file url for customizing html report
|
|
334
|
+
#
|
|
335
|
+
# @param [String] additional_css additional CSS string or CSS file path or CSS file url for customizing html report
|
|
336
|
+
#
|
|
337
|
+
# Example:
|
|
338
|
+
#
|
|
339
|
+
# ReportBuilder.additional_css = 'css/style.css'
|
|
340
|
+
#
|
|
341
|
+
def self.additional_css=(additional_css)
|
|
342
|
+
options
|
|
343
|
+
@options[:additional_css] = additional_css if additional_css.is_a? String
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
##
|
|
347
|
+
# Returns Report Builder additional CSS string or CSS file path or CSS file url for customizing html report
|
|
348
|
+
#
|
|
349
|
+
# @return [String] additional_css additional CSS string or CSS file path or CSS file url for customizing html report
|
|
350
|
+
#
|
|
351
|
+
def self.additional_css
|
|
352
|
+
options[:additional_css]
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
##
|
|
356
|
+
# Set Report Builder additional JS string or JS file path or JS file url for customizing html report
|
|
357
|
+
#
|
|
358
|
+
# @param [String] additional_js additional JS string or JS file path or JS file url for customizing html report
|
|
359
|
+
#
|
|
360
|
+
# Example:
|
|
361
|
+
#
|
|
362
|
+
# ReportBuilder.json_report_path = 'js/script.js'
|
|
363
|
+
#
|
|
364
|
+
def self.additional_js=(additional_js)
|
|
365
|
+
options
|
|
366
|
+
@options[:additional_js=] = additional_js if additional_js.is_a? String
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
##
|
|
370
|
+
# Returns Report Builder additional JS string or JS file path or JS file url for customizing html report
|
|
371
|
+
#
|
|
372
|
+
# @return [String] additional_js additional JS string or JS file path or JS file url for customizing html report
|
|
373
|
+
#
|
|
374
|
+
def self.additional_js
|
|
375
|
+
options[:additional_js]
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
##
|
|
379
|
+
# Set Report Builder report color, Ex: indigo, cyan, purple, grey, lime etc.
|
|
380
|
+
#
|
|
381
|
+
# @param [String] color report color, Ex: indigo, cyan, purple, grey, lime etc.
|
|
382
|
+
#
|
|
383
|
+
# Example:
|
|
384
|
+
#
|
|
385
|
+
# ReportBuilder.color = 'purple'
|
|
386
|
+
#
|
|
387
|
+
def self.color=(color)
|
|
388
|
+
options
|
|
389
|
+
@options[:color] = color if color.is_a? String
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
##
|
|
393
|
+
# Returns Report Builder report color, Ex: indigo, cyan, purple, grey, lime etc.
|
|
394
|
+
#
|
|
395
|
+
# @return [String] color report color, Ex: indigo, cyan, purple, grey, lime etc.
|
|
396
|
+
#
|
|
397
|
+
def self.color
|
|
398
|
+
options[:color]
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
##
|
|
402
|
+
# Set Report Builder Options
|
|
403
|
+
#
|
|
404
|
+
# @param [String] option
|
|
405
|
+
# @param [String] value
|
|
406
|
+
#
|
|
407
|
+
# Example:
|
|
408
|
+
#
|
|
409
|
+
# ReportBuilder.set('title', 'My Features')
|
|
410
|
+
#
|
|
411
|
+
def self.set_option(option, value)
|
|
412
|
+
options
|
|
413
|
+
@options[option.to_sym] = value
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
##
|
|
417
|
+
# Set Report Builder Options
|
|
418
|
+
#
|
|
419
|
+
# @param [String] option
|
|
420
|
+
# @param [String] value
|
|
421
|
+
#
|
|
422
|
+
# Example:
|
|
423
|
+
#
|
|
424
|
+
# ReportBuilder.set('title', 'My Features')
|
|
425
|
+
#
|
|
426
|
+
def self.set(option, value)
|
|
427
|
+
set_option(option, value)
|
|
66
428
|
end
|
|
67
429
|
end
|