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 +4 -4
- data/README.md +13 -0
- data/lib/allure_cucumber/formatter.rb +2 -1
- data/lib/allure_cucumber/models/metadata_parser.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60013e8948fde26b1e15379519dbc01d29639228f7059e96701cc669e0b2ad83
|
4
|
+
data.tar.gz: a60cec23f71d16191740b102b6bddf06546fbd91ec1819777efef8e67270e7e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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.
|
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:
|
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.
|
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.
|
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.
|
86
|
+
rubygems_version: 3.5.3
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Allure cucumber ruby adaptor
|