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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4763123daad55aca4e73e90914720d86b9ec9fb5a2a91271877c97b0a245abc7
4
- data.tar.gz: a76d41cd5733f89ba75760dc1b89d365b19fa0eaaa71d0d4162ee72707434f26
3
+ metadata.gz: 167b883e345ddf9b55cf96986f203371ea865bc470212f578e906989d10d3ea0
4
+ data.tar.gz: a7568ffb62caa98ac0e74c836630493b5ae228d2e4ff7ed7707be0862b4b012b
5
5
  SHA512:
6
- metadata.gz: ecc05f47fc2cb41dfba2bd905dc2089468077e223972be839f8b450ff197f2e370c3378f13f0109c06238903bf4e87c7dcecf446088d1b2cec6b3a92a9136ee8
7
- data.tar.gz: 771590de5ea1f9a35df2427be4f12ddc4579bdaf66ba373cd70c3deaaa54990934c47f04329b7e2a0c96c1f8ef2333e4b4fabbfe0ee70d3e2229978f16dfaad6
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 to prefix test case names. 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:
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
@@ -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
- # Add allure report environment info
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
- # Add categories info
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, :write_environment, :write_categories
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]
@@ -17,7 +17,9 @@ module Allure
17
17
  :logging_level,
18
18
  :link_tms_pattern,
19
19
  :link_issue_pattern,
20
- :clean_results_directory
20
+ :clean_results_directory,
21
+ :environment_properties,
22
+ :categories
21
23
 
22
24
  def initialize
23
25
  @results_directory = "reports/allure-results"
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.1
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-06-10 00:00:00.000000000 Z
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.15
147
+ rubygems_version: 3.2.22
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Common library for allure results generation