allure-ruby-commons 2.14.1 → 2.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -2
- data/lib/allure-ruby-commons.rb +6 -2
- data/lib/allure_ruby_commons/allure_lifecycle.rb +21 -1
- data/lib/allure_ruby_commons/config.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 167b883e345ddf9b55cf96986f203371ea865bc470212f578e906989d10d3ea0
|
4
|
+
data.tar.gz: a7568ffb62caa98ac0e74c836630493b5ae228d2e4ff7ed7707be0862b4b012b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974f8f097b193e9abfa0f17c1dadbcf4592f87734512a579540389982e5c05d3ef9bc68b22f5971c479a3279044195b46cce3b20ad010275b900d5a5c7919ae9
|
7
|
+
data.tar.gz: 36ffc3d9a9c9dfdc4ba4f03699fdb49d74e2db4f076404c698170dd0d95384876930c3150a39fe5381b7ea6d82dc692d9d451199194d4d808ef6084a97d76f55
|
data/README.md
CHANGED
@@ -29,6 +29,14 @@ Following configuration options are supported:
|
|
29
29
|
# these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
|
30
30
|
config.link_tms_pattern = "http://www.jira.com/browse/{}"
|
31
31
|
config.link_issue_pattern = "http://www.jira.com/browse/{}"
|
32
|
+
|
33
|
+
# additional metadata
|
34
|
+
# environment.properties
|
35
|
+
config.environment_properties = {
|
36
|
+
custom_attribute: "foo"
|
37
|
+
}
|
38
|
+
# categories.json
|
39
|
+
config.categories = File.new("my_custom_categories.json")
|
32
40
|
end
|
33
41
|
```
|
34
42
|
|
@@ -38,9 +46,9 @@ Getting the configuration object:
|
|
38
46
|
Allure.configuration
|
39
47
|
```
|
40
48
|
|
41
|
-
### Allure environment
|
49
|
+
### Allure execution environment
|
42
50
|
|
43
|
-
It is possible to set up custom allure environment which will be used
|
51
|
+
It is possible to set up custom allure environment which will be used as custom parameter `environment` in every test case. This is useful if you run same tests on different environments and generate single report. This way different runs are not put as retry. Environment can be configured in following ways:
|
44
52
|
|
45
53
|
* via `ALLURE_ENVIRONMENT` environment variable
|
46
54
|
* via `configure` method
|
data/lib/allure-ruby-commons.rb
CHANGED
@@ -161,14 +161,18 @@ module Allure
|
|
161
161
|
lifecycle.add_attachment(name: name, source: source, type: type, test_case: test_case)
|
162
162
|
end
|
163
163
|
|
164
|
-
#
|
164
|
+
# Manually create environment.properties file
|
165
|
+
# if this method is called before test run started and
|
166
|
+
# option clean_results_directory is enabled, the file will be deleted
|
165
167
|
# @param [Hash<Symbol, String>] environment
|
166
168
|
# @return [void]
|
167
169
|
def add_environment(environment)
|
168
170
|
lifecycle.write_environment(environment)
|
169
171
|
end
|
170
172
|
|
171
|
-
#
|
173
|
+
# Manually create categories.json file
|
174
|
+
# if this method is called before test run started and
|
175
|
+
# option clean_results_directory is enabled, the file will be deleted
|
172
176
|
# @param [File, Array<Category>] categories
|
173
177
|
# @return [void]
|
174
178
|
def add_categories(categories)
|
@@ -21,7 +21,7 @@ module Allure
|
|
21
21
|
|
22
22
|
attr_reader :config
|
23
23
|
|
24
|
-
def_delegators :file_writer, :write_attachment
|
24
|
+
def_delegators :file_writer, :write_attachment
|
25
25
|
|
26
26
|
# Start test result container
|
27
27
|
# @param [Allure::TestResultContainer] test_result_container
|
@@ -221,6 +221,26 @@ module Allure
|
|
221
221
|
write_attachment(source, attachment)
|
222
222
|
end
|
223
223
|
|
224
|
+
# Add environment.properties file
|
225
|
+
#
|
226
|
+
# @param [Hash] env
|
227
|
+
# @return [void]
|
228
|
+
def write_environment(env = config.environment_properties)
|
229
|
+
return unless env
|
230
|
+
|
231
|
+
file_writer.write_environment(env)
|
232
|
+
end
|
233
|
+
|
234
|
+
# Add categories.json
|
235
|
+
#
|
236
|
+
# @param [File, Array<Category>] categories
|
237
|
+
# @return [void]
|
238
|
+
def write_categories(categories = config.categories)
|
239
|
+
return unless categories
|
240
|
+
|
241
|
+
file_writer.write_categories(categories)
|
242
|
+
end
|
243
|
+
|
224
244
|
# Add step to current fixture|step|test case
|
225
245
|
# @param [Allure::StepResult] step_result
|
226
246
|
# @return [Allure::StepResult]
|
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.14.
|
4
|
+
version: 2.14.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: 2021-
|
11
|
+
date: 2021-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.2.
|
147
|
+
rubygems_version: 3.2.22
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Common library for allure results generation
|