report_builder 1.8 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1008b5d94e81a5cb70e14bbc1218a383c6ad9a81
4
- data.tar.gz: 68ec449f21c5d25b62df7eac24cfb8251d393435
2
+ SHA256:
3
+ metadata.gz: 0aa1ff8b4caff189599fe6e76c52a49c43dbdbd47d8e099ab9aa81055d0703cd
4
+ data.tar.gz: 3e1fbfed2f713b8319b1fa01e3a9ab9d3fabdf80a48e00c64d8fd7c48019c614
5
5
  SHA512:
6
- metadata.gz: 799fea6775b06e8a39f49fc7c755bb047a1185893c00da2088b0152344d0a9f745b52deeb0b9c22435e89b2aa4592fa85f375b83823cc221afbb189a482c8834
7
- data.tar.gz: 8c382e15ee1787476d47834539345366c1e145cdda2889c54fc79cab5519bb015ff067372940f721b79d4dba4308a1f3e910588e3ec8841a18a8e55899fad9e3
6
+ metadata.gz: 57bff744c235ba470d960f116eb5d28883e224d0d72910012e5264e24ae0c51e68618366255746bc07803aa7d934b55667e4b3df9bc6c1b9a66b523d171c4cef
7
+ data.tar.gz: b9cf16c68a1fd6e92c97f037f2dd55ccbb321fda0574e5fef651702982939758c786d8f60da6f5d884ed9d682fd17327716eedf10a50d6c5ea13ba266305f3dc
@@ -3,8 +3,13 @@ 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.8...master)
6
+ ## [Unreleased](https://github.com/rajatthareja/ReportBuilder/compare/v1.9...master)
7
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)
8
13
 
9
14
  ## [1.8](https://github.com/rajatthareja/ReportBuilder/compare/v1.7...v1.8) - 2018-09-02
10
15
  ### Fixed
data/README.md CHANGED
@@ -175,13 +175,6 @@ Use voice commands for easy navigation and search
175
175
 
176
176
  We're open to any contribution. It has to be tested properly though.
177
177
 
