allure-cucumber 2.13.5.rc.1 → 2.13.5.rc.2

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: 660dd75c5884bb993804ca888ccb2babc2e997bf38a3c4c12105dfffe9948394
4
- data.tar.gz: 06fd91978393b639e8d92b6b87b7ce752778d254a5a50caf19565d34fefd9f31
3
+ metadata.gz: fdf3884804a541bfabeb89cd582eab7cba97549b5a63ba62270ed6b4bd7017b5
4
+ data.tar.gz: 6f8d77e4269b5bdfbe3232471e6db4f92e3cf59059903a3f23283e19da4f0249
5
5
  SHA512:
6
- metadata.gz: dec76bf5806c56bfaa484797b2e27e794dae083ab48cbd741e654cd72adf9e19e280723be0d96c3a6b218c826dc4caa757883e22427eb81273ea39f1bca561b6
7
- data.tar.gz: 2fdc18e522ead6101e5fab6d73e973861bc576167a778b268cc3eaf32e0e45a9866df8f93860705c09c33cd2dfbe04694bb6258508414578f32fa193e40badd0
6
+ metadata.gz: 727c03e2dde205128fba827ec975f7962077a2a3e5467a8b2bb6f5f61a4e72ebea8c75a03b7741847a25e30e8fa09cf25e63d2f513df89cfc56c010a35390dca
7
+ data.tar.gz: 8498977b32174a251db8b13fcb08698fc526a84f9abc3a8aa66a94b90f70f712857b3137f75c15af66374285dae11c2db2e655703e670ba931b518670bab3cea
data/README.md CHANGED
@@ -4,12 +4,17 @@
4
4
 
