allure-ruby-commons 2.13.2 → 2.13.3
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/README.md +1 -0
- data/lib/allure-ruby-commons.rb +8 -1
- data/lib/allure_ruby_commons/allure_lifecycle.rb +1 -1
- data/lib/allure_ruby_commons/file_writer.rb +16 -1
- data/lib/allure_ruby_commons/model/category.rb +19 -0
- data/lib/allure_ruby_commons/model/status.rb +1 -0
- data/lib/allure_ruby_commons/model/test_result_container.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63f3f8681c7437dcc8be0da1a0da44ba238d3103b56f6146746ae910d38ed76d
|
4
|
+
data.tar.gz: e0a6e79db8e67121bfe250c1bc576d18dcbeb1bfa5f3679513dba37759d97d64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e6d27dc40e461f96695f5c7a93ad9b27bdd12982ea77e669aad7d5dc3fb76bec86149fe267124bcf1711a153bda175f44ae5f80f872723035bc714d7a20e361
|
7
|
+
data.tar.gz: d0905aa7da8b94c983614db9f7693cfa7c37e8fca7655eb4b40084fe650e92f00883c4158d83adbcb5c2c7608bd5e5604c62e7cd0b6733e9d8d7d2aaef2cdf2e
|
data/README.md
CHANGED
data/lib/allure-ruby-commons.rb
CHANGED
@@ -138,13 +138,20 @@ module Allure
|
|
138
138
|
lifecycle.add_attachment(name: name, source: source, type: type, test_case: test_case)
|
139
139
|
end
|
140
140
|
|
141
|
-
#
|
141
|
+
# Add allure report environment info
|
142
142
|
# @param [Hash<Symbol, String>] environment
|
143
143
|
# @return [void]
|
144
144
|
def add_environment(environment)
|
145
145
|
lifecycle.write_environment(environment)
|
146
146
|
end
|
147
147
|
|
148
|
+
# Add categories info
|
149
|
+
# @param [File, Array<Allure::Category>] categories
|
150
|
+
# @return [void]
|
151
|
+
def add_categories(categories)
|
152
|
+
lifecycle.write_categories(categories)
|
153
|
+
end
|
154
|
+
|
148
155
|
# Add step with provided name and optional status to current test step, fixture or test case
|
149
156
|
# @param [String] name
|
150
157
|
# @param [Symbol] status <Allure::Status>, <Allure::Status::PASSED> by default
|
@@ -13,7 +13,7 @@ module Allure
|
|
13
13
|
@step_context = []
|
14
14
|
end
|
15
15
|
|
16
|
-
def_delegators :file_writer, :write_attachment, :write_environment
|
16
|
+
def_delegators :file_writer, :write_attachment, :write_environment, :write_categories
|
17
17
|
|
18
18
|
# Start test result container
|
19
19
|
# @param [Allure::TestResultContainer] test_result_container
|
@@ -9,6 +9,10 @@ module Allure
|
|
9
9
|
TEST_RESULT_CONTAINER_SUFFIX = "-container.json"
|
10
10
|
# @return [String] attachment file suffix
|
11
11
|
ATTACHMENT_FILE_SUFFIX = "-attachment"
|
12
|
+
# @return [String] environment info file
|
13
|
+
ENVIRONMENT_FILE = "environment.properties"
|
14
|
+
# @return [String] categories definition json
|
15
|
+
CATEGORIES_FILE = "categories.json"
|
12
16
|
|
13
17
|
# Write test result
|
14
18
|
# @param [Allure::TestResult] test_result
|
@@ -37,7 +41,18 @@ module Allure
|
|
37
41
|
# @return [void]
|
38
42
|
def write_environment(environment)
|
39
43
|
environment.reduce("") { |e, (k, v)| e + "#{k}=#{v}\n" }.tap do |env|
|
40
|
-
write(
|
44
|
+
write(ENVIRONMENT_FILE, env)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Write categories info
|
49
|
+
# @param [File, Array<Allure::Category>] categories
|
50
|
+
# @return [void]
|
51
|
+
def write_categories(categories)
|
52
|
+
if categories.is_a?(File)
|
53
|
+
copy(categories.path, CATEGORIES_FILE)
|
54
|
+
else
|
55
|
+
write(CATEGORIES_FILE, categories.to_json)
|
41
56
|
end
|
42
57
|
end
|
43
58
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "jsonable"
|
4
|
+
|
5
|
+
module Allure
|
6
|
+
class Category < JSONable
|
7
|
+
# Defects category
|
8
|
+
# @param [String] name
|
9
|
+
# @param [Array<Allure::Status>] matched_statuses
|
10
|
+
# @param [String, Regexp] message_regex
|
11
|
+
# @param [String, Regexp] trace_regex
|
12
|
+
def initialize(name:, matched_statuses: nil, message_regex: nil, trace_regex: nil)
|
13
|
+
@name = name
|
14
|
+
@matched_statuses = matched_statuses
|
15
|
+
@message_regex = message_regex
|
16
|
+
@trace_regex = trace_regex
|
17
|
+
end
|
18
|
+
end
|
19
|
+
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.13.
|
4
|
+
version: 2.13.3
|
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: 2020-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uuid
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/allure_ruby_commons/config.rb
|
92
92
|
- lib/allure_ruby_commons/file_writer.rb
|
93
93
|
- lib/allure_ruby_commons/model/attachment.rb
|
94
|
+
- lib/allure_ruby_commons/model/category.rb
|
94
95
|
- lib/allure_ruby_commons/model/content_type.rb
|
95
96
|
- lib/allure_ruby_commons/model/executable_item.rb
|
96
97
|
- lib/allure_ruby_commons/model/fixture_result.rb
|