report_builder 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/README.md +59 -30
- data/lib/report_builder.rb +18 -3
- data/lib/report_builder/builder.rb +54 -19
- data/report_builder.gemspec +4 -4
- data/template/error.erb +21 -0
- data/template/errors.erb +5 -0
- data/template/feature.erb +18 -0
- data/template/features.erb +6 -0
- data/template/footer.erb +20 -0
- data/template/group_errors.erb +18 -0
- data/template/group_features.erb +18 -0
- data/template/group_overview.erb +33 -0
- data/template/group_report.erb +39 -0
- data/template/group_summary.erb +25 -0
- data/template/head.erb +22 -0
- data/template/header.erb +29 -0
- data/template/hook.erb +28 -0
- data/template/overview.erb +29 -0
- data/template/report.erb +37 -0
- data/template/scenario.erb +35 -0
- data/template/scenarios.erb +14 -0
- data/template/step.erb +28 -0
- data/template/summary.erb +21 -0
- data/template/summary_row.erb +25 -0
- metadata +24 -10
- data/.gitignore +0 -6
- data/.travis.yml +0 -15
- data/Gemfile +0 -4
- data/Rakefile +0 -14
- data/lib/report_builder.rake +0 -6
- data/template/html_report.erb +0 -356
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col m4 s12">
|
3
|
+
<canvas id="featuresDoughnut" width="400" height="400"></canvas>
|
4
|
+
<table id="metaDataFeatures" class="bordered">
|
5
|
+
<tbody></tbody>
|
6
|
+
</table>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="col m4 s12">
|
10
|
+
<canvas id="scenariosDoughnut" width="400" height="400"></canvas>
|
11
|
+
<table id="metaDataScenarios" class="bordered">
|
12
|
+
<tbody></tbody>
|
13
|
+
</table>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="col m4 s12">
|
17
|
+
<table id="metaData" class="bordered">
|
18
|
+
<tbody>
|
19
|
+
<tr><th>Total Time</th><td><%= duration(total_time(groups.map{|g| g['features']}.flatten)) %></td></tr>
|
20
|
+
<% options[:additional_info].each do |key, value| %>
|
21
|
+
<tr>
|
22
|
+
<th><%= key %></th>
|
23
|
+
<td><%= value %></td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="col s12">
|
31
|
+
<canvas id="groupBarChart"></canvas>
|
32
|
+
</div>
|
33
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<%= get('head').result(binding) %>
|
4
|
+
<body>
|
5
|
+
<%= get('header').result(binding) %>
|
6
|
+
|
7
|
+
<% errors = [] %>
|
8
|
+
|
9
|
+
<% groups.each_with_index do |group, g| %>
|
10
|
+
<% gid = "g#{g}" %>
|
11
|
+
<% features = group['features'] %>
|
12
|
+
<%= get('scenarios').result(binding) %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<main class="brown lighten-5">
|
16
|
+
<div class="row">
|
17
|
+
<div id="overview" class="col s12 brown lighten-5">
|
18
|
+
<%= get('group_overview').result(binding) %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div id="features" class="col s12 brown lighten-5 white-text">
|
22
|
+
<%= get('group_features').result(binding) %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div id="summary" class="col s12 brown lighten-5">
|
26
|
+
<%= get('group_summary').result(binding) %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="errors" class="col s12 brown lighten-5">
|
30
|
+
<%= get('group_errors').result(binding) %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</main>
|
34
|
+
|
35
|
+
<script type="text/javascript" src="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.4/js/group.report.builder.min.js"></script>
|
36
|
+
|
37
|
+
<%= get('footer').result(binding) %>
|
38
|
+
</body>
|
39
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<table id="summaryTable" class="bordered brown lighten-1 white-text" width="100%">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th class="hide-on-small-only">Group</th>
|
5
|
+
<th class="hide-on-small-only">Feature</th>
|
6
|
+
<th>Scenario</th>
|
7
|
+
<th class="hide">Tags</th>
|
8
|
+
<th>Status</th>
|
9
|
+
<th class="hide-on-small-only">Error</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% groups.each_with_index do |group, g| %>
|
14
|
+
<% group['features'].each_with_index do |feature, f| %>
|
15
|
+
<% feature['elements'].each_with_index do |scenario, s| %>
|
16
|
+
<% sid = "g#{g}f#{f}s#{s}" %>
|
17
|
+
<tr class="<%= scenario['status'] %>">
|
18
|
+
<td class="hide-on-small-only"><%= group['name'] %></td>
|
19
|
+
<%= get('summary_row').result(binding) %>
|
20
|
+
</tr>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
data/template/head.erb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
<head>
|
2
|
+
<meta charset="utf-8">
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
4
|
+
|
5
|
+
<title><%= options[:report_title] %></title>
|
6
|
+
|
7
|
+
<link rel="icon" href="http://reportbuilder.rajatthareja.com/rb.ico">
|
8
|
+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
9
|
+
<link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
|
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.4/css/report.builder.min.css" rel="stylesheet">
|
12
|
+
|
13
|
+
<% if options[:additional_css] %>
|
14
|
+
<% if options[:additional_css] =~ /^http(|s):\/\/.*\.css$/ %>
|
15
|
+
<link rel="stylesheet" href="<%= options[:additional_css] %>" media="all"/>
|
16
|
+
<% else %>
|
17
|
+
<style type="text/css">
|
18
|
+
<%= options[:additional_css]%>
|
19
|
+
</style>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</head>
|
data/template/header.erb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
|
2
|
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
|
3
|
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.min.js"></script>
|
4
|
+
<script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
|
5
|
+
|
6
|
+
<header class="brown lighten-5">
|
7
|
+
<div class="row brown lighten-1">
|
8
|
+
<div class="col m8 hide-on-small-only">
|
9
|
+
<h5 class="truncate white-text tooltipped" data-tooltip="<%= options[:report_title] %>"><%= options[:report_title] %></h5>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="col m4 s12 brown lighten-1">
|
13
|
+
<ul class="tabs brown lighten-1">
|
14
|
+
<li class="tab col s3">
|
15
|
+
<a class="btn brown lighten-3 active blue-text waves-effect waves-light tooltipped" data-tooltip="Overview" href="#overview"><i class="material-icons">public</i></a>
|
16
|
+
</li>
|
17
|
+
<li class="tab col s3">
|
18
|
+
<a class="btn brown lighten-3 white-text waves-effect waves-light tooltipped" data-tooltip="Features" href="#features"><i class="material-icons">view_headline</i></a>
|
19
|
+
</li>
|
20
|
+
<li class="tab col s3">
|
21
|
+
<a class="btn brown lighten-3 white-text waves-effect waves-light tooltipped" data-tooltip="Summary" href="#summary"><i class="material-icons">view_comfy</i></a>
|
22
|
+
</li>
|
23
|
+
<li class="tab col s3">
|
24
|
+
<a class="btn brown lighten-3 white-text waves-effect waves-light tooltipped" data-tooltip="Errors" href="#errors"><i class="material-icons">bug_report</i></a>
|
25
|
+
</li>
|
26
|
+
</ul>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</header>
|
data/template/hook.erb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
<% if hook['output'] %>
|
2
|
+
<% hook['output'].each do |output| %>
|
3
|
+
<pre><%= output %></pre>
|
4
|
+
<% end %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<% if hook['result']['error_message'] %>
|
8
|
+
<% error = ERB::Util.html_escape hook['result']['error_message'] %>
|
9
|
+
<% scenario['error'] = error.split("\n").first %>
|
10
|
+
<% errors << scenario['error'] %>
|
11
|
+
<pre><%= error %></pre>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<% if hook['embeddings'] %>
|
15
|
+
<% hook['embeddings'].each do |embedding| %>
|
16
|
+
<% if embedding['mime_type'] =~ /^image\/(png|gif|jpg|jpeg)/ %>
|
17
|
+
<% if options[:include_images] %>
|
18
|
+
<img class="materialboxed" data-caption='<%= scenario['name'] %>' width="250" src="data:<%= embedding['mime_type'] %>;base64,<%= embedding['data'] %>">
|
19
|
+
<% end %>
|
20
|
+
<% elsif embedding['mime_type'] =~ /^text\/plain/ %>
|
21
|
+
<% if embedding['data'].include?('|||') %>
|
22
|
+
<% title, link = embedding['data'].split('|||') %><a href="<%= link %>"><%= title %></a>
|
23
|
+
<% else %>
|
24
|
+
<%= embedding['data'] %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col m4 s12">
|
3
|
+
<canvas id="featuresDoughnut" width="400" height="400"></canvas>
|
4
|
+
<table id="metaDataFeatures" class="bordered">
|
5
|
+
<tbody></tbody>
|
6
|
+
</table>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="col m4 s12">
|
10
|
+
<canvas id="scenariosDoughnut" width="400" height="400"></canvas>
|
11
|
+
<table id="metaDataScenarios" class="bordered">
|
12
|
+
<tbody></tbody>
|
13
|
+
</table>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="col m4 s12">
|
17
|
+
<table id="metaData" class="bordered">
|
18
|
+
<tbody>
|
19
|
+
<tr><th>Total Time</th><td><%= duration(total_time(features)) %></td></tr>
|
20
|
+
<% options[:additional_info].each do |key, value| %>
|
21
|
+
<tr>
|
22
|
+
<th><%= key %></th>
|
23
|
+
<td><%= value %></td>
|
24
|
+
</tr>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
28
|
+
</div>
|
29
|
+
</div>
|
data/template/report.erb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<%= get('head').result(binding) %>
|
4
|
+
<body>
|
5
|
+
<%= get('header').result(binding) %>
|
6
|
+
|
7
|
+
<% errors = [] %>
|
8
|
+
|
9
|
+
<% gid = 'g0' %>
|
10
|
+
<% features = groups.first['features'] %>
|
11
|
+
|
12
|
+
<%= get('scenarios').result(binding) %>
|
13
|
+
|
14
|
+
<main class="brown lighten-5">
|
15
|
+
<div class="row">
|
16
|
+
|
17
|
+
<div id="overview" class="col s12 brown lighten-5">
|
18
|
+
<%= get('overview').result(binding) %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div id="features" class="col s12 brown lighten-5 white-text">
|
22
|
+
<%= get('features').result(binding) %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div id="summary" class="col s12 brown lighten-5">
|
26
|
+
<%= get('summary').result(binding) %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="errors" class="col s12 brown lighten-5">
|
30
|
+
<%= get('errors').result(binding) %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</main>
|
34
|
+
|
35
|
+
<%= get('footer').result(binding) %>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<div id="<%= sid %>" class="modal modal-fixed-footer">
|
2
|
+
<div class="modal-content">
|
3
|
+
|
4
|
+
<% if scenario['tags'] %>
|
5
|
+
<% scenario['tags'].each do |tag| %>
|
6
|
+
<div class="chip"><i class="material-icons rotate-45">label</i><%= tag['name'] %></div>
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<h5><%= scenario['name'] %> (<%= duration(scenario['duration']) %>)</h5>
|
11
|
+
<%= feature['uri'] %>:<%= scenario['line'] %>
|
12
|
+
|
13
|
+
<% if scenario['before'] %>
|
14
|
+
<% scenario['before'].each do |hook| %>
|
15
|
+
<%= get('hook').result(binding) %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<ul class="collection stepList">
|
20
|
+
<% scenario['steps'].each do |step| %>
|
21
|
+
<%= get('step').result(binding) %>
|
22
|
+
<% end %>
|
23
|
+
</ul>
|
24
|
+
|
25
|
+
<% if scenario['after'] %>
|
26
|
+
<% scenario['after'].each do |hook| %>
|
27
|
+
<%= get('hook').result(binding) %>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="modal-footer">
|
33
|
+
<span class="modal-action modal-close waves-effect waves-green btn-flat"><i class="material-icons">close</i></span>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% features.each_with_index do |feature, f| %>
|
2
|
+
<% feature['elements'].each_with_index do |scenario, s| %>
|
3
|
+
<% sid = "#{gid}f#{f}s#{s}" %>
|
4
|
+
<%= get('scenario').result(binding) %>
|
5
|
+
<% end %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<script type="text/javascript">
|
9
|
+
$(document).ready(function () {
|
10
|
+
<%features.each_with_index do |feature, f|%><%(0..feature['elements'].size).each do |s|%>
|
11
|
+
$('#<%="#{gid}f#{f}s#{s}"%>').modal();
|
12
|
+
<%end%><%end%>
|
13
|
+
});
|
14
|
+
</script>
|
data/template/step.erb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
<li class="collection-item step <%= step['status'] %>">
|
2
|
+
<% if step['before'] %>
|
3
|
+
<% step['before'].each do |hook| %>
|
4
|
+
<%= get('hook').result(binding) %>
|
5
|
+
<% end %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<b><%= step['keyword'] %></b> <%= step['name'] %> (<%= duration(step['duration']) %>)
|
9
|
+
|
10
|
+
<% if step['rows'] %>
|
11
|
+
<% step['rows'].each do |row| %>
|
12
|
+
<%= '<br/>| ' %>
|
13
|
+
<% row['cells'].each do |cell| %>
|
14
|
+
<%= cell + ' | ' %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%#step part as hook%>
|
20
|
+
<% hook = step %>
|
21
|
+
<%= get('hook').result(binding) %>
|
22
|
+
|
23
|
+
<% if step['after'] %>
|
24
|
+
<% step['after'].each do |hook| %>
|
25
|
+
<%= get('hook').result(binding) %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
</li>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<table id="summaryTable" class="bordered brown lighten-1 white-text" width="100%">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th class="hide-on-small-only">Feature</th>
|
5
|
+
<th>Scenario</th>
|
6
|
+
<th class="hide">Tags</th>
|
7
|
+
<th>Status</th>
|
8
|
+
<th class="hide-on-small-only">Error</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% features.each_with_index do |feature, f| %>
|
13
|
+
<% feature['elements'].each_with_index do |scenario, s| %>
|
14
|
+
<% sid = "#{gid}f#{f}s#{s}" %>
|
15
|
+
<tr class="<%= scenario['status'] %>">
|
16
|
+
<%= get('summary_row').result(binding) %>
|
17
|
+
</tr>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<td class="hide-on-small-only">
|
2
|
+
<%= feature['name'] %>
|
3
|
+
</td>
|
4
|
+
|
5
|
+
<td class="hoverable">
|
6
|
+
<a class="modal-trigger white-text" href="#<%= sid %>"><%= scenario['name'] %></a>
|
7
|
+
</td>
|
8
|
+
|
9
|
+
<td class="hide">
|
10
|
+
<% if scenario['tags'] %>
|
11
|
+
<% scenario['tags'].each do |tag| %>
|
12
|
+
<%= tag['name'] + '. ' %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
</td>
|
16
|
+
|
17
|
+
<td class="uppercase">
|
18
|
+
<%= scenario['status'] %>
|
19
|
+
</td>
|
20
|
+
|
21
|
+
<td class="hide-on-small-only">
|
22
|
+
<% if scenario['error'] %>
|
23
|
+
<%= scenario['error'] %>
|
24
|
+
<% end %>
|
25
|
+
</td>
|
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: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajat Thareja
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - <
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4.0'
|
55
|
-
description: Ruby gem to merge Cucumber JSON reports and build mobile
|
55
|
+
description: Ruby gem to merge Cucumber JSON reports and build mobile-friendly HTML
|
56
56
|
Test Report, JSON report and retry file.
|
57
57
|
email: rajat.thareja.1990@gmail.com
|
58
58
|
executables:
|
@@ -60,21 +60,35 @@ executables:
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
64
|
-
- .travis.yml
|
65
63
|
- CHANGELOG.md
|
66
|
-
- Gemfile
|
67
64
|
- LICENSE
|
68
65
|
- README.md
|
69
|
-
- Rakefile
|
70
66
|
- bin/report_builder
|
71
|
-
- lib/report_builder.rake
|
72
67
|
- lib/report_builder.rb
|
73
68
|
- lib/report_builder/builder.rb
|
74
69
|
- lib/report_builder/core-ext/hash.rb
|
75
70
|
- report_builder.gemspec
|
76
|
-
- template/
|
77
|
-
|
71
|
+
- template/error.erb
|
72
|
+
- template/errors.erb
|
73
|
+
- template/feature.erb
|
74
|
+
- template/features.erb
|
75
|
+
- template/footer.erb
|
76
|
+
- template/group_errors.erb
|
77
|
+
- template/group_features.erb
|
78
|
+
- template/group_overview.erb
|
79
|
+
- template/group_report.erb
|
80
|
+
- template/group_summary.erb
|
81
|
+
- template/head.erb
|
82
|
+
- template/header.erb
|
83
|
+
- template/hook.erb
|
84
|
+
- template/overview.erb
|
85
|
+
- template/report.erb
|
86
|
+
- template/scenario.erb
|
87
|
+
- template/scenarios.erb
|
88
|
+
- template/step.erb
|
89
|
+
- template/summary.erb
|
90
|
+
- template/summary_row.erb
|
91
|
+
homepage: http://reportbuilder.rajatthareja.com
|
78
92
|
licenses:
|
79
93
|
- MIT
|
80
94
|
metadata: {}
|