onlyoffice_rspec_result_parser 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onlyoffice_rspec_result_parser/helper/string_helper.rb +7 -0
- data/lib/onlyoffice_rspec_result_parser/rspec_result_parser.rb +12 -3
- data/lib/onlyoffice_rspec_result_parser/rspec_result_parser/describe.rb +3 -0
- data/lib/onlyoffice_rspec_result_parser/rspec_result_parser/example.rb +4 -3
- data/lib/onlyoffice_rspec_result_parser/rspec_result_parser/result_creator.rb +4 -0
- data/lib/onlyoffice_rspec_result_parser/rspec_result_parser/rspec_result.rb +5 -1
- data/lib/onlyoffice_rspec_result_parser/version.rb +4 -1
- metadata +123 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d885c4e0248f1afb7c57271b777bb16aafff6aeee5fe5c046f7a8b8b2942de4
|
4
|
+
data.tar.gz: 52889a4bb7ac730a6296728619201f613fbf1a23fe9925d7122ed84307fdd1f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcdf309e8c2550bcd18cab6941c3437ec7277c8bc8395f819d8a051a0f84b15114670b4122dc727abcf668cbe3383a8bbd3cb32ab283f2186966c287fd631fa9
|
7
|
+
data.tar.gz: 799ce17c0b4c4ab38136d83e3a4e12fc7d429a8e8ecd19a6a271616e07168bab0cb4721433f74048c0f4b75a85597fbe73d53d4438151e9bd0dddaff3840cd3b
|
@@ -3,11 +3,18 @@
|
|
3
3
|
module OnlyofficeRspecResultParser
|
4
4
|
# Class for string methods
|
5
5
|
class StringHelper
|
6
|
+
# Get style param from string
|
7
|
+
# @param [String] string with style
|
8
|
+
# @param [String] param name
|
9
|
+
# @return [String] result
|
6
10
|
def self.get_style_param(string, param)
|
7
11
|
m = string.match(/#{param}:\s(.*);/)
|
8
12
|
m[1]
|
9
13
|
end
|
10
14
|
|
15
|
+
# Delete pixel names from string
|
16
|
+
# @param [String] string to delete
|
17
|
+
# @return [String] result
|
11
18
|
def self.delete_px(string)
|
12
19
|
string.gsub 'px', ''
|
13
20
|
end
|
@@ -17,6 +17,9 @@ module OnlyofficeRspecResultParser
|
|
17
17
|
class << self
|
18
18
|
attr_accessor :example_index
|
19
19
|
|
20
|
+
# Parse rspec html
|
21
|
+
# @param [String] html_path path to file
|
22
|
+
# @return [Object] result of parse
|
20
23
|
def parse_rspec_html(html_path)
|
21
24
|
page = Nokogiri::HTML(read_file(html_path))
|
22
25
|
parse_test_result(page)
|
@@ -31,17 +34,23 @@ module OnlyofficeRspecResultParser
|
|
31
34
|
|
32
35
|
alias parse_rspec_html_string parse_rspec_html
|
33
36
|
|
37
|
+
# Get failed count
|
38
|
+
# @param [String] html_path path to file
|
39
|
+
# @return [Integer] failed count
|
34
40
|
def get_failed_cases_count_from_html(html_path)
|
35
41
|
page = Nokogiri::HTML(read_file(html_path))
|
36
|
-
result = RspecResult.new(page).parse_page
|
42
|
+
result = RspecResult.new(page).parse_page
|
37
43
|
return 0 unless result.valid_html?
|
38
44
|
|
39
45
|
result.failed_count
|
40
46
|
end
|
41
47
|
|
48
|
+
# Get total case count
|
49
|
+
# @param [String] html_path path to file
|
50
|
+
# @return [Integer] total count
|
42
51
|
def get_total_result_of_rspec_html(html_path)
|
43
52
|
page = Nokogiri::HTML(read_file(html_path))
|
44
|
-
result = RspecResult.new(page).parse_page
|
53
|
+
result = RspecResult.new(page).parse_page
|
45
54
|
return '' unless result.valid_html?
|
46
55
|
|
47
56
|
result.total
|
@@ -53,7 +62,7 @@ module OnlyofficeRspecResultParser
|
|
53
62
|
# @return [RspecResult] result of parsing
|
54
63
|
def parse_test_result(page, with_describe_info: true)
|
55
64
|
ResultParser.example_index = 0
|
56
|
-
RspecResult.new(page).parse_page(with_describe_info)
|
65
|
+
RspecResult.new(page).parse_page(with_describe_info: with_describe_info)
|
57
66
|
end
|
58
67
|
|
59
68
|
private
|
@@ -19,10 +19,11 @@ module OnlyofficeRspecResultParser
|
|
19
19
|
|
20
20
|
def fetch_data(data)
|
21
21
|
@text = data.css('span').first.text
|
22
|
-
@passed = data[:class].split
|
23
|
-
|
22
|
+
@passed = data[:class].split[1]
|
23
|
+
case @passed
|
24
|
+
when 'failed'
|
24
25
|
fetch_failed_data(data)
|
25
|
-
|
26
|
+
when 'passed'
|
26
27
|
@duration = data.css('span')[1].text
|
27
28
|
end
|
28
29
|
end
|
@@ -6,6 +6,10 @@ module OnlyofficeRspecResultParser
|
|
6
6
|
# @return [Describe] result describe
|
7
7
|
attr_reader :final_result
|
8
8
|
|
9
|
+
# Push result to end
|
10
|
+
# @param [String] describe to pusth
|
11
|
+
# @param [Integer] level to check
|
12
|
+
# @return [Object] result
|
9
13
|
def push_to_end(describe, level)
|
10
14
|
if level.zero?
|
11
15
|
@final_result = describe
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module OnlyofficeRspecResultParser
|
4
4
|
# class for storing rspec result
|
5
5
|
class RspecResult
|
6
|
+
# @return [Integer] margin value
|
6
7
|
LEVEL_MARGIN = 15
|
7
8
|
|
8
9
|
attr_accessor :processing, :result, :time, :total, :describe
|
@@ -24,7 +25,10 @@ module OnlyofficeRspecResultParser
|
|
24
25
|
failed_count + passed_count
|
25
26
|
end
|
26
27
|
|
27
|
-
|
28
|
+
# Parse current page
|
29
|
+
# @param [Boolean] with_describe_info should info be parsed
|
30
|
+
# @return [RspecResult] result of parse
|
31
|
+
def parse_page(with_describe_info: true)
|
28
32
|
return self unless valid_html?
|
29
33
|
|
30
34
|
@describe = fetch_describe if with_describe_info
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onlyoffice_rspec_result_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -26,20 +26,132 @@ dependencies:
|
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.6'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: overcommit
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
29
43
|
- !ruby/object:Gem::Dependency
|
30
44
|
name: rake
|
31
45
|
requirement: !ruby/object:Gem::Requirement
|
32
46
|
requirements:
|
33
47
|
- - "~>"
|
34
48
|
- !ruby/object:Gem::Version
|
35
|
-
version: '13
|
49
|
+
version: '13'
|
50
|
+
type: :development
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '13'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: rspec
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '3'
|
64
|
+
type: :development
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '3'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rubocop
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.49.0
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.49.0
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: rubocop-performance
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '1'
|
36
92
|
type: :development
|
37
93
|
prerelease: false
|
38
94
|
version_requirements: !ruby/object:Gem::Requirement
|
39
95
|
requirements:
|
40
96
|
- - "~>"
|
41
97
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
98
|
+
version: '1'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: rubocop-rake
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: rubocop-rspec
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '2'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - "~>"
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '2'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: simplecov
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: yard
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: 0.9.20
|
148
|
+
type: :development
|
149
|
+
prerelease: false
|
150
|
+
version_requirements: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 0.9.20
|
43
155
|
description: Gem to parse rspec results. Needed in wrata project
|
44
156
|
email:
|
45
157
|
- shockwavenn@gmail.com
|
@@ -55,15 +167,15 @@ files:
|
|
55
167
|
- lib/onlyoffice_rspec_result_parser/rspec_result_parser/result_creator.rb
|
56
168
|
- lib/onlyoffice_rspec_result_parser/rspec_result_parser/rspec_result.rb
|
57
169
|
- lib/onlyoffice_rspec_result_parser/version.rb
|
58
|
-
homepage: https://github.com/
|
170
|
+
homepage: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_result_parser
|
59
171
|
licenses:
|
60
172
|
- AGPL-3.0
|
61
173
|
metadata:
|
62
|
-
bug_tracker_uri: https://github.com/
|
63
|
-
changelog_uri: https://github.com/
|
174
|
+
bug_tracker_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_result_parser/issues
|
175
|
+
changelog_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_result_parser/blob/master/CHANGELOG.md
|
64
176
|
documentation_uri: https://www.rubydoc.info/gems/onlyoffice_rspec_result_parser
|
65
|
-
homepage_uri: https://github.com/
|
66
|
-
source_code_uri: https://github.com/
|
177
|
+
homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_result_parser
|
178
|
+
source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_rspec_result_parser
|
67
179
|
post_install_message:
|
68
180
|
rdoc_options: []
|
69
181
|
require_paths:
|
@@ -72,14 +184,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
184
|
requirements:
|
73
185
|
- - ">="
|
74
186
|
- !ruby/object:Gem::Version
|
75
|
-
version: '2.
|
187
|
+
version: '2.5'
|
76
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
189
|
requirements:
|
78
190
|
- - ">="
|
79
191
|
- !ruby/object:Gem::Version
|
80
192
|
version: '0'
|
81
193
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
194
|
+
rubygems_version: 3.1.4
|
83
195
|
signing_key:
|
84
196
|
specification_version: 4
|
85
197
|
summary: Gem to parse rspec results
|