report_builder 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- pkg/
2
- .idea/
3
- .DS_Store
4
- Gemfile.lock
5
- doc/
6
- .yardoc/
@@ -1,15 +0,0 @@
1
- os:
2
- - linux
3
- - osx
4
-
5
- language: ruby
6
- rvm:
7
- - 1.9.3
8
- - 2.4.0
9
- - jruby-9.1.7.0
10
-
11
- before_install:
12
- # Using a recent version of bundler in order to avoid gem installation errors
13
- - gem install bundler -v 1.15.4
14
-
15
- script: bundle exec rake report_builder:test_everything
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in report_builder.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- require 'rspec/core/rake_task'
2
- require "bundler/gem_tasks"
3
-
4
-
5
- namespace 'report_builder' do
6
-
7
- desc 'Test the project'
8
- RSpec::Core::RakeTask.new(:test_everything) do |t, args|
9
- t.rspec_opts = '--pattern testing/rspec/spec/**/*_spec.rb'
10
- end
11
-
12
- end
13
-
14
- task :default => 'report_builder:test_everything'
@@ -1,6 +0,0 @@
1
- desc 'Sample rake task to build report'
2
- task :report_builder, [:json_path, :report_path] do |t, args|
3
- args.with_defaults(:json_path => nil, :report_path => 'test_report')
4
- options = {:json_path => args.json_path, :report_path => args.report_path}
5
- ReportBuilder.build_report options
6
- end
@@ -1,356 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title><%=options[:report_title]%></title>
6
- <link rel="icon" href="http://reportbuilder.rajatthareja.com/rb.ico">
7
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
8
- <link href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css" rel="stylesheet">
9
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" media="screen,projection"/>
10
- <link href="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.3/css/report.builder.min.css" rel="stylesheet">
11
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
12
- <%if options[:additional_css]%>
13
- <%if options[:additional_css] =~ /^http(|s):\/\/.*\.css$/%>
14
- <link rel="stylesheet" href="<%=options[:additional_css]%>" media="all"/>
15
- <%else%>
16
- <style type="text/css">
17
- <%= options[:additional_css]%>
18
- </style>
19
- <%end%>
20
- <%end%>
21
- </head>
22
- <body>
23
-
24
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
25
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
26
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.min.js"></script>
27
- <script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
28
-
29
- <%errors = []%>
30
- <%features.each_with_index do |feature, f|%>
31
- <%feature['elements'].each_with_index do |scenario, s|%>
32
- <div id="f<%=f%>s<%=s%>" class="modal modal-fixed-footer">
33
- <div class="modal-content">
34
-
35
- <%if scenario['tags']%>
36
- <%scenario['tags'].each do |tag|%>
37
- <div class="chip"><i class="material-icons rotate-45">label</i><%=tag['name']%></div>
38
- <%end%>
39
- <%end%>
40
-
41
- <h5><%=scenario['name']%> (<%=duration(scenario['duration'])%>)</h5>
42
- <%=feature['uri']%>:<%=scenario['line']%>
43
-
44
- <%if scenario['before']%>
45
- <%scenario['before'].each do |before|%>
46
-
47
- <%if before['output']%>
48
- <%before['output'].each do |output|%>
49
- <pre><%=output%></pre>
50
- <%end%>
51
- <%end%>
52
-
53
- <%if before['result']['error_message']%>
54
- <pre><%=before['result']['error_message']%></pre>
55
- <%end%>
56
-
57
- <%end%>
58
- <%end%>
59
-
60
- <ul class="collection stepList">
61
- <%scenario['steps'].each do |step|%>
62
- <li class="collection-item step <%=step['status']%>">
63
-
64
- <%if scenario['before']%>
65
- <%scenario['before'].each do |before|%>
66
-
67
- <%if before['output']%>
68
- <%before['output'].each do |output|%>
69
- <pre><%=output%></pre>
70
- <%end%>
71
- <%end%>
72
-
73
- <%if before['result']['error_message']%>
74
- <pre><%=before['result']['error_message']%></pre>
75
- <%end%>
76
-
77
- <%end%>
78
- <%end%>
79
-
80
- <b><%=step['keyword']%></b> <%=step['name']%> (<%=duration(step['duration'])%>)
81
-
82
- <%if step['rows']%>
83
- <%step['rows'].each do |row|%>
84
- <%='<br/>| '%>
85
- <%row['cells'].each do |cell|%>
86
- <%=cell + ' | '%>
87
- <%end%>
88
- <%end%>
89
- <%end%>
90
-
91
- <%if step['output']%>
92
- <%step['output'].each do |output|%>
93
- <pre><%=output%></pre>
94
- <%end%>
95
- <%end%>
96
-
97
- <%if step['result']['error_message']%>
98
- <%scenario['error'] = step['result']['error_message'].split("\n").first%>
99
- <%errors << scenario['error']%>
100
- <pre class="error"><%=step['result']['error_message']%></pre>
101
- <%end%>
102
-
103
- <%if step['embeddings']%>
104
- <%step['embeddings'].each do |embedding|%>
105
- <%if embedding['mime_type'] =~ /^image\/(png|gif|jpg|jpeg)/ %>
106
- <%if options[:include_images]%>
107
- <img class="materialboxed" data-caption='<%=scenario['name']%>' width="250" src="data:<%=embedding['mime_type']%>;base64,<%=embedding['data']%>">
108
- <%end%>
109
- <%elsif embedding['mime_type'] =~ /^text\/plain/%>
110
- <%if embedding['data'].include?('|||')%>
111
- <%title, link = embedding['data'].split('|||')%><a href="<%=link%>"><%=title%></a>
112
- <%else%>
113
- <%=embedding['data']%>
114
- <%end%>
115
- <%end%>
116
- <%end%>
117
- <%end%>
118
-
119
- <%if step['after']%>
120
- <%step['after'].each do |after|%>
121
-
122
- <%if after['output']%>
123
- <%after['output'].each do |output|%>
124
- <pre><%=output%></pre>
125
- <%end%>
126
- <%end%>
127
-
128
- <%if after['result']['error_message']%>
129
- <pre><%=after['result']['error_message']%></pre>
130
- <%end%>
131
-
132
- <%if after['embeddings']%>
133
- <%after['embeddings'].each do |embedding|%>
134
- <%if embedding['mime_type'] =~ /^image\/(png|gif|jpg|jpeg)/ %>
135
- <%if options[:include_images]%>
136
- <img class="materialboxed" data-caption='<%=scenario['name']%>' width="250" src="data:<%=embedding['mime_type']%>;base64,<%=embedding['data']%>">
137
- <%end%>
138
- <%elsif embedding['mime_type'] =~ /^text\/plain/%>
139
- <%if embedding['data'].include?('|||')%>
140
- <%title, link = embedding['data'].split('|||')%><a href="<%=link%>"><%=title%></a>
141
- <%else%>
142
- <%=embedding['data']%>
143
- <%end%>
144
- <%end%>
145
- <%end%>
146
- <%end%>
147
-
148
- <%end%>
149
- <%end%>
150
-
151
- </li>
152
- <%end%>
153
-
154
- <%if scenario['after']%>
155
- <%scenario['after'].each do |after|%>
156
-
157
- <%if after['output']%>
158
- <%after['output'].each do |output|%>
159
- <pre><%=output%></pre>
160
- <%end%>
161
- <%end%>
162
-
163
- <%if after['result']['error_message']%>
164
- <pre><%=after['result']['error_message']%></pre>
165
- <%end%>
166
-
167
- <%if after['embeddings']%>
168
- <%after['embeddings'].each do |embedding|%>
169
- <%if embedding['mime_type'] =~ /^image\/(png|gif|jpg|jpeg)/ %>
170
- <%if options[:include_images]%>
171
- <img class="materialboxed" data-caption='<%=scenario['name']%>' width="250" src="data:<%=embedding['mime_type']%>;base64,<%=embedding['data']%>">
172
- <%end%>
173
- <%elsif embedding['mime_type'] =~ /^text\/plain/%>
174
- <%if embedding['data'].include?('|||')%>
175
- <%title, link = embedding['data'].split('|||')%><a href="<%=link%>"><%=title%></a>
176
- <%else%>
177
- <%=embedding['data']%>
178
- <%end%>
179
- <%end%>
180
- <%end%>
181
- <%end%>
182
-
183
- <%end%>
184
- <%end%>
185
- </ul>
186
- </div>
187
- <div class="modal-footer">
188
- <span class="modal-action modal-close waves-effect waves-green btn-flat"><i class="material-icons">close</i></span>
189
- </div>
190
- </div>
191
- <%end%>
192
- <%end%>
193
-
194
- <header class="brown lighten-5">
195
- <div class="row brown lighten-1">
196
- <div class="col m8 hide-on-small-only">
197
- <h5 class="truncate white-text tooltipped" data-tooltip="<%=options[:report_title]%>"><%=options[:report_title]%></h5>
198
- </div>
199
- <div class="col m4 s12 brown lighten-1">
200
- <ul class="tabs brown lighten-1">
201
- <li class="tab col s3">
202
- <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>
203
- </li>
204
- <li class="tab col s3">
205
- <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>
206
- </li>
207
- <li class="tab col s3">
208
- <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></li>
209
- <li class="tab col s3">
210
- <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>
211
- </li>
212
- </ul>
213
- </div>
214
- </div>
215
- </header>
216
-
217
- <main class="brown lighten-5">
218
- <div class="row">
219
- <div id="overview" class="col s12 brown lighten-5">
220
- <div class="row">
221
- <div class="col m4 s12">
222
- <canvas id="featuresDoughnut" width="400" height="400"></canvas>
223
- <table id="metaDataFeatures" class="bordered">
224
- <tbody></tbody>
225
- </table>
226
- </div>
227
- <div class="col m4 s12">
228
- <canvas id="scenariosDoughnut" width="400" height="400"></canvas>
229
- <table id="metaDataScenarios" class="bordered">
230
- <tbody></tbody>
231
- </table>
232
- </div>
233
- <div class="col m4 s12">
234
- <table id="metaData" class="bordered">
235
- <tbody>
236
- <%options[:additional_info].each do |key, value|%>
237
- <tr><th><%=key%></th><td><%=value%></td></tr>
238
- <%end%>
239
- </tbody>
240
- </table>
241
- </div>
242
- </div>
243
- </div>
244
- <div id="features" class="col s12 brown lighten-5 white-text">
245
- <ul class="featureList collapsible popout" data-collapsible="expandable">
246
- <%features.each_with_index do |feature, f|%>
247
- <li class="feature <%=feature['status']%>">
248
- <div class="collapsible-header brown lighten-1 waves-effect waves-light">
249
- <i class="material-icons">featured_play_list</i>
250
- <b><%=feature['keyword']%></b>&nbsp;<%=feature['name']%>&nbsp;(<%=duration(feature['duration'])%>)
251
- </div>
252
- <div class="collapsible-body brown lighten-4">
253
- <ul class="collection scenarioList">
254
- <%feature['elements'].each_with_index do |scenario, s|%>
255
- <li class="collection-item scenario <%=scenario['status']%>">
256
- <a class="waves-effect waves-light modal-trigger white-text" href="#f<%=f%>s<%=s%>">
257
- <b><%=scenario['keyword']%></b> <%=scenario['name']%>&nbsp;(<%=duration(scenario['duration'])%>)
258
- </a>
259
- </li>
260
- <%end%>
261
- </ul>
262
- </div>
263
- </li>
264
- <%end%>
265
- </ul>
266
- </div>
267
- <div id="summary" class="col s12 brown lighten-5">
268
- <table id="summaryTable" class="bordered brown lighten-1 white-text">
269
- <thead>
270
- <tr>
271
- <th class="hide-on-small-only">Feature</th>
272
- <th>Scenario</th>
273
- <th class="hide">Tags</th>
274
- <th>Status</th>
275
- <th class="hide-on-small-only">Error</th>
276
- </tr>
277
- </thead>
278
- <tbody>
279
- <%features.each_with_index do |feature, f|%>
280
- <%feature['elements'].each_with_index do |scenario, s|%>
281
- <tr class="<%=scenario['status']%>">
282
- <td class="hide-on-small-only"><%=feature['name']%></td>
283
- <td class="hoverable"><a class="modal-trigger white-text" href="#f<%=f%>s<%=s%>"><%=scenario['name']%></a></td>
284
- <%# Scenarios Tags for search and filter %>
285
- <td class="hide">
286
- <%if scenario['tags']%>
287
- <%scenario['tags'].each do |tag|%>
288
- <%=tag['name'] + '. '%>
289
- <%end%>
290
- <%end%>
291
- </td>
292
- <td class="uppercase"><%=scenario['status']%></td>
293
- <td class="hide-on-small-only"><%if scenario['error']%><%=scenario['error']%><%end%></td>
294
- </tr>
295
- <%end%>
296
- <%end%>
297
- </tbody>
298
- </table>
299
- </div>
300
- <div id="errors" class="col s12 brown lighten-5">
301
- <ul class="errorList collapsible popout" data-collapsible="expandable">
302
- <%errors.uniq.each do |error|%>
303
- <li class="error">
304
- <div class="collapsible-header red lighten-2 white-text waves-effect waves-light">
305
- <i class="material-icons">bug_report</i><%=error%>
306
- </div>
307
- <div class="collapsible-body brown lighten-4">
308
- <ul class="collection failedScenarioList">
309
- <%features.each_with_index do |feature, f|%>
310
- <%feature['elements'].each_with_index do |scenario, s|%>
311
- <%if scenario['error']%>
312
- <%if scenario['error'] == error%>
313
- <li class="collection-item failedScenario brown lighten-5 red-text">
314
- <i class="material-icons">highlight_off</i>&nbsp;<a class="modal-trigger red-text"href="#f<%=f%>s<%=s%>"><%=scenario['name']%></a>
315
- </li>
316
- <%end%>
317
- <%end%>
318
- <%end%>
319
- <%end%>
320
- </ul>
321
- </div>
322
- </li>
323
- <%end%>
324
- </ul>
325
- </div>
326
- </div>
327
- </main>
328
-
329
- <footer class="page-footer brown lighten-4">
330
- <div class="footer-copyright brown lighten-1">
331
- <div class="container">
332
- Happy Reporting!
333
- <a class="white-text text-lighten-4 right" href="https://rubygems.org/gems/report_builder">Generated by Report Builder</a>
334
- </div>
335
- </div>
336
- </footer>
337
-
338
- <script type="text/javascript">
339
- $(document).ready(function () {
340
- <%features.each_with_index do |feature, f|%><%(0..feature['elements'].size).each do |s|%>
341
- $('#f<%=f%>s<%=s%>').modal();
342
- <%end%><%end%>
343
- });
344
- </script>
345
- <script type="text/javascript" src="https://cdn.rawgit.com/rajatthareja/ReportBuilder/v1.3/js/report.builder.min.js"></script>
346
- <%if options[:additional_js]%>
347
- <%if options[:additional_js] =~ /^http(|s):\/\/.*\.js$/%>
348
- <script src="<%=options[:additional_js]%>"></script>
349
- <%else%>
350
- <script type="text/javascript">
351
- <%= options[:additional_js]%>
352
- </script>
353
- <%end%>
354
- <%end%>
355
- </body>
356
- </html>