nxgreport 0.6.0 → 0.6.1
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/lib/nxgreport.rb +21 -8
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f7daedeb4a5bf253f6253bd5c27a169f4cf982284f53ca2140f0f30533cd39d
|
4
|
+
data.tar.gz: 35dc08d19c86bf080e72840f12cd5eb9f78a8008f75182711d91977eedde1e90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afbf4843a3b1cad53c102d72bd3a1856708b0b6132cb030b00817bc7996e8877f78d1efcedee75dd8e02892c7ba408feb5c1e96d92d11139afce5fc7e4dc6509
|
7
|
+
data.tar.gz: e2779082fe179f97216e14cebd7c01b53dc411e0ee54a0b94c08f39a6b170a15cd7cf191c13e969bd861ebb36d4eefca489352848372d02395b5f8b97b2bd2e4
|
data/lib/nxgreport.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
require 'fileutils'
|
1
2
|
|
2
3
|
class NxgReport
|
3
4
|
|
4
|
-
attr_reader :nxg_report_path, :auto_open, :title
|
5
|
+
attr_reader :nxg_report_path, :auto_open, :title, :features
|
5
6
|
|
6
7
|
def setup(location: "./NxgReport.html", title: "Features Summary")
|
7
|
-
@nxg_report_path = location
|
8
|
+
@nxg_report_path = location.empty? ? "./NxgReport.html" : location
|
9
|
+
folder_check()
|
8
10
|
@title = title
|
9
11
|
@auto_open = false
|
10
12
|
@features = Hash.new()
|
@@ -15,14 +17,20 @@ class NxgReport
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def log_test(feature_name, test_status)
|
20
|
+
if feature_name.nil?() || feature_name.strip.empty?()
|
21
|
+
log("Feature name cannot be empty.")
|
22
|
+
return
|
23
|
+
end
|
18
24
|
test_pass = test_status.downcase.include?('pass')
|
19
|
-
|
20
|
-
|
21
|
-
|
25
|
+
name = feature_name.strip()
|
26
|
+
|
27
|
+
if @features.key? name
|
28
|
+
@features[name][0]+=1
|
29
|
+
@features[name][(test_pass) ? 1 : 2]+=1
|
22
30
|
else
|
23
|
-
@features[
|
24
|
-
@features[
|
25
|
-
@features[
|
31
|
+
@features[name]=[0,0,0]
|
32
|
+
@features[name][0]+=1
|
33
|
+
@features[name][(test_pass) ? 1 : 2]+=1
|
26
34
|
end
|
27
35
|
end
|
28
36
|
|
@@ -38,6 +46,11 @@ class NxgReport
|
|
38
46
|
puts("🤖- #{message}")
|
39
47
|
end
|
40
48
|
|
49
|
+
def folder_check()
|
50
|
+
folder = File.dirname(@nxg_report_path)
|
51
|
+
FileUtils.mkdir_p(folder) unless File.directory?(folder)
|
52
|
+
end
|
53
|
+
|
41
54
|
def report_success()
|
42
55
|
return File.file?(@nxg_report_path)
|
43
56
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nxgreport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Balabharathi Jayaraman
|
@@ -10,10 +10,10 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: A simple light weighted gem to generate a beautiful emailable test report.
|
14
|
-
|
13
|
+
description: "A simple light weighted gem to generate a beautiful emailable test report.
|
14
|
+
\n\nIt displays a single view where tests (total, pass, fail) are grouped by functionality.
|
15
15
|
The result is a single static HTML file with an option to switch between dark &
|
16
|
-
light modes.
|
16
|
+
light modes."
|
17
17
|
email: balabharathi.jayaraman@gmail.com
|
18
18
|
executables: []
|
19
19
|
extensions: []
|
@@ -35,7 +35,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
35
35
|
requirements:
|
36
36
|
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
38
|
+
version: 2.3.0
|
39
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|