allure-cucumber 2.22.0 → 2.24.0

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: c653f4af1bebde6bf005c36b2709e135d1319d8a408ba49ce858f30e49dd6776
4
- data.tar.gz: c77ab7841f2705ffd54e6909a85ca1d7ef2c02cabc8cb482b64444357480b5d0
3
+ metadata.gz: 60013e8948fde26b1e15379519dbc01d29639228f7059e96701cc669e0b2ad83
4
+ data.tar.gz: a60cec23f71d16191740b102b6bddf06546fbd91ec1819777efef8e67270e7e0
5
5
  SHA512:
6
- metadata.gz: 3de29f215b0b43508e860866bfdd6520dc40a430ae3bda925709d8a3198c777f31944e2e70a95cc94e9d18abea4a91e9ad7ca7e286f5a99f81df7283982cea53
7
- data.tar.gz: 600dad62f41fe2769a6750388d9f614fb5366c7a17481dfddc1e42d65958d28602739f5d3efac10e37c562680ce95f497a6ba1e4935762bb1aa02510b2183958
6
+ metadata.gz: d0598cf91a081999a4e6aa9688a930b393beeac37e48bf54bda228c617e5d245a2da2e289cf4efdd16d0ab526c408068eaf78a311511451b650cbe24563bc377
7
+ data.tar.gz: 80a9738d427b02ef72b1a79d31d78e52dd1dbfe0fb6d7db932468460db7fa637c88f5cc807db1cebac0862273070bd62572003aaad30dd7294fad3a8d7b4fed1
data/README.md CHANGED
@@ -48,6 +48,7 @@ AllureCucumber.configure do |config|
48
48
  config.logging_level = Logger::INFO
49
49
  config.logger = Logger.new($stdout, Logger::DEBUG)
50
50
  config.environment = "staging"
51
+ config.failure_exception = RSpec::Expectations::ExpectationNotMetError
51
52
 
52
53
  # these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
53
54
  config.link_tms_pattern = "http://www.jira.com/browse/{}"
@@ -110,6 +111,18 @@ Example:
110
111
 
111
112
  Additional special tags exists for setting status detail of test scenarios, allure will pick up following tags: `@flaky`, `@known` and `@muted`
112
113
 
114
+ ### Custom failure exception
115
+
116
+ Allure report will mark steps and tests as either `Failed` or `Broken` based on exception class that was raised. By default, `RSpec::Expectations::ExpectationNotMetError` exception will mark test as `Failed` and all other exceptions will mark test as `Broken`.
117
+
118
+ Custom failure exception class can be configured:
119
+
120
+ ```ruby
121
+ AllureCucumber.configure do |config|
122
+ config.failure_exception = MyCustomFailedException
123
+ end
124
+ ```
125
+
113
126
  ## Usage
114
127
 
115
128
  Use `--format AllureCucumber::CucumberFormatter --out where/you-want-results` while running cucumber or add it to `cucumber.yml`. Note that cucumber `--out` option overrides `results_directory` set via `Allure.configure` method.
@@ -71,9 +71,10 @@ module AllureCucumber
71
71
  # @param [Cucumber::Events::TestStepFinished] event
72
72
  # @return [void]
73
73
  def on_test_step_finished(event)
74
+ status = ALLURE_STATUS.fetch(event.result.to_sym, Allure::Status::BROKEN)
74
75
  update_block = proc do |step|
75
76
  step.stage = Allure::Stage::FINISHED
76
- step.status = ALLURE_STATUS.fetch(event.result.to_sym, Allure::Status::BROKEN)
77
+ step.status = event.result.failed? ? Allure::ResultUtils.status(event.result&.exception) : status
77
78
  end
78
79
 
79
80
  event.test_step.hook? ? handle_hook_finished(event.test_step, update_block) : handle_step_finished(update_block)
@@ -101,13 +101,13 @@ module AllureCucumber
101
101
  def matching_links(type)
102
102
  pattern = reserved_patterns[type]
103
103
  prefix = config.tms_prefix
104
- link_pattern = config.public_send("link_#{type}_pattern")
104
+ link_pattern = config.public_send(:"link_#{type}_pattern")
105
105
 
106
106
  tags
107
107
  .grep(pattern)
108
108
  .map do |tag|
109
109
  tag.match(pattern) do |match|
110
- Allure::ResultUtils.public_send("#{type}_link", prefix, match[type], link_pattern)
110
+ Allure::ResultUtils.public_send(:"#{type}_link", prefix, match[type], link_pattern)
111
111
  end
112
112
  end
113
113
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.0
4
+ version: 2.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-27 00:00:00.000000000 Z
11
+ date: 2024-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: allure-ruby-commons
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.22.0
19
+ version: 2.24.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.22.0
26
+ version: 2.24.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cucumber
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 4.0.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '9'
36
+ version: '10'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 4.0.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '9'
46
+ version: '10'
47
47
  description: Cucumber adaptor to generate rich allure test reports
48
48
  email: andrejs.cunskis@gmail.com
49
49
  executables: []
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.4.10
86
+ rubygems_version: 3.5.3
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Allure cucumber ruby adaptor