nxgreport 0.8.0 → 0.10.0

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nxgcore.rb +239 -120
  3. data/lib/nxgcss.rb +260 -324
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2248123c4fd3dd1b0f9f8b51be96a58d7ce3d936037bbd536fc6fb46f84d248a
4
- data.tar.gz: 0e59c0545599b7d868a890cbca5f88f69bab7fa2bbf4f78870b2272fc64a91e7
3
+ metadata.gz: a070244e38842f494942ea189deba31e45360a50857946d17c11749ab10db465
4
+ data.tar.gz: f903e4695cffc3a15069340f563e2ed7930d1531139ff7a4b6219786e8452649
5
5
  SHA512:
6
- metadata.gz: f7cae8d3cd35d9015a2ec8ec04ab928d87217efb6cc0df27a2c13671bd8155470b761cf547f46103be22cf243cebd3fe75a895b786ed709c38abe2da1e14c89c
7
- data.tar.gz: 55206eb129ccb97ce771fcd7b67a90948e3bad1ba1117baab58ce3cfea7d8e7b18931f651231aafdb4f384e06d934fa5ec64dc362464fad76b9d951ea213a43d
6
+ metadata.gz: d65497235406123d769ac72f0f61b1a16ca565926911d34819ddcd8d5ea730f2363d969212e372613a9457d97a1649ed8711fc15c75ee0c619a1d34d804adec8
7
+ data.tar.gz: 8eb082850d2be42ef630e83e23a68e1058182ab26ee84f8738b17d8f8964b5e45de460ee05d905fe8e15bbde41f577348055457f5da00f416b2cf542064cdc17
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
-
2
+ require 'pry'
3
+ require 'json'
3
4
  require 'nxgcss.rb'
4
5
 
5
6
  class NxgCore
@@ -18,19 +19,11 @@ class NxgCore
18
19
  @data_provider[:report_path] = location.empty? ? "./NxgReport.html" : location
19
20
  folder_check()
20
21
  @data_provider[:title] = title
21
- @data_provider[:title_color] = "background: linear-gradient(to bottom right, #ff644e, #cb3018);"
22
+ @data_provider[:title_color] = ""
22
23
  @data_provider[:open_on_completion] = false
23
- @data_provider[:features] = Hash.new()
24
+ @data_provider[:features] = Array.new()
24
25
  @start_time = Time.now.to_f
25
26
  end
26
-
27
- def set_title_color(hex_color: "")
28
- if hex_color.strip().empty?() || hex_color.strip()[0] != "#"
29
- log("set_title_color method is called with empty color. please check the code.")
30
- return
31
- end
32
- @data_provider[:title_color] = "background-color: #{hex_color.strip().downcase()};"
33
- end
34
27
 
35
28
  def open_upon_execution(value: true)
36
29
  return if !value
@@ -75,7 +68,7 @@ class NxgCore
75
68
  @data_provider[:execution_date] = date
76
69
  end
77
70
 
78
- def log_test(feature_name: "", test_status: "")
71
+ def log_test(feature_name: "", test_name:"", test_status: "", comments: "")
79
72
  if feature_name.nil?() || feature_name.strip.empty?()
80
73
  log("Feature name cannot be empty.")
81
74
  return
@@ -85,18 +78,31 @@ class NxgCore
85
78
  log("Test status cannot be empty.")
86
79
  return
87
80
  end
88
-
89
- test_pass = test_status.downcase.include?('pass')
90
- name = feature_name.strip()
91
-
92
- if !@data_provider[:features].key?(name)
93
- @data_provider[:features][name]=[0,0,0]
81
+
82
+ if test_name.nil?() || test_name.strip.empty?()
83
+ log("Test name cannot be empty.")
84
+ return
94
85
  end
95
86
 
96
- @data_provider[:features][name][0]+=1
97
- @data_provider[:total]+=1
98
- @data_provider[:features][name][(test_pass) ? 1 : 2]+=1
99
- @data_provider[(test_pass) ? :pass : :fail]+=1
87
+ f_name = feature_name.strip
88
+ t_name = test_name.strip
89
+ t_pass = test_status.strip.downcase.include?('pass') ? true : false
90
+ t_comments = comments.strip
91
+
92
+ if !feature_exists?(f_name)
93
+ new_feature = {
94
+ "name" => f_name,
95
+ "total" => 0,
96
+ "pass" => 0,
97
+ "fail" => 0,
98
+ "tests" => Array.new()
99
+ }
100
+ @data_provider[:features].push(new_feature)
101
+ end
102
+
103
+ update_feature(f_name, t_name, t_pass, t_comments)
104
+ @data_provider[:total] += 1
105
+ @data_provider[t_pass ? :pass : :fail] += 1
100
106
  end
101
107
 
102
108
  def build(execution_time: 0)
@@ -108,6 +114,29 @@ class NxgCore
108
114
  end
109
115
 
110
116
  # Private methods
