report_builder 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/report_builder.rb +14 -11
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a02a160839263fa8a73421ed212a701fd99e1a9
4
- data.tar.gz: cce242fe18d1049603c13dd7251da9d38f69a0da
3
+ metadata.gz: cef2bf351bdf5be7463f962566206aafa107b004
4
+ data.tar.gz: 15625f37e23b438215e391521f46d7be78df55d5
5
5
  SHA512:
6
- metadata.gz: f85b432d58028bdf470c660ce4ce5d027b6629897d00726a0521c74f012c89e237d35b3bfaa0733ae0b8d7b904b47504f433ec07c092809a325e0ecb86764ef8
7
- data.tar.gz: 5b5043dbee9c937f779cd12e2d63dc105f29f40364ae245c686bee03dac2c7b5e6918f90d5c3edc491141f58de32850cd208198b1ef4038849697f741bd5f3e0
6
+ metadata.gz: 4e65e83dff1cba27ac3c41d0da39e415c24ffbc10d390e8f0df4dc0f134e6554cce4687004080db63353ea560b053ea5aa05d746ac2ff335966952b9b305f86f
7
+ data.tar.gz: 2c05c1b33da6080344983815b0992f794a03dab088a26230a21c77e607d6e02c92fedb84a090918d6959c08c6a9d9966f2741414a7521915816a7f59877fc53f
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ReportBuilder
2
- [![Gem Version](https://badge.fury.io/rb/report_builder.svg)](https://badge.fury.io/rb/report_builder)
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/report_builder.svg)](https://badge.fury.io/rb/report_builder)
4
+ [![Join the chat at https://gitter.im/rajatthareja/ReportBuilder](https://badges.gitter.im/rajatthareja/ReportBuilder.svg)](https://gitter.im/rajatthareja/ReportBuilder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3
5
 
4
6
  Ruby gem to merge Cucumber JSON reports and build single HTML Test Report
5
7
 
@@ -39,7 +39,7 @@ class ReportBuilder
39
39
  failed: '#f45b5b',
40
40
  broken: '#f45b5b',
41
41
  undefined: '#e4d354',
42
- unknown: '#e4d354',
42
+ incomplete: '#e7a35c',
43
43
  pending: '#f7a35c',
44
44
  skipped: '#7cb5ec',
45
45
  output: '#007fff'
@@ -222,7 +222,7 @@ class ReportBuilder
222
222
  end
223
223
  @builder.div do
224
224
  @builder.div(id: data[0]) do
225
- data[1].each{|scenario| build_scenario scenario}
225
+ data[1].sort_by{|scenario| scenario['name']}.each{|scenario| build_scenario scenario}
226
226
  end
227
227
  end
228
228
  end
@@ -244,12 +244,14 @@ class ReportBuilder
244
244
  @builder << donut_js('scenarioTabPieChart', 'Scenarios', scenario_data) if @options[:report_tabs].include? 'scenarios'
245
245
  @builder << pie_chart_js('stepPieChart', 'Steps', step_data) if @options[:report_tabs].include? 'overview'
246
246
  unless all_tags.empty?
247
- @builder << '$("#featuresTab .select-tags").change(function(){var val = $(this).val();$("#featuresTab .scenario-all").next().hide();
248
- $("#featuresTab .scenario-all").hide();$("#featuresTab ." + val).show();});' if @options[:report_tabs].include? 'features'
249
- @builder << '$("#scenariosTab .select-tags").change(function(){var val = $(this).val();$("#scenariosTab .scenario-all").next().hide();
250
- $("#scenariosTab .scenario-all").hide();$("#scenariosTab ." + val).show();$("#scenariosTab #count").each(function(){
251
- status = $(this).parent().parent().prop("className");$("#scenariosTab ." + status + " #count").html(
252
- $("#scenariosTab #" + status + " ." + val).length);});});' if @options[:report_tabs].include? 'scenarios'
247
+ @builder << '$("#featuresTab .select-tags").change(function(){
248
+ $("#featuresTab .scenario-all").hide().next().hide().parent().hide().parent().hide().prev().hide();
249
+ $("#featuresTab ." + $(this).val()).show().parent().show().parent().prev().show();});' if @options[:report_tabs].include? 'features'
250
+ @builder << '$("#scenariosTab .select-tags").change(function(){var val = $(this).val();$("#scenariosTab .scenario-all").hide().next().hide();
251
+ $("#scenariosTab ." + val).show();$("#scenariosTab #count").each(function(){status = $(this).parent().parent().prop("className");
252
+ count = $("#scenariosTab #" + status + " ." + val).length;countElement = $("#scenariosTab ." + status + " #count");
253
+ countElement.parent().parent().parent().show();if(count==0){countElement.parent().parent().parent().hide().next().hide();}
254
+ countElement.html(count);});});' if @options[:report_tabs].include? 'scenarios'
253
255
  end
254
256
  end
255
257
 
@@ -312,7 +314,7 @@ class ReportBuilder
312
314
  end
313
315
 
314
316
  def self.build_data_table(rows)
315
- @builder.table(class: 'data_table') do
317
+ @builder.table(class: 'data_table', style: 'margin: 10px') do
316
318
  rows.each do |row|
317
319
  @builder.tr do
318
320
  row['cells'].each do |cell|
@@ -514,7 +516,7 @@ class ReportBuilder
514
516
  feature['uri']+feature['id']+feature['line'].to_s
515
517
  }.values.each_with_object([]) { |group, features|
516
518
  features << group.first.except('elements').merge('elements' => group.map{|feature| feature['elements']}.flatten)
517
- }.each{|feature|
519
+ }.sort_by!{|feature| feature['name']}.each{|feature|
518
520
  if feature['elements'][0]['type'] == 'background'
519
521
  (0..feature['elements'].size-1).step(2) do |i|
520
522
  feature['elements'][i]['steps'].each{|step| step['name']+=(' ('+feature['elements'][i]['keyword']+')')}
@@ -529,6 +531,7 @@ class ReportBuilder
529
531
  before['result']['duration'] ||= 0
530
532
  before.merge! 'status' => before['result']['status'], 'duration' => before['result']['duration']
531
533
  }
534
+ scenario['steps'] ||= []
532
535
  scenario['steps'].each { |step|
533
536
  step['result']['duration'] ||= 0
534
537
  duration = step['result']['duration']
@@ -557,7 +560,7 @@ class ReportBuilder
557
560
  feature['elements'].each do |scenario|
558
561
  status = scenario['status']
559
562
  return 'broken' if status == 'failed'
560
- feature_status = 'unknown' if %w(undefined pending).include?(status)
563
+ feature_status = 'incomplete' if %w(undefined pending).include?(status)
561
564
  end
562
565
  feature_status
563
566
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: report_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajat Thareja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder