allure-rspec 2.18.0 → 2.19.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/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: de7455867459ef68f72755b931fd0a850c0d83d97ee242511dd0bf051a771ef7
|
4
|
+
data.tar.gz: 793b869aa5fb9549499cb48e64e39b2c0d40099850b01bcf738090a51beef97d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9719183b03cfabba95267ff95ab303bcb4079f416ad8ce4871df6c10df6009922ce25e0ac43dda82c181911d453294fd7bf28ee1ca192efd327161c659059d67
|
7
|
+
data.tar.gz: 45261d1206d7cefac2f3af59f56d710f604a7215055f16e2aebc7dd8ef195ab1741a0f25aecdb6de802ce2fac88b8fbaeb1b4b02cd765f375cb13815b0e3a07a
|
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
|
```
|
@@ -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.19.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-08 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.19.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.19.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|