allure-rspec 2.18.0 → 2.20.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 +14 -4
- data/lib/allure_rspec/formatter.rb +1 -1
- data/lib/allure_rspec/metadata_parser.rb +16 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7dca74b7a95c1d8bd4b051066a47a891d54c16a79f0582f625cf55378f5c636
|
4
|
+
data.tar.gz: 18210d0b3123b469fb7e7f8edc996a54dae9b59011bc4dab796b096eba3da61a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 217a347f6efdd37551ef1e63303da9bd25c7fd0a9a91a3f3b14603b1154fe264eb2d1cb49439da0bdb8ce7a6ab2a043764040924b70b19c0000f992c85c8e306
|
7
|
+
data.tar.gz: 8f27c2219fa211358805970158908bc59b857505cf3b61011d6174d2a66d6af85d535030f6f78c1cb35f27c37ec4939615f8256f2ae04dfccc6b4132ab6cbe20
|
data/README.md
CHANGED
@@ -144,18 +144,28 @@ end
|
|
144
144
|
|
145
145
|
### Adding additional labels to allure test case
|
146
146
|
|
147
|
-
|
147
|
+
- All metadata tags that have no value are added as labels:
|
148
148
|
|
149
149
|
```ruby
|
150
|
-
it "some test case",
|
150
|
+
it "some test case", :visual_test, :core_functionality do
|
151
151
|
# test
|
152
152
|
end
|
153
153
|
```
|
154
154
|
|
155
|
-
|
155
|
+
- For tags that define value as string or symbol, value is added as label:
|
156
156
|
|
157
157
|
```ruby
|
158
|
-
it "some test case", :visual_test, :core_functionality do
|
158
|
+
it "some test case", test_type: "visual_test", functionality: "core_functionality" do
|
159
|
+
# test
|
160
|
+
end
|
161
|
+
```
|
162
|
+
|
163
|
+
will add `visual_test` and `core_functionality` labels to test case.
|
164
|
+
|
165
|
+
- Tags that have value as `false` will not be added as labels:
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
it "some test case", skipped: false do
|
159
169
|
# test
|
160
170
|
end
|
161
171
|
```
|
@@ -124,7 +124,7 @@ module AllureRspec
|
|
124
124
|
test_case.stage = Allure::Stage::FINISHED
|
125
125
|
test_case.status = status(result)
|
126
126
|
test_case.status_details.message = status_detail.message
|
127
|
-
test_case.status_details.trace = status_detail.trace
|
127
|
+
test_case.status_details.trace = status_detail.trace&.gsub(/\e\[(\d+)(?:;\d+)*m/, "")
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
@@ -114,11 +114,14 @@ module AllureRspec
|
|
114
114
|
end
|
115
115
|
|
116
116
|
# Get custom labels
|
117
|
+
# skip tags that are set to false explicitly
|
118
|
+
# use value as label when it's a string or a symbol
|
119
|
+
#
|
117
120
|
# @return [Array<Allure::Label>]
|
118
121
|
def tag_labels
|
119
122
|
metadata
|
120
123
|
.reject { |k| RSPEC_IGNORED_METADATA.include?(k) || special_metadata_tag?(k) }
|
121
|
-
.
|
124
|
+
.filter_map { |k, v| custom_label(k, v) }
|
122
125
|
end
|
123
126
|
|
124
127
|
# Get behavior labels
|
@@ -148,6 +151,18 @@ module AllureRspec
|
|
148
151
|
.map { |key, value| Allure::ResultUtils.public_send("#{type}_link", key.to_s, value, link_pattern) }
|
149
152
|
end
|
150
153
|
|
154
|
+
# Label value from custom metadata
|
155
|
+
#
|
156
|
+
# @param [String, Symbol] key
|
157
|
+
# @param [Object] value
|
158
|
+
# @return [Allure::Label]
|
159
|
+
def custom_label(key, value)
|
160
|
+
return if value == false
|
161
|
+
return Allure::ResultUtils.tag_label(value.to_s) if value.is_a?(String) || value.is_a?(Symbol)
|
162
|
+
|
163
|
+
Allure::ResultUtils.tag_label(key.to_s)
|
164
|
+
end
|
165
|
+
|
151
166
|
# Special allure metadata tags
|
152
167
|
#
|
153
168
|
# @param [Symbol] key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.20.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: 2022-
|
11
|
+
date: 2022-11-28 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.20.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.20.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|