allure_turnip 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -1
- data/lib/allure_turnip.rb +11 -4
- data/lib/allure_turnip/formatter.rb +16 -0
- data/lib/allure_turnip/version.rb +1 -1
- data/spec/annotation.feature +11 -0
- data/spec/spec_helper.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef7d70576f3dc4e0b4f6f42ffd33b16357755d782775c28252869622b20ffcd9
|
4
|
+
data.tar.gz: 45d9429e548a4da68085190c4f492ba6ca02c1ffb7205c309485de930d060cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cce7ffb7ac770d8660089a996d5c414be9d620b2fb35dddfd660582f85afcf98930686a7c40d4396e1516dbb327515b5d8d4388c89b611132f06d40fba50e92
|
7
|
+
data.tar.gz: ead43ca78aaea53cc8ea228881469d9272acfcbe6615f573198a303e265150b5c8354aef63ee462045fd59da90a663b23271b3721a8330e4caf54ab8b568a314
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -36,7 +36,8 @@ And then include it in your spec_helper.rb:
|
|
36
36
|
You can specify the directory where the Allure test results will appear. By default it would be 'gen/allure-results'
|
37
37
|
within your current directory.
|
38
38
|
When you add a `feature_with_filename` option, the suites of the the Allure test results include file's name as a prefix.
|
39
|
-
This options is useful if you have some same feature names. Because Allure overwrites the same feature name's result if there are some same feature names.
|
39
|
+
This options is useful if you have some same feature names. Because Allure overwrites the same feature name's result if there are some same feature names.
|
40
|
+
Allure_turnip will analyze your tags looking for Test Management, Issue Management. These will be displayed in the generated allure report (see allure-core for further info).
|
40
41
|
|
41
42
|
```ruby
|
42
43
|
AllureTurnip.configure do |c|
|
@@ -44,6 +45,8 @@ This options is useful if you have some same feature names. Because Allure overw
|
|
44
45
|
c.clean_dir = false # clean the output directory first? (default: true)
|
45
46
|
c.logging_level = Logger::DEBUG # logging level (default: DEBUG)
|
46
47
|
c.feature_with_filename = true # default: false
|
48
|
+
c.tms_prefix = '@HIPTEST--' # default: '@TMS:'
|
49
|
+
c.issue_prefix = '@JIRA++' # default: '@ISSUE:'
|
47
50
|
end
|
48
51
|
```
|
49
52
|
|
@@ -56,6 +59,8 @@ The method attaches the file in the Allure result.
|
|
56
59
|
**feature**
|
57
60
|
```ruby
|
58
61
|
Feature: Attach File
|
62
|
+
@HIPTEST--1234
|
63
|
+
@JIRA++abc1234
|
59
64
|
Scenario: This is an attaching file feature
|
60
65
|
Given attach file
|
61
66
|
```
|
data/lib/allure_turnip.rb
CHANGED
@@ -10,14 +10,13 @@ require 'allure_turnip/turnip_extension'
|
|
10
10
|
module AllureTurnip
|
11
11
|
module Config
|
12
12
|
class << self
|
13
|
-
attr_accessor :output_dir
|
14
|
-
attr_accessor :clean_dir
|
15
|
-
attr_accessor :logging_level
|
16
|
-
attr_accessor :feature_with_filename
|
13
|
+
attr_accessor :output_dir, :clean_dir, :logging_level, :feature_with_filename, :tms_prefix, :issue_prefix
|
17
14
|
|
18
15
|
DEFAULT_OUTPUT_DIR = 'gen/allure-results'
|
19
16
|
DEFAULT_LOGGING_LEVEL = Logger::DEBUG
|
20
17
|
DEFAULT_FEATURE_WITH_FILENAME = false
|
18
|
+
DEFAULT_TMS_PREFIX = '@TMS:'
|
19
|
+
DEFAULT_ISSUE_PREFIX = '@ISSUE:'
|
21
20
|
|
22
21
|
def output_dir
|
23
22
|
@output_dir || DEFAULT_OUTPUT_DIR
|
@@ -34,6 +33,14 @@ module AllureTurnip
|
|
34
33
|
def feature_with_filename?
|
35
34
|
@feature_with_filename || DEFAULT_FEATURE_WITH_FILENAME
|
36
35
|
end
|
36
|
+
|
37
|
+
def tms_prefix
|
38
|
+
@tms_prefix || DEFAULT_TMS_PREFIX
|
39
|
+
end
|
40
|
+
|
41
|
+
def issue_prefix
|
42
|
+
@issue_prefix || DEFAULT_ISSUE_PREFIX
|
43
|
+
end
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
@@ -114,6 +114,7 @@ module AllureTurnip
|
|
114
114
|
find_all { |value| !value[1].nil? }.
|
115
115
|
inject({}) { |res, value| res.merge(value[0] => value[1]) }
|
116
116
|
detect_feature_story(labels, example_or_group)
|
117
|
+
detect_tags(labels, example_or_group)
|
117
118
|
labels
|
118
119
|
end
|
119
120
|
|
@@ -121,6 +122,21 @@ module AllureTurnip
|
|
121
122
|
metadata.respond_to?(key) ? metadata.send(key) : metadata[key]
|
122
123
|
end
|
123
124
|
|
125
|
+
def detect_tags(labels, example_or_group)
|
126
|
+
keys = metadata(example_or_group).keys
|
127
|
+
testId = abstract_tags(keys, AllureTurnip::Config.tms_prefix)
|
128
|
+
issue = abstract_tags(keys, AllureTurnip::Config.issue_prefix)
|
129
|
+
labels[:testId] = testId if testId
|
130
|
+
labels[:issue] = issue if issue
|
131
|
+
end
|
132
|
+
|
133
|
+
def abstract_tags(keys, prefix)
|
134
|
+
prefix = prefix.gsub(/^@/, '')
|
135
|
+
keys.select {|key| key =~ /#{Regexp.escape(prefix)}/}
|
136
|
+
.map {|key| key.match(/#{Regexp.escape(prefix)}(.*)/)[1]}
|
137
|
+
.first
|
138
|
+
end
|
139
|
+
|
124
140
|
def detect_feature_story(labels, example_or_group)
|
125
141
|
metadata = metadata(example_or_group)
|
126
142
|
is_group = group?(example_or_group)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure_turnip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aha-oretama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- rspec/file_check_spec.rb
|
107
107
|
- rspec/spec_helper.rb
|
108
108
|
- spec/ambiguous.feature
|
109
|
+
- spec/annotation.feature
|
109
110
|
- spec/attach_file.feature
|
110
111
|
- spec/autoload_steps.feature
|
111
112
|
- spec/backgrounds.feature
|
@@ -157,5 +158,5 @@ requirements: []
|
|
157
158
|
rubygems_version: 3.0.2
|
158
159
|
signing_key:
|
159
160
|
specification_version: 4
|
160
|
-
summary: allure_turnip-0.
|
161
|
+
summary: allure_turnip-0.2.0
|
161
162
|
test_files: []
|