allure-ruby-commons 2.15.0 → 2.16.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea5e2f8740282a4774b060a76b35522c1161d9f108c9c37fe3170481e3e70b0c
|
4
|
+
data.tar.gz: 3639b7df27592188870e198baad8c5cf97dd35895e78ec8414b8a2567819a2a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 800e4c403a091f70bdadd4d0209681c80495acca7d2f6d786ad990987ec6feb75111ccc4af22febae88e6ea26ad8839c1c366c94ab7538926986bd43ce56fb3f
|
7
|
+
data.tar.gz: 3c1039e855756f4dc762e0bb022219dec79e534d14c3dbbe82dd0b93625372ed1232a809e738182aac8a69742c3c613a53c4703b6af331aa29aea7f8bda7738a
|
data/lib/allure-ruby-commons.rb
CHANGED
@@ -179,6 +179,33 @@ module Allure
|
|
179
179
|
lifecycle.write_categories(categories)
|
180
180
|
end
|
181
181
|
|
182
|
+
# Set test case status detail to flaky
|
183
|
+
#
|
184
|
+
# @return [void]
|
185
|
+
def set_flaky
|
186
|
+
lifecycle.update_test_case do |test_case|
|
187
|
+
test_case.status_details.flaky = true
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Set test case status detail to muted
|
192
|
+
#
|
193
|
+
# @return [void]
|
194
|
+
def set_muted
|
195
|
+
lifecycle.update_test_case do |test_case|
|
196
|
+
test_case.status_details.muted = true
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Set test case status detail to known
|
201
|
+
#
|
202
|
+
# @return [void]
|
203
|
+
def set_known
|
204
|
+
lifecycle.update_test_case do |test_case|
|
205
|
+
test_case.status_details.known = true
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
182
209
|
# Add step with provided name and optional status to current test step, fixture or test case
|
183
210
|
# @param [String] name
|
184
211
|
# @param [Symbol] status {Status}, {Status::PASSED} by default
|
@@ -207,5 +234,15 @@ module Allure
|
|
207
234
|
ensure
|
208
235
|
lifecycle.stop_test_step
|
209
236
|
end
|
237
|
+
|
238
|
+
# Add parameter to current test step
|
239
|
+
# @param [String] name
|
240
|
+
# @param [String] value
|
241
|
+
# @return [void]
|
242
|
+
def step_parameter(name, value)
|
243
|
+
lifecycle.update_test_step do |step|
|
244
|
+
step.parameters.push(Parameter.new(name, value))
|
245
|
+
end
|
246
|
+
end
|
210
247
|
end
|
211
248
|
# rubocop:enable Naming/FileName
|
@@ -13,6 +13,8 @@ module Allure
|
|
13
13
|
ENVIRONMENT_FILE = "environment.properties"
|
14
14
|
# @return [String] categories definition json
|
15
15
|
CATEGORIES_FILE = "categories.json"
|
16
|
+
# @return [Hash] Oj json options
|
17
|
+
OJ_OPTIONS = { mode: :custom, use_to_hash: true, ascii_only: true }.freeze
|
16
18
|
|
17
19
|
# File writer instance
|
18
20
|
#
|
@@ -25,14 +27,14 @@ module Allure
|
|
25
27
|
# @param [Allure::TestResult] test_result
|
26
28
|
# @return [void]
|
27
29
|
def write_test_result(test_result)
|
28
|
-
write("#{test_result.uuid}#{TEST_RESULT_SUFFIX}", Oj.dump(test_result))
|
30
|
+
write("#{test_result.uuid}#{TEST_RESULT_SUFFIX}", Oj.dump(test_result, OJ_OPTIONS))
|
29
31
|
end
|
30
32
|
|
31
33
|
# Write test result container
|
32
34
|
# @param [Allure::TestResultContainer] test_container_result
|
33
35
|
# @return [void]
|
34
36
|
def write_test_result_container(test_container_result)
|
35
|
-
write("#{test_container_result.uuid}#{TEST_RESULT_CONTAINER_SUFFIX}", Oj.dump(test_container_result))
|
37
|
+
write("#{test_container_result.uuid}#{TEST_RESULT_CONTAINER_SUFFIX}", Oj.dump(test_container_result, OJ_OPTIONS))
|
36
38
|
end
|
37
39
|
|
38
40
|
# Write allure attachment file
|
@@ -59,7 +61,7 @@ module Allure
|
|
59
61
|
if categories.is_a?(File)
|
60
62
|
copy(categories.path, CATEGORIES_FILE)
|
61
63
|
else
|
62
|
-
write(CATEGORIES_FILE, Oj.dump(categories))
|
64
|
+
write(CATEGORIES_FILE, Oj.dump(categories, OJ_OPTIONS))
|
63
65
|
end
|
64
66
|
end
|
65
67
|
|
@@ -73,7 +75,7 @@ module Allure
|
|
73
75
|
|
74
76
|
def write(name, source)
|
75
77
|
filename = File.join(output_dir, name)
|
76
|
-
File.
|
78
|
+
File.write(filename, source)
|
77
79
|
end
|
78
80
|
|
79
81
|
def copy(from, to)
|
@@ -24,6 +24,7 @@ module Allure
|
|
24
24
|
@stage = options[:stage] || Stage::SCHEDULED
|
25
25
|
@steps = options[:steps] || []
|
26
26
|
@attachments = options[:attachments] || []
|
27
|
+
@parameters = options[:parameters] || []
|
27
28
|
end
|
28
29
|
|
29
30
|
attr_accessor :name,
|
@@ -34,6 +35,7 @@ module Allure
|
|
34
35
|
:description_html,
|
35
36
|
:steps,
|
36
37
|
:attachments,
|
38
|
+
:parameters,
|
37
39
|
:start,
|
38
40
|
:stop
|
39
41
|
end
|
@@ -28,27 +28,13 @@ module Allure
|
|
28
28
|
@full_name = options[:full_name] || "Unnamed"
|
29
29
|
@labels = options[:labels] || []
|
30
30
|
@links = options[:links] || []
|
31
|
-
@parameters
|
31
|
+
@parameters << Parameter.new("environment", environment) if environment
|
32
32
|
end
|
33
33
|
|
34
34
|
attr_accessor :uuid,
|
35
35
|
:history_id,
|
36
36
|
:full_name,
|
37
37
|
:labels,
|
38
|
-
:links
|
39
|
-
:parameters
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
# Test name prefixed with allure environment
|
44
|
-
#
|
45
|
-
# @param [Array] parameters
|
46
|
-
# @param [String] environment
|
47
|
-
# @return [Array]
|
48
|
-
def updated_parameters(parameters, environment)
|
49
|
-
return parameters unless environment
|
50
|
-
|
51
|
-
parameters << Parameter.new("environment", environment)
|
52
|
-
end
|
38
|
+
:links
|
53
39
|
end
|
54
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-ruby-commons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrejs Cunskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -129,6 +129,7 @@ metadata:
|
|
129
129
|
documentation_uri: https://github.com/allure-framework/allure-ruby/blob/master/allure-ruby-commons/README.md
|
130
130
|
source_code_uri: https://github.com/allure-framework/allure-ruby/tree/master/allure-ruby-commons
|
131
131
|
wiki_uri: https://github.com/allure-framework/allure-ruby/wiki
|
132
|
+
rubygems_mfa_required: 'false'
|
132
133
|
post_install_message:
|
133
134
|
rdoc_options: []
|
134
135
|
require_paths:
|
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
145
|
- !ruby/object:Gem::Version
|
145
146
|
version: '0'
|
146
147
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
148
|
+
rubygems_version: 3.3.7
|
148
149
|
signing_key:
|
149
150
|
specification_version: 4
|
150
151
|
summary: Common library for allure results generation
|