report_builder_fix 0.2 → 0.4
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 +4 -4
- data/bin/report_builder +1 -1
- data/bin/report_builder_fix +1 -1
- data/lib/.DS_Store +0 -0
- data/lib/report_builder/builder.rb +284 -0
- data/lib/report_builder/core-ext/hash.rb +10 -0
- data/lib/report_builder.rb +429 -0
- data/template/error.erb +21 -0
- data/template/errors.erb +5 -0
- data/template/feature.erb +16 -0
- data/template/features.erb +6 -0
- data/template/footer.erb +46 -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 +31 -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 +32 -0
- data/template/summary.erb +27 -0
- data/template/summary_row.erb +35 -0
- metadata +29 -14
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="<%= options[:color] %> lighten-5">
|
7
|
+
<div class="row <%= options[:color] %> lighten-1">
|
8
|
+
<div class="col m6 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 m6 s12 <%= options[:color] %> lighten-1">
|
13
|
+
<ul class="tabs <%= options[:color] %> lighten-1 row" style="overflow-x: hidden">
|
14
|
+
<li class="tab col s3">
|
15
|
+
<a class="<%= options[:color] %> lighten-3 active blue-text waves-effect waves-light tooltipped" data-tooltip="Results Overview" href="#overview"><i class="material-icons">assessment</i> Overview</a>
|
16
|
+
</li>
|
17
|
+
<li class="tab col s3">
|
18
|
+
<a class="<%= options[:color] %> lighten-3 white-text waves-effect waves-light tooltipped" data-tooltip="Scenarios by Features" href="#features"><i class="material-icons">view_headline</i> Features</a>
|
19
|
+
</li>
|
20
|
+
<li class="tab col s3">
|
21
|
+
<a class="<%= options[:color] %> lighten-3 white-text waves-effect waves-light tooltipped" data-tooltip="Scenarios Summary Table" href="#summary"><i class="material-icons">view_comfy</i> Summary</a>
|
22
|
+
</li>
|
23
|
+
<li class="tab col s3">
|
24
|
+
<a class="<%= options[:color] %> lighten-3 white-text waves-effect waves-light tooltipped" data-tooltip="Failed Scenarios" href="#errors"><i class="material-icons">bug_report</i> Errors</a>
|
25
|
+
</li>
|
26
|
+
</ul>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</header>
|
data/template/hook.erb
ADDED
@@ -0,0 +1,31 @@
|
|
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
|
+
<br>
|
17
|
+
<% if embedding['mime_type'] =~ /^image\/(png|gif|jpg|jpeg)/ %>
|
18
|
+
<% if options[:include_images] %>
|
19
|
+
<img class="materialboxed" data-caption='<%= scenario['name'] %>' width="250" src="data:<%= embedding['mime_type'] %>;base64,<%= embedding['data'] %>">
|
20
|
+
<% end %>
|
21
|
+
<% elsif embedding['mime_type'] =~ /^text\/plain/ %>
|
22
|
+
<% if embedding['data'].include?('|||') %>
|
23
|
+
<% title, link = embedding['data'].split('|||') %><a href="<%= link %>"><%= title %></a>
|
24
|
+
<% else %>
|
25
|
+
<a href="<%= embedding['data'] %>"><%= embedding['data'] %></a>
|
26
|
+
<% end %>
|
27
|
+
<% elsif embedding['mime_type'] =~ /^text\/html/ %>
|
28
|
+
<%= embedding['data'] %>
|
29
|
+
<% end %>
|
30
|
+
<% end %>
|
31
|
+
<% 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="<%= options[:color] %> lighten-5">
|
15
|
+
<div class="row">
|
16
|
+
|
17
|
+
<div id="overview" class="col s12 <%= options[:color] %> lighten-5">
|
18
|
+
<%= get('overview').result(binding) %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div id="features" class="col s12 <%= options[:color] %> lighten-5 white-text">
|
22
|
+
<%= get('features').result(binding) %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div id="summary" class="col s12 <%= options[:color] %> lighten-5">
|
26
|
+
<%= get('summary').result(binding) %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div id="errors" class="col s12 <%= options[:color] %> 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,32 @@
|
|
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['doc_string'] %>
|
11
|
+
<%= '<br/><pre>' + ERB::Util.html_escape(step['doc_string']['value']) + '</pre>' %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<% if step['rows'] %>
|
15
|
+
<% step['rows'].each do |row| %>
|
16
|
+
<%= '<br/>| ' %>
|
17
|
+
<% row['cells'].each do |cell| %>
|
18
|
+
<%= cell + ' | ' %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%#step part as hook%>
|
24
|
+
<% hook = step %>
|
25
|
+
<%= get('hook').result(binding) %>
|
26
|
+
|
27
|
+
<% if step['after'] %>
|
28
|
+
<% step['after'].each do |hook| %>
|
29
|
+
<%= get('hook').result(binding) %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
</li>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<table id="summaryTable" class="bordered <%= options[:color] %> 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
|
+
|
9
|
+
|
10
|
+
<% if options[:tag_filter] %>
|
11
|
+
<th class="hide-on-small-only">Filtered Tags</th>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<th class="hide-on-small-only">Error</th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% features.each_with_index do |feature, f| %>
|
19
|
+
<% feature['elements'].each_with_index do |scenario, s| %>
|
20
|
+
<% sid = "#{gid}f#{f}s#{s}" %>
|
21
|
+
<tr class="<%= scenario['status'] %>">
|
22
|
+
<%= get('summary_row').result(binding) %>
|
23
|
+
</tr>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
</tbody>
|
27
|
+
</table>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<td class="hide-on-small-only">
|
2
|
+
<%= feature['name'] %>
|
3
|
+
</td>
|
4
|
+
|
5
|
+
<td class="hoverable modal-trigger white-text" data-target="<%= sid %>">
|
6
|
+
<%= scenario['name'] %>
|
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
|
+
<% 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
|
+
|
31
|
+
<td class="hide-on-small-only">
|
32
|
+
<% if scenario['error'] %>
|
33
|
+
<%= scenario['error'] %>
|
34
|
+
<% end %>
|
35
|
+
</td>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: report_builder_fix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fikri Ramadhan
|
@@ -17,27 +17,19 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.3.0
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
20
|
+
- - ">="
|
25
21
|
- !ruby/object:Gem::Version
|
26
22
|
version: 2.3.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: report_builder
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.9.0
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
27
|
- - "~>"
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
29
|
+
version: 2.3.0
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.3.0
|
41
33
|
description: Fix Report Builder.
|
42
34
|
email: fire_a2003@yahoo.com
|
43
35
|
executables:
|
@@ -49,8 +41,31 @@ files:
|
|
49
41
|
- bin/report_builder
|
50
42
|
- bin/report_builder_fix
|
51
43
|
- lib/.DS_Store
|
44
|
+
- lib/report_builder.rb
|
45
|
+
- lib/report_builder/builder.rb
|
46
|
+
- lib/report_builder/core-ext/hash.rb
|
52
47
|
- lib/report_builder_fix.rb
|
53
48
|
- lib/report_builder_fix/builder.rb
|
49
|
+
- template/error.erb
|
50
|
+
- template/errors.erb
|
51
|
+
- template/feature.erb
|
52
|
+
- template/features.erb
|
53
|
+
- template/footer.erb
|
54
|
+
- template/group_errors.erb
|
55
|
+
- template/group_features.erb
|
56
|
+
- template/group_overview.erb
|
57
|
+
- template/group_report.erb
|
58
|
+
- template/group_summary.erb
|
59
|
+
- template/head.erb
|
60
|
+
- template/header.erb
|
61
|
+
- template/hook.erb
|
62
|
+
- template/overview.erb
|
63
|
+
- template/report.erb
|
64
|
+
- template/scenario.erb
|
65
|
+
- template/scenarios.erb
|
66
|
+
- template/step.erb
|
67
|
+
- template/summary.erb
|
68
|
+
- template/summary_row.erb
|
54
69
|
homepage: https://github.com/boseagr/ReportBuilder
|
55
70
|
licenses:
|
56
71
|
- MIT
|