178
- ## Collaborators
179
-
180
- * [Rajat Thareja](https://rajatthareja.com)
181
- * [Justin Commu](https://github.com/tk8817)
182
- * [Eric Kessler](https://github.com/enkessler)
183
- * [Jeff Morgan](https://github.com/cheezy)
184
-
185
178
  ## License
186
179
 
187
180
  Copyright (c) 2017 [MIT LICENSE](LICENSE)
@@ -37,7 +37,7 @@ opt_parser = OptionParser.new do |opts|
37
37
  options[:include_images] = include_images
38
38
  end
39
39
 
40
- opts.on('-vc', '--voice_commands', 'Enable voice commands for easy navigation and search') do |voice_commands|
40
+ opts.on('--voice_commands', 'Enable voice commands for easy navigation and search') do |voice_commands|
41
41
  options[:voice_commands] = voice_commands
42
42
  end
43
43
 
@@ -50,8 +50,9 @@ opt_parser = OptionParser.new do |opts|
50
50
  end
51
51
 
52
52
  opts.on('-I', '--info a:x,b:y,c:z', Array, 'List of additional info') do |list|
53
+ options[:additional_info] = { }
53
54
  list.each do |i|
54
- key, value = i.split(':')
55
+ key, value = i.split(':', 2)
55
56
  options[:additional_info][key] = value
56
57
  end
57
58
  end
@@ -39,7 +39,7 @@ module ReportBuilder
39
39
  html_report_path = options[:html_report_path] || options[:report_path]
40
40
  if options[:report_types].include? 'HTML'
41
41
  File.open(html_report_path + '.html', 'w') do |file|
42
- file.write get(groups.size > 1 ? 'group_report' : 'report').result(binding).gsub(' ', '').gsub("\n\n", '')
42
+ file.write get(groups.size > 1 ? 'group_report' : 'report').result(binding)
43
43
  end
44
44
  end
45
45
 
@@ -73,13 +73,17 @@ module ReportBuilder
73
73
  input_path.each do |group_name, group_path|
74
74
  files = get_files group_path
75
75
  puts "Error:: No file(s) found at #{group_path}" if files.empty?
76
- groups << {'name' => group_name, 'features' => get_features(files)} rescue next
76
+ groups << {'name' => group_name, 'features' => get_features(files)}
77
77
  end
78
- raise 'Error:: Invalid Input File(s). Please provide valid cucumber JSON output file(s)' if groups.empty?
79
78
  else
80
79
  files = get_files input_path
81
80
  raise "Error:: No file(s) found at #{input_path}" if files.empty?
82
- groups << {'features' => get_features(files)} # rescue raise('Error:: Invalid Input File(s). Please provide valid cucumber JSON output file(s)')
81
+ groups << {'features' => get_features(files)}
82
+ end
83
+ groups.each do |this_group|
84
+ this_group['features'].each do |feature|
85
+ feature['elements'] = feature['elements'].sort_by { |v| v['line']}
86
+ end
83
87
  end
84
88
  groups
85
89
  end
@@ -116,6 +120,7 @@ module ReportBuilder
116
120
  features << JSON.parse(data)
117
121
  rescue StandardError
118
122
  puts 'Warning:: Invalid Input File ' + file
123
+ puts 'JSON Error:: ' + $!.to_s
119
124
  next
120
125
  end
121
126
  end.flatten.group_by do |feature|
@@ -190,11 +195,11 @@ module ReportBuilder
190
195
  scenario.merge! 'status' => scenario_status(scenario), 'duration' => total_time(scenario['before']) + total_time(scenario['steps']) + total_time(scenario['after'])
191
196
  end
192
197
  feature['elements'] = feature['elements'].group_by do |scenario|
193
- scenario['id'] + scenario['line'].to_s
198
+ scenario['id'] + ':' + scenario['line'].to_s
194
199
  end.values.map do |scenario_group|
195
200
  the_scenario = scenario_group.find do |scenario|
196
201
  scenario['status'] == 'passed'
197
- end || scenario_group.first
202
+ end || scenario_group.last
198
203
  if scenario_group.size > 1
199
204
  the_scenario['name'] += " (x#{scenario_group.size})"
200
205
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'report_builder'
3
- s.version = '1.8'
3
+ s.version = '1.9'
4
4
  s.bindir = 'bin'
5
5
  s.summary = 'ReportBuilder'
6
6
  s.description = 'Ruby gem to merge Cucumber JSON reports and build mobile-friendly HTML Test Report, JSON report and retry file.'
@@ -9,14 +9,14 @@ Gem::Specification.new do |s|
9
9
  s.email = 'rajat.thareja.1990@gmail.com'
10
10
  s.homepage = 'https://reportbuilder.rajatthareja.com'
11
11
  s.license = 'MIT'
12
- s.required_ruby_version = '>= 1.9.3'
12
+ s.required_ruby_version = '>= 2.0.0'
13
13
  s.requirements << 'Cucumber >= 2.1.0 test results in JSON format'
14
14
 
15
15
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(sample/|css/|js/|pkg/|testing/|coverage/|CNAME|.gitignore|appveyor.yml|.travis.yml|_config.yml|Gemfile|Rakefile|rb.ico)}) }
16
16
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
17
  s.test_files = s.files.grep(%r{^(testing)/})
18
18
 
19
- s.add_runtime_dependency 'json', '>= 1.8.1'
19
+ s.add_runtime_dependency 'json', '>= 2.3.0'
20
20
 
21
21
  s.add_development_dependency 'rake', '< 13.0'
22
22
  s.add_development_dependency 'rspec', '< 4.0'
@@ -4,18 +4,18 @@
4
4
  </div>
5
5
 
6
6
  <div class="collapsible-body <%= options[:color] %> lighten-4">
7
- <ul class="collection failedScenarioList">
7
+ <div class="collection failedScenarioList">
8
8
  <% features.each_with_index do |feature, f| %>
9
9
  <% feature['elements'].each_with_index do |scenario, s| %>
10
10
  <% if scenario['error'] %>
11
11
  <% if scenario['error'] == error %>
12
- <li class="collection-item failedScenario <%= options[:color] %> lighten-5 red-text">
13
- <i class="material-icons">highlight_off</i>&nbsp;<a class="modal-trigger red-text" href="#<%= "#{gid}f#{f}s#{s}" %>"><%= scenario['name'] %></a>
14
- </li>
12
+ <a class="collection-item failedScenario <%= options[:color] %> lighten-5 red-text modal-trigger waves-effect waves-light" href="#<%= "#{gid}f#{f}s#{s}" %>">
13
+ <i class="material-icons">highlight_off</i>&nbsp;<%= scenario['name'] %>
14
+ </a>
15
15
  <% end %>
16
16
  <% end %>
17
17
  <% end %>
18
18
  <% end %>
19
- </ul>
19
+ </div>
20
20
  </div>
21
21
  </li>
@@ -5,14 +5,12 @@
5
5
  </div>
6
6
 
7
7
  <div class="collapsible-body <%= options[:color] %> lighten-4">
8
- <ul class="collection scenarioList">
8
+ <div class="collection scenarioList <%= options[:color] %>">
9
9
  <% feature['elements'].each_with_index do |scenario, s| %>
10
- <li class="collection-item scenario <%= scenario['status'] %>">
11
- <a class="waves-effect waves-light modal-trigger white-text" href="#<%= "#{fid}s#{s}" %>">
12
- <b><%= scenario['keyword'] %></b> <%= scenario['name'] %>&nbsp;(<%= duration(scenario['duration']) %>)
13
- </a>
14
- </li>
10
+ <a class="collection-item scenario modal-trigger waves-effect waves-light white-text <%= scenario['status'] %>" href="#<%= "#{fid}s#{s}" %>">
11
+ <b><%= scenario['keyword'] %></b> <%= scenario['name'] %>&nbsp;(<%= duration(scenario['duration']) %>)
12
+ </a>
15
13
  <% end %>
16
- </ul>
14
+ </div>
17
15
  </div>
18
16
  </li>
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
  </footer>
9
9
 
10
- <script type="text/javascript" src="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.8/js/report.builder.min.js"></script>
10
+ <script type="text/javascript" src="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.9/js/report.builder.min.js"></script>
11
11
 
12
12
  <% if options[:voice_commands] %>
13
13
  <script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>
@@ -8,7 +8,7 @@
8
8
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
9
9
  <link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
10
10
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" media="screen,projection"/>
11
- <link href="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.8/css/report.builder.min.css" rel="stylesheet">
11
+ <link href="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.9/css/report.builder.min.css" rel="stylesheet">
12
12
 
13
13
  <% if options[:additional_css] %>
14
14
  <% if options[:additional_css] =~ /^http(|s):\/\/.*\.css$/ %>
@@ -5,6 +5,12 @@
5
5
  <th>Scenario</th>
6
6
  <th class="hide">Tags</th>
7
7
  <th>Status</th>
8
+
9
+
10
+ <% if options[:tag_filter] %>
11
+ <th class="hide-on-small-only">Filtered Tags</th>
12
+ <% end %>
13
+
8
14
  <th class="hide-on-small-only">Error</th>
9
15
  </tr>
10
16
  </thead>
@@ -2,8 +2,8 @@
2
2
  <%= feature['name'] %>
3
3
  </td>
4
4
 
5
- <td class="hoverable">
6
- <a class="modal-trigger white-text" href="#<%= sid %>"><%= scenario['name'] %></a>
5
+ <td class="hoverable modal-trigger white-text" data-target="<%= sid %>">
6
+ <%= scenario['name'] %>
7
7
  </td>
8
8
 
9
9
  <td class="hide">
@@ -18,6 +18,16 @@
18
18
  <%= scenario['status'] %>
19
19
  </td>
20
20
 
21
+ <% if options[:tag_filter] %>
22
+ <td class="hide-on-small-only">
23
+ <% scenario['tags'].each do |tag| %>
24
+ <% if tag['name'].match(/#{options[:tag_filter]}/) %>
25
+ <%= tag['name'] %>
26
+ <% end %>
27
+ <% end %>
28
+ </td>
29
+ <% end %>
30
+
21
31
  <td class="hide-on-small-only">
22
32
  <% if scenario['error'] %>
23
33
  <%= scenario['error'] %>
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: report_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.8'
4
+ version: '1.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajat Thareja
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-02 00:00:00.000000000 Z
11
+ date: 2020-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.1
19
+ version: 2.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.1
26
+ version: 2.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - <
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - <
38
+ - - "<"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - <
45
+ - - "<"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '4.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - <
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.0'
55
55
  description: Ruby gem to merge Cucumber JSON reports and build mobile-friendly HTML
@@ -98,19 +98,18 @@ require_paths:
98
98
  - lib
99
99
  required_ruby_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.9.3
103
+ version: 2.0.0
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  requirements:
110
110
  - Cucumber >= 2.1.0 test results in JSON format
111
- rubyforge_project:
112
- rubygems_version: 2.4.6
113
- signing_key:
111
+ rubygems_version: 3.1.2
112
+ signing_key:
114
113
  specification_version: 4
115
114
  summary: ReportBuilder
116
115
  test_files: []