allure-cucumber 2.23.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: a2593815b025fe2a3ebb89c52f463f6bfc2c4fcdfa2c37f54636933a0eed379c
4
- data.tar.gz: 79f0f24b05f63858838a73272bf2ceba84eae534825131f3e6221b7351135932
3
+ metadata.gz: 60013e8948fde26b1e15379519dbc01d29639228f7059e96701cc669e0b2ad83
4
+ data.tar.gz: a60cec23f71d16191740b102b6bddf06546fbd91ec1819777efef8e67270e7e0
5
5
  SHA512:
6
- metadata.gz: 307518476ba9fe21a68143620df28b6882717c1bec38905f7774cd7abebfccb8facf3132c1d328ddcd98c1f64c68ffe418669a36dccdae54af07fd2a1532222f
7
- data.tar.gz: 5e2075fdcdaf8ae7cb1aa8d69ef17a889b6dccc01a639949115770c312cf6fec50399d8a80c10f4e5b0f2dd14250a61da7cb8e780a38bcf5e90e90ca7a495f74
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.23.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-09-06 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.23.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.23.0
26
+ version: 2.24.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cucumber
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -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