117
+
118
+ def update_feature(f_name, t_name, t_pass, t_comments)
119
+ @data_provider[:features].each do |feature|
120
+ if feature["name"].eql?(f_name)
121
+ feature["total"]+=1
122
+ feature[t_pass ? "pass" : "fail"]+=1
123
+ feature["tests"].push({
124
+ "name" => t_name,
125
+ "testPass" => t_pass,
126
+ "comments" => t_comments
127
+ })
128
+ return
129
+ end
130
+ end
131
+ end
132
+
133
+ def feature_exists?(feature_name)
134
+ @data_provider[:features].each do |feature|
135
+ return true if feature["name"].eql?(feature_name)
136
+ end
137
+ return false
138
+ end
139
+
111
140
  def log(message)
112
141
  puts("🤖- #{message}")
113
142
  end
@@ -163,8 +192,20 @@ class NxgCore
163
192
  end
164
193
 
165
194
  def body()
166
- "<body class=\"dark\" id=\"app\" onload=\"onStart()\">
167
- <div class=\"body-wrapper\">
195
+ "<body id=\"app\" onload=\"onRefresh()\">
196
+ <div id=\"sidebar\" onclick=\"closeDetails()\">
197
+ <div id=\"sidebar-div\">
198
+ <div id=\"sidebar-title-wrap\">
199
+ <h1 id=\"sidebar-title\">Title</h1>
200
+ &nbsp;&nbsp;
201
+ <i class=\"material-icons\" id=\"sidebar-status\">check_circle</i>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ <div id=\"sidebar-overlay\" onclick=\"closeDetails()\">
206
+ <div id=\"sidebar-overlay-grid\"></div>
207
+ </div>
208
+ <div id=\"body-wrap\">
168
209
  #{header()}
169
210
  #{config()}
170
211
  #{features()}
@@ -174,30 +215,26 @@ class NxgCore
174
215
  end
175
216
 
176
217
  def header()
177
- "<div class=\"header\">
178
- <h1>#{@data_provider[:title]}</h1>
179
- <div class=\"button-wrapper\">
180
- <button id=\"theme-switch\" onclick=\"handleThemeSwitch()\">
181
- <i class=\"material-icons\" id=\"theme-switch-icon\">brightness_2</i>
218
+ "<div id=\"header\">
219
+ <h1 id=\"app-title\">#{@data_provider[:title]}</h1>
220
+ <div id=\"theme-wrap\">
221
+ <button id=\"theme-switch\" onclick=\"switchTheme()\">
222
+ <i class=\"material-icons\" id=\"theme-icon\">brightness_2</i>
182
223
  </button>
183
224
  </div>
184
225
  </div>"
185
226
  end
186
227
 
187
228
  def features()
188
- "<div class=\"mc\"></div>"
229
+ "<div class=\"features-grid\"></div>"
189
230
  end
190
231
 
191
232
  def features_js_array()
192
- js_array = ''
193
- @data_provider[:features].each do |name, metrics|
194
- js_array += "{ name: \"#{name}\", total: #{metrics[0]}, pass: #{metrics[1]}, fail: #{metrics[2]} },"
195
- end
196
- return js_array
233
+ return @data_provider[:features].to_s.gsub("=>", ":")
197
234
  end
198
235
 
199
236
  def footer()
200
- "<div class=\"footer\">
237
+ "<div id=\"footer\">
201
238
  <p>
202
239
  Developed by
203
240
  <span>
@@ -214,91 +251,173 @@ class NxgCore
214
251
 
215
252
  def javascript()
216
253
  "<script>