5
5
  This repository contains Allure adaptor for [Cucumber](http://cukes.info/) framework.
6
6
 
7
+ ## Cucumber versions
8
+
9
+ allure-cucumber versions <= 2.13.4 support only cucumber 3 and lower\
10
+ allure-cucumber versions >= 2.13.5 only support cucumber 4 and are not backwards compatible with cucumber 3 and lower
11
+
7
12
  ## Installation
8
13
 
9
14
  Add this line to your application's Gemfile:
10
15
 
11
16
  ```ruby
12
- gem 'allure-cucumber'
17
+ gem "allure-cucumber"
13
18
  ```
14
19
 
15
20
  And then execute:
@@ -24,27 +29,30 @@ Or install it yourself as:
24
29
  gem install allure-cucumber
25
30
  ```
26
31
 
27
- ## Cucumber versions
32
+ Require in "support/env.rb":
28
33
 
29
- allure-cucumber versions <= 2.13.4 support only cucumber 3 and lower\
30
- allure-cucumber versions >= 2.13.5 only support cucumber 4 and are not backwards compatible with cucumber 3 and lower
34
+ ```ruby
35
+ require "allure-cucumber"
36
+ ```
31
37
 
32
38
  ## Configuration
33
39
 
34
- Common allure configuration is set via `Allure.configure` method. To change id, add the following in `features/support/env.rb` file:
40
+ Common allure configuration is set via `AllureCucumber.configure` method. To change it, add the following in `features/support/env.rb` file:
35
41
 
36
42
  ```ruby
37
- Allure.configure do |c|
38
- c.results_directory = "/whatever/you/like"
39
- c.clean_results_directory = true
40
- c.logging_level = Logger::INFO
43
+ require "allure-cucumber"
44
+
45
+ AllureCucumber.configure do |config|
46
+ config.results_directory = "/whatever/you/like"
47
+ config.clean_results_directory = true
48
+ config.logging_level = Logger::INFO
41
49
  # these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
42
- c.link_tms_pattern = "http://www.jira.com/browse/{}"
43
- c.link_issue_pattern = "http://www.jira.com/browse/{}"
50
+ config.link_tms_pattern = "http://www.jira.com/browse/{}"
51
+ config.link_issue_pattern = "http://www.jira.com/browse/{}"
44
52
  end
45
53
  ```
46
54
 
47
- By default, allure-cucumber will analyze your cucumber tags looking for Test Management, Issue Management, and Severity hooks. Links to TMS and ISSUE and test severity will be displayed in the report. By default these prefixes are used:
55
+ By default, allure-cucumber will analyze your cucumber tags looking for Test Management, Issue Management, and Severity tag. Links to TMS and ISSUE and test severity will be displayed in the report. By default these prefixes are used:
48
56
 
49
57
  ```ruby
50
58
  DEFAULT_TMS_PREFIX = 'TMS:'
@@ -64,10 +72,10 @@ Example:
64
72
  You can configure these prefixes as well as tms and issue tracker urls like this:
65
73
 
66
74
  ```ruby
67
- AllureCucumber.configure do |c|
68
- c.tms_prefix = 'HIPTEST--'
69
- c.issue_prefix = 'JIRA++'
70
- c.severity_prefix = 'URGENCY:'
75
+ AllureCucumber.configure do |config|
76
+ config.tms_prefix = 'HIPTEST--'
77
+ config.issue_prefix = 'JIRA++'
78
+ config.severity_prefix = 'URGENCY:'
71
79
  end
72
80
  ```
73
81
 
@@ -84,12 +92,6 @@ Additional special tags exists for setting status detail of test scenarios, allu
84
92
 
85
93
  ## Usage
86
94
 
87
- Put the following in your `features/support/env.rb` file:
88
-
89
- ```ruby
90
- require 'allure-cucumber'
91
- ```
92
-
93
95
  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.
94
96
 
95
97
  You can also manually attach screenshots and links to test steps and test cases by interacting with allure lifecycle directly. For more info check out `allure-ruby-commons`
@@ -12,7 +12,7 @@ module AllureCucumber
12
12
  # Get allure cucumber configuration
13
13
  # @return [Allure::CucumberConfig]
14
14
  def configuration
15
- CucumberConfig
15
+ CucumberConfig.instance
16
16
  end
17
17
 
18
18
  # Set allure configuration
@@ -20,7 +20,7 @@ module AllureCucumber
20
20
  # @yieldreturn [void]
21
21
  # @return [void]
22
22
  def configure
23
- yield(CucumberConfig)
23
+ yield(configuration)
24
24
  end
25
25
  end
26
26
  end
@@ -1,32 +1,52 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "singleton"
4
+ require "forwardable"
5
+
3
6
  module AllureCucumber
4
7
  # Allure cucumber configuration
5
- class CucumberConfig
6
- class << self
7
- # @return [String] default tms tag prefix
8
- DEFAULT_TMS_PREFIX = "TMS:"
9
- # @return [String] default issue tag prefix
10
- DEFAULT_ISSUE_PREFIX = "ISSUE:"
11
- # @return [String] default severity tag prefix
12
- DEFAULT_SEVERITY_PREFIX = "SEVERITY:"
13
-
14
- attr_writer :tms_prefix, :issue_prefix, :severity_prefix
15
-
16
- # @return [String]
17
- def tms_prefix
18
- @tms_prefix || DEFAULT_TMS_PREFIX
19
- end
20
-
21
- # @return [String]
22
- def issue_prefix
23
- @issue_prefix || DEFAULT_ISSUE_PREFIX
24
- end
25
-
26
- # @return [String]
27
- def severity_prefix
28
- @severity_prefix || DEFAULT_SEVERITY_PREFIX
29
- end
8
+ class CucumberConfig < Allure::Config
9
+ include Singleton
10
+ extend Forwardable
11
+
12
+ # @return [String] default tms tag prefix
13
+ DEFAULT_TMS_PREFIX = "TMS:"
14
+ # @return [String] default issue tag prefix
15
+ DEFAULT_ISSUE_PREFIX = "ISSUE:"
16
+ # @return [String] default severity tag prefix
17
+ DEFAULT_SEVERITY_PREFIX = "SEVERITY:"
18
+
19
+ def_delegators :@allure_config,
20
+ :clean_results_directory,
21
+ :clean_results_directory=,
22
+ :link_issue_pattern,
23
+ :link_issue_pattern=,
24
+ :link_tms_pattern,
25
+ :link_tms_pattern=,
26
+ :logging_level,
27
+ :logging_level=,
28
+ :results_directory,
29
+ :results_directory=
30
+
31
+ attr_writer :tms_prefix, :issue_prefix, :severity_prefix
32
+
33
+ def initialize
34
+ @allure_config = Allure.configuration
35
+ end
36
+
37
+ # @return [String]
38
+ def tms_prefix
39
+ @tms_prefix || DEFAULT_TMS_PREFIX
40
+ end
41
+
42
+ # @return [String]
43
+ def issue_prefix
44
+ @issue_prefix || DEFAULT_ISSUE_PREFIX
45
+ end
46
+
47
+ # @return [String]
48
+ def severity_prefix
49
+ @severity_prefix || DEFAULT_SEVERITY_PREFIX
30
50
  end
31
51
  end
32
52
  end
@@ -14,7 +14,7 @@ module AllureCucumber
14
14
  # @param [Array<String>] tags
15
15
  # @return [Array<Allure::Link>]
16
16
  def tms_links(tags)
17
- return [] unless Allure::Config.link_tms_pattern
17
+ return [] unless AllureCucumber.configuration.link_tms_pattern
18
18
 
19
19
  matching_links(tags, :tms)
20
20
  end
@@ -22,7 +22,7 @@ module AllureCucumber
22
22
  # @param [Array<String>] tags
23
23
  # @return [Array<Allure::Link>]
24
24
  def issue_links(tags)
25
- return [] unless Allure::Config.link_issue_pattern
25
+ return [] unless AllureCucumber.configuration.link_issue_pattern
26
26
 
27
27
  matching_links(tags, :issue)
28
28
  end
@@ -63,9 +63,9 @@ module AllureCucumber
63
63
  # @return [Hash<Symbol, Regexp>]
64
64
  def reserved_patterns
65
65
  @reserved_patterns ||= {
66
- tms: /@#{CucumberConfig.tms_prefix}(?<tms>\S+)/,
67
- issue: /@#{CucumberConfig.issue_prefix}(?<issue>\S+)/,
68
- severity: /@#{CucumberConfig.severity_prefix}(?<severity>\S+)/,
66
+ tms: /@#{AllureCucumber.configuration.tms_prefix}(?<tms>\S+)/,
67
+ issue: /@#{AllureCucumber.configuration.issue_prefix}(?<issue>\S+)/,
68
+ severity: /@#{AllureCucumber.configuration.severity_prefix}(?<severity>\S+)/,
69
69
  flaky: /@flaky/,
70
70
  muted: /@muted/,
71
71
  known: /@known/,
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.13.5.rc.1
4
+ version: 2.13.5.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-28 00:00:00.000000000 Z
11
+ date: 2020-03-29 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.13.5.rc.1
19
+ version: 2.13.5.rc.2
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.13.5.rc.1
26
+ version: 2.13.5.rc.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: cucumber
29
29
  requirement: !ruby/object:Gem::Requirement