217
- var theme = \"dark\";
218
- var displayAllTests = true;
219
-
220
- var features = [
221
- #{features_js_array()}
222
- ]
223
-
224
- function onStart() {
225
- displayAll();
226
- }
227
-
228
- function handleThemeSwitch() {
229
- if (theme === \"dark\") {
230
- theme = \"light\";
231
- document.getElementById(\"app\").classList.remove(\"dark\");
232
- document.getElementById(\"theme-switch-icon\").innerHTML = \"wb_sunny\";
233
- document.getElementById(\"theme-switch-icon\");
234
- return;
235
- }
236
- if (theme === \"light\") {
237
- theme = \"dark\";
238
- document.getElementById(\"app\").classList.add(\"dark\");
239
- document.getElementById(\"theme-switch-icon\").innerHTML = \"brightness_2\";
240
- }
241
- }
242
-
243
- function handleFilter() {
244
- displayAllTests = !displayAllTests;
245
- if (displayAllTests) {
246
- displayAll();
247
- } else {
248
- displayFailuresOnly();
249
- }
250
- }
251
-
252
- function displayAll() {
253
- $(\"#filter h5\").text(\"All\");
254
- $(\".banner-in-the-middle\").removeClass(\"banner-in-the-middle\").addClass(\"mc\");
255
- $(\".mc\").empty();
256
- features.forEach((item) => {
257
- $(\".mc\").append(
258
- `<div class=\"module dark ${
259
- item.fail > 0 ? \"danger\" : \"\"
260
- }\"><div class=\"funcname\"><h4>${
261
- item.name
262
- }</h4></div><div class=\"total\"><h6>Total</h6><h4>${
263
- item.total
264
- }</h4></div><div class=\"pass\"><h6>Passed</h6><h4>${
265
- item.pass
266
- }</h4></div><div class=\"fail\"><h6>Failed</h6><h4>${
267
- item.fail
268
- }</h4></div></div>`
254
+ var darkTheme = false;
255
+ var displayFailuresOnly = false;
256
+
257
+ const allFeatures = #{features_js_array};
258
+
259
+ var dataSource = [];
260
+
261
+ const STATUS = {
262
+ pass: \"check_circle\",
263
+ fail: \"cancel\",
264
+ };
265
+
266
+ function onRefresh() {
267
+ switchTheme();
268
+ dataSource = allFeatures;
269
+ setFilter();
270
+ }
271
+
272
+ function updateView() {
273
+ $(\".banner\").removeClass(\"banner\").addClass(\"features-grid\");
274
+ $(\".features-grid\").empty();
275
+
276
+ if (dataSource.length === 0) {
277
+ console.log(\"inside\");
278
+ $(\".features-grid\")
279
+ .removeClass(\"features-grid\")
280
+ .addClass(\"banner\")
281
+ .append(
282
+ `<i class=\"banner-text green-font material-icons\">done_all</i><h1>No Failures</>`
269
283
  );
284
+ return;
285
+ }
286
+
287
+ dataSource.forEach((feature, index) => {
288
+ $(\".features-grid\").append(
289
+ `<div class=\"module dark ${
290
+ feature.fail > 0 ? \"red-bg\" : \"\"
291
+ }\" onclick=\"showDetails(${index})\"><div class=\"funcname\"><h4>${
292
+ feature.name
293
+ }</h4></div><div class=\"total\"><h6>Total</h6><h4>${
294
+ feature.total
295
+ }</h4></div><div class=\"pass green-font\"><h6>Passed</h6><h4>${
296
+ feature.pass
297
+ }</h4></div><div class=\"fail red-font\"><h6>Failed</h6><h4>${
298
+ feature.fail
299
+ }</h4></div></div>`
300
+ );
301
+ });
302
+ }
303
+
304
+ function setFilter() {
305
+ if (displayFailuresOnly) {
306
+ $(\"#filter h5\").text(\"Failed\");
307
+ dataSource = allFeatures.filter((feature) => {
308
+ return feature.fail > 0;
270
309
  });
310
+ } else {
311
+ $(\"#filter h5\").text(\"All\");
312
+ dataSource = allFeatures;
271
313
  }
272
-
273
- function displayFailuresOnly() {
274
- $(\"#filter h5\").text(\"Failures\");
275
- $(\".banner-in-the-middle\").removeClass(\"banner-in-the-middle\").addClass(\"mc\");
276
- $(\".mc\").empty();
277
- failureCount = 0;
278
- features.forEach((item) => {
279
- if (item.fail > 0) {
280
- failureCount++;
281
- $(\".mc\").append(
282
- `<div class=\"module dark danger\"><div class=\"funcname\"><h4>${item.name}</h4></div><div class=\"total\"><h6>Total</h6><h4>${item.total}</h4></div><div class=\"pass\"><h6>Passed</h6><h4>${item.pass}</h4></div><div class=\"fail\"><h6>Failed</h6><h4>${item.fail}</h4></div></div>`
283
- );
314
+ updateView();
315
+ displayFailuresOnly = !displayFailuresOnly;
316
+ }
317
+
318
+ function filterAllFailed() {
319
+ allFailedTests = [];
320
+
321
+ failedFeatures = allFeatures.filter((feature) => {
322
+ return feature.fail > 0;
323
+ });
324
+
325
+ for (index = 0; index < failedFeatures.length; index++) {
326
+ failedFeatures[index].tests.filter((test) => {
327
+ if (!test.testPass) {
328
+ allFailedTests.push(test);
284
329
  }
285
330
  });
286
- if (failureCount === 0) {
287
- $(\".mc\")
288
- .removeClass(\"mc\")
289
- .addClass(\"banner-in-the-middle\")
290
- .append(
291
- `<i class=\"banner-text material-icons\">done_all</i><h1>No Failures</>`
292
- );
331
+ }
332
+
333
+ $(\"#sidebar-overlay\").css(\"visibility\", \"visible\");
334
+ $(\"#sidebar-overlay\").css(\"margin-left\", \"40%\");
335
+ $(\"#sidebar\").css(\"width\", \"40%\");
336
+ $(\"#sidebar-title\").css(\"visibility\", \"visible\");
337
+ $(\"#sidebar-status\").css(\"visibility\", \"visible\");
338
+ /* Update Test Information */
339
+
340
+ $(\"#sidebar-title\").text(\"Failed Tests\");
341
+ $(\"#sidebar-status\").text(STATUS.fail);
342
+ $(\"#sidebar-overlay-grid\").empty();
343
+ allFailedTests.forEach((test) => {
344
+ $(\"#sidebar-overlay-grid\").append(
345
+ `<div id=\"sidebar-overlay-test-info\" onclick=\"()=>{}\"><i class=\"${
346
+ test.testPass ? \"green-font\" : \"red-font\"
347
+ } material-icons\" style=\"font-size: 1em\">${
348
+ STATUS.fail
349
+ }</i>&nbsp;&nbsp;<h4 id=\"test-title\">${test.name}</h4>${
350
+ test.comments !== \"\"
351
+ ? `<p id=\"error-message\">${test.comments}</p>`
352
+ : \"\"
353
+ }</div>`
354
+ );
355
+ });
356
+ }
357
+
358
+ function switchTheme() {
359
+ $(document.documentElement).attr(\"theme\", !darkTheme ? \"light\" : \"dark\");
360
+ $(\"#theme-icon\").text(!darkTheme ? \"wb_sunny\" : \"brightness_2\");
361
+ darkTheme = !darkTheme;
362
+ }
363
+
364
+ function closeDetails() {
365
+ $(\"#sidebar-title\").css(\"visibility\", \"hidden\");
366
+ $(\"#sidebar-status\").css(\"visibility\", \"hidden\");
367
+ $(\"#sidebar-overlay\").css(\"visibility\", \"hidden\");
368
+ $(\"#sidebar-overlay\").css(\"margin-left\", \"0\");
369
+ $(\"#sidebar\").css(\"width\", \"0\");
370
+ }
371
+
372
+ window
373
+ .matchMedia(\"(prefers-color-scheme: dark)\")
374
+ .addEventListener(\"change\", (e) => {
375
+ darkTheme = e.matches;
376
+ switchTheme();
377
+ });
378
+
379
+ function showDetails(featureID) {
380
+ feature = dataSource[featureID];
381
+
382
+ $(\"#sidebar-overlay\").css(\"visibility\", \"visible\");
383
+ $(\"#sidebar-overlay\").css(\"margin-left\", \"40%\");
384
+ $(\"#sidebar\").css(\"width\", \"40%\");
385
+ $(\"#sidebar-title\").css(\"visibility\", \"visible\");
386
+ $(\"#sidebar-status\").css(\"visibility\", \"visible\");
387
+ /* Update Test Information */
388
+
389
+ $(\"#sidebar-title\").text(feature.name);
390
+ $(\"#sidebar-overlay-grid\").empty();
391
+ feature.tests.forEach((test) => {
392
+ $(\"#sidebar-overlay-grid\").append(
393
+ `<div id=\"sidebar-overlay-test-info\" onclick=\"()=>{}\"><i class=\"${
394
+ test.testPass ? \"green-font\" : \"red-font\"
395
+ } material-icons\" style=\"font-size: 1em\">${
396
+ test.testPass ? STATUS.pass : STATUS.fail
397
+ }</i>&nbsp;&nbsp;<h4 id=\"test-title\">${test.name}</h4>${
398
+ test.comments !== \"\"
399
+ ? `<p id=\"error-message\">${test.comments}</p>`
400
+ : \"\"
401
+ }</div>`
402
+ );
403
+ });
404
+
405
+ for (index = 0; index < feature.tests.length; index++) {
406
+ if (!feature.tests[index].testPass) {
407
+ $(\"#sidebar-status\").text(STATUS.fail);
408
+ return;
293
409
  }
294
410
  }
411
+ $(\"#sidebar-status\").text(STATUS.pass);
412
+ }
413
+
295
414
  </script>"
296
415
  end
297
416
 
298
417
  def config()
299
418
  return if @data_provider.length == 0
300
419
 
301
- return "<div class=\"configuration-container\">
420
+ return "<div class=\"params-container\">
302
421
  #{release_name()}
303
422
  #{execution_date()}
304
423
  #{device()}
@@ -320,23 +439,23 @@ class NxgCore
320
439
  end
321
440
 
322
441
  def filter()
323
- "<div class=\"configuration-wrapper\" onclick=\"handleFilter()\" id=\"filter\" title=\"Filter tests\">
324
- <i class=\"configuration-icon material-icons\">filter_list</i>
325
- <h5 id=\"configuration-text\">Failed</h5>
442
+ "<div class=\"param-wrap\" onclick=\"setFilter()\" id=\"filter\" title=\"Filter tests\">
443
+ <i class=\"pi material-icons\">filter_list</i>
444
+ <h5 id=\"pt\">Failed</h5>
326
445
  </div>"
327
446
  end
328
447
 
329
448
  def passed_tests()
330
- "<div class=\"configuration-wrapper\" title=\"Passed tests\">
331
- <i class=\"configuration-icon pass-total material-icons\">check_circle</i>
332
- <h5 id=\"configuration-text\">#{@data_provider[:pass] == 0 ? "None" : @data_provider[:pass]}</h5>
449
+ "<div class=\"param-wrap\" title=\"Passed tests\">
450
+ <i class=\"pi green-font material-icons\">check_circle</i>
451
+ <h5 id=\"pt\">#{@data_provider[:pass] == 0 ? "None" : @data_provider[:pass]}</h5>
333
452
  </div>"
334
453
  end
335
454
 
336
455
  def failed_tests()
337
- "<div class=\"configuration-wrapper\" title=\"Failed tests\">
338
- <i class=\"configuration-icon fail-total material-icons\">cancel</i>
339
- <h5 id=\"configuration-text\">#{@data_provider[:fail] == 0 ? "None" : @data_provider[:fail]}</h5>
456
+ "<div class=\"param-wrap\" title=\"Failed tests\" #{@data_provider[:fail] > 0 ? "onclick=\"filterAllFailed()\" style=\"cursor: pointer\"" : ""}>
457
+ <i class=\"pi red-font material-icons\">cancel</i>
458
+ <h5 id=\"pt\">#{@data_provider[:fail] == 0 ? "None" : @data_provider[:fail]}</h5>
340
459
  </div>"
341
460
  end
342
461
 
@@ -383,9 +502,9 @@ class NxgCore
383
502
  end
384
503
 
385
504
  def config_item(toot_tip, name, icon)
386
- "<div class=\"configuration-wrapper\" title=\"#{toot_tip}\">
387
- <i class=\"configuration-icon material-icons\">#{icon}</i>
388
- <h5 id=\"configuration-text\">#{name}</h5>
505
+ "<div class=\"param-wrap\" title=\"#{toot_tip}\">
506
+ <i class=\"pi material-icons\">#{icon}</i>
507
+ <h5 id=\"pt\">#{name}</h5>
389
508
  </div>"
390
509
  end
391
510
 
@@ -7,329 +7,265 @@ module NxgCss
7
7
 
8
8
  def css(data_provider)
9
9
  "<style>
10
- :root {
11
- --dark-bg: rgb(41, 40, 40);
12
- --dark-primary: #050505;
13
- --dark-secondary: #050505a9;
14
- --dark-font: rgb(201, 201, 201);
15
- --dark-blue: rgb(0, 225, 255);
16
- --dark-green: rgba(115, 255, 0, 0.89);
17
- --dark-red: rgb(255, 0, 0);
18
- --dark-shadow: rgba(0, 0, 0, 0.5);
19
-
20
- --light-bg: rgb(226, 226, 226);
21
- --light-primary: #fff;
22
- --light-secondary: rgba(255, 255, 255, 0.445);
23
- --light-font: rgb(44, 44, 44);
24
- --light-blue: rgb(1, 67, 165);
25
- --light-green: rgb(14, 138, 2);
26
- --light-red: rgb(255, 0, 0);
27
- --light-shadow: rgba(245, 245, 245, 0.5);
28
-
29
- --font: \"Open Sans\", sans-serif;
30
- --danger-bg: rgba(255, 0, 0, 0.185);
31
- --color-switch-animation: all 500ms ease;
32
- }
33
-
34
- body {
35
- font-family: var(--font);
36
- margin: auto;
37
- transition: var(--color-switch-animation);
38
- }
39
-
40
- .body-wrapper {
41
- display: grid;
42
- grid-template-rows: auto auto 1fr;
43
- height: 100vh;
44
- width: 100vw;
45
- }
46
-
47
- .header {
48
- display: grid;
49
- grid-template-columns: 8fr 1fr;
50
- text-align: center;
51
- #{data_provider[:title_color]}
52
- }
53
-
54
- .configuration-container {
55
- display: flex;
56
- flex-wrap: wrap;
57
- justify-content: space-between;
58
- text-align: center;
59
- padding: 1.5em 2em 1em 2em;
60
- }
61
-
62
- .configuration-wrapper {
63
- display: flex;
64
- place-items: center;
65
- }
66
-
67
- .configuration-icon {
68
- font-size: 1.5em;
69
- padding-right: 0.5em;
70
- }
71
-
72
- #configuration-text {
73
- font-size: 0.85em;
74
- }
75
-
76
- #filter {
77
- cursor: pointer;
78
- border-radius: 1em;
79
- width: 6em;
80
- padding: 0.2em 0.8em;
81
- background-color: var(--light-secondary);
82
- -webkit-box-shadow: -1px 0px 5px 0px var(--light-shadow);
83
- -moz-box-shadow: -1px 0px 5px 0px var(--light-shadow);
84
- box-shadow: -1px 0px 5px 0px var(--light-shadow);
85
- }
86
-
87
- .mc {
88
- display: grid;
89
- grid-template-columns: 1fr 1fr 1fr;
90
- grid-auto-rows: 70px;
91
- grid-gap: 0.5em;
92
- padding: 0.5em 2em;
93
- }
94
-
95
- .banner-in-the-middle {
96
- text-align: center;
97
- margin: auto;
98
- }
99
-
100
- .banner-text {
101
- color: green;
102
- font-size: 5em;
103
- }
104
-
105
- .banner-in-the-middle > h1 {
106
- color: var(--light-font);
107
- }
108
-
109
- .footer {
110
- margin-bottom: 0.5em;
111
- padding: 3em 3em 1em 3em;
112
- text-align: center;
113
- font-size: 0.7rem;
114
- font-weight: 600;
115
- }
116
-
117
- a {
118
- cursor: pointer;
119
- font-weight: 600;
120
- }
121
-
122
- .module {
123
- display: grid;
124
- place-items: center;
125
- grid-template-columns: 3fr 1fr 1fr 1fr;
126
- border-radius: 0.7rem;
127
- padding: 10px 10px;
128
- -webkit-box-shadow: -1px 0px 5px 0px var(--light-shadow);
129
- -moz-box-shadow: -1px 0px 5px 0px var(--light-shadow);
130
- box-shadow: -1px 0px 5px 0px var(--light-shadow);
131
- }
132
-
133
- .button-body-wrapper {
134
- place-items: center;
135
- }
136
-
137
- #theme-switch {
138
- width: 5em;
139
- height: 5em;
140
- background-color: Transparent;
141
- background-repeat: no-repeat;
142
- border: none;
143
- cursor: pointer;
144
- overflow: hidden;
145
- outline: none;
146
- margin: 0;
147
- margin-right: 1em;
148
- position: relative;
149
- top: 50%;
150
- -ms-transform: translateY(-50%);
151
- transform: translateY(-50%);
152
- }
153
-
154
- h2,
155
- h3,
156
- h4,
157
- h5,
158
- h6 {
159
- text-align: center;
160
- margin: auto;
161
- }
162
-
163
- .total,
164
- .pass,
165
- .fail {
166
- display: grid;
167
- width: 100%;
168
- height: 100%;
169
- place-items: center;
170
- }
171
-
172
- body.dark {
173
- background-color: var(--dark-bg);
174
- color: var(--dark-font);
175
- }
176
-
177
- body.dark > .body-wrapper > .footer {
178
- color: var(--dark-font);
179
- }
180
-
181
- body.dark > .body-wrapper > .mc > .module {
182
- background-color: var(--dark-primary);
183
- color: var(--dark-font);
184
- -webkit-box-shadow: -1px 0px 5px 0px var(--dark-shadow);
185
- -moz-box-shadow: -1px 0px 5px 0px var(--dark-shadow);
186
- box-shadow: -1px 0px 5px 0px var(--dark-shadow);
187
- }
188
-
189
- body.dark > .body-wrapper > .mc > .module > .total {
190
- color: var(--dark-blue);
191
- }
192
-
193
- body.dark > .body-wrapper > .mc > .module > .pass {
194
- color: var(--dark-green);
195
- }
196
-
197
- body.dark > .body-wrapper > .mc > .module > .fail {
198
- color: var(--dark-red);
199
- }
200
-
201
- body.dark > .body-wrapper > .configuration-container > .configuration-wrapper > .pass-total {
202
- color: var(--dark-green);
203
- }
204
-
205
- body.dark > .body-wrapper > .configuration-container > .configuration-wrapper > .fail-total {
206
- color: var(--dark-red);
207
- }
208
-
209
- body.dark > .body-wrapper > .mc > .module.danger {
210
- background-color: rgba(255, 0, 0, 0.185);
211
- }
212
-
213
- body.dark > .body-wrapper > .banner-in-the-middle > h1 {
214
- color: var(--dark-font);
215
- }
216
-
217
- body.dark > .body-wrapper > .header {
218
- color: var(--dark-primary);
219
- }
220
-
221
- body.dark > .body-wrapper > .configuration-container > .configuration-wrapper {
222
- color: var(--dark-font);
223
- }
224
-
225
- body.dark > .body-wrapper > .configuration-container > #filter {
226
- background-color: var(--dark-secondary);
227
- -webkit-box-shadow: -1px 0px 5px 0px var(--dark-shadow);
228
- -moz-box-shadow: -1px 0px 5px 0px var(--dark-shadow);
229
- box-shadow: -1px 0px 5px 0px var(--dark-shadow);
230
- }
231
-
232
- body.dark > .body-wrapper > .footer > p > span > a {
233
- color: var(--dark-font);
234
- }
235
-
236
- body.dark > .body-wrapper > .header > div > button > #theme-switch-icon {
237
- color: var(--dark-primary);
238
- }
239
-
240
- body {
241
- background-color: var(--light-bg);
242
- color: var(--dark-font);
243
- }
244
-
245
- body > .body-wrapper > .footer {
246
- color: var(--light-font);
247
- }
248
-
249
- body > .body-wrapper > .mc > .module {
250
- background-color: var(--light-primary);
251
- color: var(--light-font);
252
- }
253
-
254
- body > .body-wrapper > .mc > .module > .total {
255
- color: var(--light-blue);
256
- }
257
-
258
- body > .body-wrapper > .mc > .module > .pass {
259
- color: var(--light-green);
260
- }
261
-
262
- body > .body-wrapper > .mc > .module > .fail {
263
- color: var(--light-red);
264
- }
265
-
266
- body > .body-wrapper > .configuration-container > .configuration-wrapper > .pass-total {
267
- color: var(--light-green);
268
- }
269
-
270
- body > .body-wrapper > .configuration-container > .configuration-wrapper > .fail-total {
271
- color: var(--light-red);
272
- }
273
-
274
- body > .body-wrapper > .mc > .module.danger {
275
- background-color: var(--danger-bg);
276
- }
277
-
278
- body > .body-wrapper > .header {
279
- color: var(--light-primary);
280
- }
281
-
282
- body > .body-wrapper > .configuration-container > .configuration-wrapper {
283
- color: var(--light-font);
284
- }
285
-
286
- body > .body-wrapper > .footer > p > span > a {
287
- color: var(--light-font);
288
- }
289
-
290
- body > .body-wrapper > .header > div > button > #theme-switch-icon {
291
- color: var(--light-primary);
292
- }
293
-
294
- @media only screen and (max-width: 600px) {
295
- h1 {
296
- font-size: 24px;
297
- }
298
-
299
- .mc {
300
- grid-template-columns: 1fr;
301
- padding: 0.5em 0.5em;
302
- padding-top: 1em;
303
- }
304
-
305
- .configuration-container {
306
- padding: 0.5em 0em;
307
- }
308
-
309
- .configuration-wrapper {
310
- padding: 0.5em 1em;
311
- }
312
-
313
- .configuration-icon {
314
- font-size: 1em;
315
- }
316
-
317
- #configuration-text {
318
- font-size: 0.6em;
319
- }
320
-
321
- #filter {
322
- width: 4em;
323
- padding: 0.4em 0.4em;
324
- margin: 0.3em 0.7em 0.3em 0.7em;
325
- }
326
- }
327
-
328
- @media (min-width: 600px) and (max-width: 992px) {
329
- .mc {
330
- grid-template-columns: 1fr 1fr;
331
- }
332
- }
333
- </style>"
10
+ :root {
11
+ --font: \"Open Sans\", sans-serif;
12
+ --primary-gradient: linear-gradient(to bottom right, #ff644e, #cb3018);
13
+ --background-color: #f4f4f4;
14
+ --primary-color: #fff;
15
+ --secondary-color: #fff;
16
+ --primary-font-color: #424242;
17
+ --green: rgb(31, 172, 31);
18
+ --red: rgb(214, 7, 7);
19
+ --blue: rgb(0, 89, 255);
20
+ --red-bg: rgba(255, 0, 0, 0.233);
21
+ }
22
+
23
+ [theme=\"dark\"] {
24
+ --background-color: #252525;
25
+ --primary-color: #2e2e2e;
26
+ --secondary-color: rgba(255, 255, 255, 0.842);
27
+ --primary-font-color: #f9fafccb;
28
+ --green: rgb(6, 207, 6);
29
+ --red: rgb(228, 1, 1);
30
+ --blue: rgb(91, 226, 250);
31
+ --red-bg: rgba(201, 53, 53, 0.479);
32
+ }
33
+
34
+ * {
35
+ font-family: var(--font);
36
+ color: var(--primary-font-color);
37
+ transition: color 0.5s ease;
38
+ transition: background-color 0.5s ease;
39
+ }
40
+
41
+ #app {
42
+ background-color: var(--background-color);
43
+ margin: auto;
44
+ }
45
+
46
+ #header {
47
+ display: grid;
48
+ grid-template-columns: 8fr 1fr;
49
+ text-align: center;
50
+ background: var(--primary-gradient);
51
+ }
52
+
53
+ #app-title,
54
+ #theme-icon {
55
+ color: var(--background-color);
56
+ }
57
+
58
+ #sidebar {
59
+ width: 0;
60
+ height: 100%;
61
+ position: fixed;
62
+ z-index: 2;
63
+ top: 0;
64
+ left: 0;
65
+ overflow-x: hidden;
66
+ transition: 1s ease;
67
+ display: flex;
68
+ place-items: center;
69
+ background: var(--primary-gradient);
70
+ }
71
+
72
+ #sidebar-div {
73
+ margin: auto;
74
+ }
75
+
76
+ #sidebar-overlay-test-info {
77
+ font-size: 16px;
78
+ margin: 0.5em 0;
79
+ }
80
+
81
+ #sidebar-overlay {
82
+ width: 60%;
83
+ height: 100%;
84
+ z-index: 1;
85
+ position: fixed;
86
+ top: 0;
87
+ left: 0;
88
+ visibility: hidden;
89
+ display: flex;
90
+ transition: margin-left 1s ease;
91
+ overflow-y: auto;
92
+ background-color: var(--background-color);
93
+ }
94
+
95
+ #sidebar-overlay-grid {
96
+ display: grid;
97
+ grid-template-rows: auto;
98
+ padding: 1em;
99
+ margin: 0 1em;
100
+ width: 100%;
101
+ height: fit-content;
102
+ }
103
+
104
+ #sidebar-title-wrap,
105
+ #sidebar-overlay-test-info {
106
+ display: flex;
107
+ place-items: center;
108
+ flex-wrap: wrap;
109
+ }
110
+
111
+ #sidebar-title,
112
+ #sidebar-status {
113
+ color: var(--secondary-color);
114
+ }
115
+
116
+ #test-title {
117
+ margin: 0;
118
+ }
119
+
120
+ h2,
121
+ h3,
122
+ h4,
123
+ h5,
124
+ h6 {
125
+ text-align: center;
126
+ margin: auto;
127
+ }
128
+
129
+ #error-message {
130
+ flex-basis: 100%;
131
+ margin: 1em 1.5em 0 1.5em;
132
+ display: table-cell;
133
+ vertical-align: middle;
134
+ background-color: var(--primary-color);
135
+ padding: 1em;
136
+ border-radius: 1em;
137
+ font-size: 0.8em;
138
+ }
139
+
140
+ #body-wrap {
141
+ display: grid;
142
+ grid-template-rows: auto auto 1fr;
143
+ height: 100vh;
144
+ width: 100vw;
145
+ }
146
+
147
+ #theme-switch {
148
+ width: 5em;
149
+ height: 5em;
150
+ background-color: Transparent;
151
+ background-repeat: no-repeat;
152
+ border: none;
153
+ cursor: pointer;
154
+ overflow: hidden;
155
+ outline: none;
156
+ margin: 0;
157
+ margin-right: 1em;
158
+ position: relative;
159
+ top: 50%;
160
+ -ms-transform: translateY(-50%);
161
+ transform: translateY(-50%);
162
+ }
163
+
164
+ .params-container {
165
+ display: flex;
166
+ flex-wrap: wrap;
167
+ justify-content: space-between;
168
+ text-align: center;
169
+ padding: 1em 2em;
170
+ }
171
+
172
+ .param-wrap {
173
+ display: flex;
174
+ place-items: center;
175
+ }
176
+
177
+ .pi {
178
+ font-size: 1.5em;
179
+ padding-right: 0.5em;
180
+ }
181
+
182
+ #pt {
183
+ font-size: 0.9em;
184
+ }
185
+
186
+ #filter {
187
+ cursor: pointer;
188
+ border-radius: 1em;
189
+ width: 5em;
190
+ padding: 0.2em 1em;
191
+ background-color: var(--primary-color);
192
+ }
193
+
194
+ .features-grid {
195
+ display: grid;
196
+ grid-template-columns: 1fr 1fr 1fr;
197
+ grid-auto-rows: 70px;
198
+ grid-gap: 0.5em;
199
+ padding: 0.5em 2em;
200
+ }
201
+
202
+ .module {
203
+ display: grid;
204
+ place-items: center;
205
+ grid-template-columns: 3fr 1fr 1fr 1fr;
206
+ border-radius: 0.7rem;
207
+ padding: 10px 10px;
208
+ background-color: var(--primary-color);
209
+ cursor: pointer;
210
+ }
211
+
212
+ .total,
213
+ .pass,
214
+ .fail {
215
+ display: grid;
216
+ width: 100%;
217
+ height: 100%;
218
+ place-items: center;
219
+ }
220
+
221
+ .total > * {
222
+ color: var(--blue);
223
+ }
224
+
225
+ .banner {
226
+ margin: auto;
227
+ text-align: center;
228
+ }
229
+
230
+ .banner-text {
231
+ font-size: 5em;
232
+ }
233
+
234
+ #footer {
235
+ font-size: 0.7rem;
236
+ text-align: center;
237
+ margin-bottom: 0.5em;
238
+ padding: 3em 3em 1em 3em;
239
+ }
240
+
241
+ @media (min-width: 600px) and (max-width: 1400px) {
242
+ .pi {
243
+ font-size: 1em;
244
+ padding-right: 0.5em;
245
+ }
246
+
247
+ #pt {
248
+ font-size: 0.7em;
249
+ }
250
+
251
+ .funcname {
252
+ font-size: 0.9em;
253
+ }
254
+ }
255
+
256
+ .green-font,
257
+ .pass > * {
258
+ color: var(--green);
259
+ }
260
+
261
+ .red-font,
262
+ .fail > * {
263
+ color: var(--red);
264
+ }
265
+
266
+ .red-bg {
267
+ background-color: var(--red-bg);
268
+ }
269
+ </style>"
334
270
  end
335
271
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nxgreport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balabharathi Jayaraman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-19 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Generate a beautiful static test report.
14
14
  email: balabharathi.jayaraman@gmail.com