allure-cucumber 0.6.1 → 2.10.0.beta2

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.
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "config"
4
+
5
+ module Allure
6
+ module TagParser
7
+ # @param [Cucumber::Core::Ast::Tag] tags
8
+ # @return [Array<Allure::Label>]
9
+ def tag_labels(tags)
10
+ tags
11
+ .reject { |tag| reserved?(tag.name) }
12
+ .map { |tag| ResultUtils.tag_label(tag.name.delete_prefix("@")) }
13
+ end
14
+
15
+ # @param [Cucumber::Core::Ast::Tag] tags
16
+ # @return [Array<Allure::Link>]
17
+ def tms_links(tags)
18
+ return [] unless CucumberConfig.link_tms_pattern
19
+
20
+ tms_pattern = reserved_patterns[:tms]
21
+ tags
22
+ .select { |tag| tag.name.match?(tms_pattern) }
23
+ .map { |tag| tag.name.match(tms_pattern) { |match| ResultUtils.tms_link(match[:tms]) } }
24
+ end
25
+
26
+ # @param [Cucumber::Core::Ast::Tag] tags
27
+ # @return [Array<Allure::Link>]
28
+ def issue_links(tags)
29
+ return [] unless CucumberConfig.link_issue_pattern
30
+
31
+ issue_pattern = reserved_patterns[:issue]
32
+ tags
33
+ .select { |tag| tag.name.match?(issue_pattern) }
34
+ .map { |tag| tag.name.match(issue_pattern) { |match| ResultUtils.issue_link(match[:issue]) } }
35
+ end
36
+
37
+ # @param [Cucumber::Core::Ast::Tag] tags
38
+ # @return [Allure::Label]
39
+ def severity(tags)
40
+ severity_pattern = reserved_patterns[:severity]
41
+ severity = tags
42
+ .detect { |tag| tag.name.match?(severity_pattern) }&.name
43
+ &.match(severity_pattern)&.[](:severity) || "normal"
44
+
45
+ ResultUtils.severity_label(severity)
46
+ end
47
+
48
+ # @param [Cucumber::Core::Ast::Tag] tags
49
+ # @return [Hash<Symbol, Boolean>]
50
+ def status_detail_tags(tags)
51
+ {
52
+ flaky: tags.any? { |tag| tag.match?(reserved_patterns[:flaky]) },
53
+ muted: tags.any? { |tag| tag.match?(reserved_patterns[:muted]) },
54
+ known: tags.any? { |tag| tag.match?(reserved_patterns[:known]) },
55
+ }
56
+ end
57
+
58
+ private
59
+
60
+ # @return [Hash<Symbol, Regexp>] <description>
61
+ def reserved_patterns
62
+ @reserved_patterns ||= {
63
+ tms: /@#{CucumberConfig.tms_prefix}(?<tms>\S+)/,
64
+ issue: /@#{CucumberConfig.issue_prefix}(?<issue>\S+)/,
65
+ severity: /@#{CucumberConfig.severity_prefix}(?<severity>\S+)/,
66
+ flaky: /@flaky/,
67
+ muted: /@muted/,
68
+ known: /@known/,
69
+ }
70
+ end
71
+
72
+ # @param [String] tag
73
+ # @return [Boolean]
74
+ def reserved?(tag)
75
+ reserved_patterns.values.any? { |pattern| tag.match?(pattern) }
76
+ end
77
+ end
78
+ end
metadata CHANGED
@@ -1,111 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 2.10.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
- - Imran Khan
7
+ - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-20 00:00:00.000000000 Z
11
+ date: 2019-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: cucumber
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 2.0.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 2.0.0
27
- - !ruby/object:Gem::Dependency
28
- name: allure-ruby-adaptor-api
14
+ name: allure-ruby-commons
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - ">="
17
+ - - '='
32
18
  - !ruby/object:Gem::Version
33
- version: 0.7.1
19
+ version: 2.10.0.beta2
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ">="
24
+ - - '='
39
25
  - !ruby/object:Gem::Version
40
- version: 0.7.1
26
+ version: 2.10.0.beta2
41
27
  - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.5'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.5'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: aruba
28
+ name: cucumber
71
29
  requirement: !ruby/object:Gem::Requirement
72
30
  requirements:
73
31
  - - "~>"
74
32
  - !ruby/object:Gem::Version
75
- version: 0.14.2
76
- type: :development
33
+ version: '3.1'
34
+ type: :runtime
77
35
  prerelease: false
78
36
  version_requirements: !ruby/object:Gem::Requirement
79
37
  requirements:
80
38
  - - "~>"
81
39
  - !ruby/object:Gem::Version
82
- version: 0.14.2
83
- description: Adaptor to use Allure framework with cucumber
84
- email:
85
- - 9ikhan@gmail.com
40
+ version: '3.1'
41
+ description: Cucumber adaptor to generate rich allure test reports
42
+ email: andrejs.cunskis@gmail.com
86
43
  executables: []
87
44
  extensions: []
88
45
  extra_rdoc_files: []
89
46
  files:
90
- - ".gitignore"
91
- - Gemfile
92
- - LICENSE
93
47
  - README.md
94
- - Rakefile
95
- - allure-cucumber.gemspec
96
- - features/docs/acceptance_tests/dsl_attach_file.feature
97
- - features/docs/acceptance_tests/embed_attach_file.feature
98
- - features/lib/support/aruba.rb
99
- - features/lib/support/env.rb
100
- - fixtures/minimal_cucumber_app/features/lib/support/env.rb
101
48
  - lib/allure-cucumber.rb
102
- - lib/allure-cucumber/dsl.rb
103
- - lib/allure-cucumber/feature_tracker.rb
104
- - lib/allure-cucumber/formatter.rb
105
- - lib/allure-cucumber/version.rb
49
+ - lib/allure_cucumber/ast_transformer.rb
50
+ - lib/allure_cucumber/config.rb
51
+ - lib/allure_cucumber/cucumber_model.rb
52
+ - lib/allure_cucumber/formatter.rb
53
+ - lib/allure_cucumber/tag_parser.rb
106
54
  homepage: http://allure.qatools.ru
107
55
  licenses:
108
- - Apache2
56
+ - Apache-2.0
109
57
  metadata: {}
110
58
  post_install_message:
111
59
  rdoc_options: []
@@ -115,20 +63,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
63
  requirements:
116
64
  - - ">="
117
65
  - !ruby/object:Gem::Version
118
- version: '0'
66
+ version: 2.5.0
119
67
  required_rubygems_version: !ruby/object:Gem::Requirement
120
68
  requirements:
121
- - - ">="
69
+ - - ">"
122
70
  - !ruby/object:Gem::Version
123
- version: '0'
71
+ version: 1.3.1
124
72
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.4.8
73
+ rubygems_version: 3.0.3
127
74
  signing_key:
128
75
  specification_version: 4
129
- summary: allure-cucumber-0.6.1
130
- test_files:
131
- - features/docs/acceptance_tests/dsl_attach_file.feature
132
- - features/docs/acceptance_tests/embed_attach_file.feature
133
- - features/lib/support/aruba.rb
134
- - features/lib/support/env.rb
76
+ summary: Allure cucumber ruby adaptor
77
+ test_files: []
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .idea
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in allure-cucumber.gemspec
4
- gemspec
data/LICENSE DELETED
@@ -1,13 +0,0 @@
1
- Copyright (c) 2014 Imran Khan
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
data/Rakefile DELETED
@@ -1,3 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
3
- task :default => :build
@@ -1,26 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/allure-cucumber/version', __FILE__)
3
-
4
- Gem::Specification.new do |spec|
5
- spec.name = "allure-cucumber"
6
- spec.version = AllureCucumber::Version::STRING
7
- spec.authors = ["Imran Khan"]
8
- spec.email = ["9ikhan@gmail.com"]
9
- spec.summary = "allure-cucumber-#{AllureCucumber::Version::STRING}"
10
- spec.description = %q{Adaptor to use Allure framework with cucumber}
11
- spec.homepage = "http://allure.qatools.ru"
12
- spec.license = "Apache2"
13
-
14
- spec.files = `git ls-files -z`.split("\x0")
15
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
- spec.require_paths = ["lib"]
18
-
19
- spec.add_dependency 'cucumber' , '>= 2.0.0'
20
- spec.add_dependency 'allure-ruby-adaptor-api', '>= 0.7.1'
21
-
22
- spec.add_development_dependency "bundler", "~> 1.5"
23
- spec.add_development_dependency "rake"
24
- spec.add_development_dependency "aruba", '~> 0.14.2'
25
-
26
- end
@@ -1,458 +0,0 @@
1
- @dsl_attach_file
2
- Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all possible cases
3
-
4
- In order to be sure that attaching a file works correctly
5
- I want to verify all possible ways how a file can be attached to Allure report
6
-
7
- Variations how a file can be attached:
8
- by place of 'attach_file' code: [
9
- in a step of Scenario,
10
- in a step of Scenario Outline,
11
- in a step of Background,
12
- in hook 'Before',
13
- in hook 'After',
14
- in Around if call 'attach_file' before block.call,
15
- in Around if call 'attach_file' after block.call
16
- ]
17
-
18
- by using '--expand': [
19
- expand yes,
20
- expand no
21
- ]
22
-
23
- by attach_file's step position: [
24
- first step ,
25
- second step
26
- ]
27
-
28
- Generated combinations for testing using 'pairwise' Ruby gem:
29
-
30
- | by attach_file's step position | by place of 'attach_file' code | by using '--expand' |
31
- | first step | in a step of Scenario | expand yes | @scenario_pw_2_01
32
- | first step | in a step of Scenario Outline | expand no | @scenario_pw_2_02
33
- | first step | in a step of Background | expand no | @scenario_pw_2_03
34
- | first step | in hook 'Before' | expand no | @scenario_pw_2_04
35
- | first step | in hook 'After' | expand no | @scenario_pw_2_05
36
- | first step | in Around if call 'attach_file' before block.call | expand no | @scenario_pw_2_06
37
- | first step | in Around if call 'attach_file' after block.call | expand no | @scenario_pw_2_07
38
- | second step | in a step of Scenario | expand no | @scenario_pw_2_08
39
- | second step | in a step of Scenario Outline | expand yes | @scenario_pw_2_09
40
- | second step | in a step of Background | expand yes | @scenario_pw_2_10
41
- | second step | in hook 'Before' | expand yes | @scenario_pw_2_11
42
- | second step | in hook 'After' | expand yes | @scenario_pw_2_12
43
- | second step | in Around if call 'attach_file' before block.call | expand yes | @scenario_pw_2_13
44
- | second step | in Around if call 'attach_file' after block.call | expand yes | @scenario_pw_2_14
45
-
46
-
47
-
48
- Background:
49
- Given I use a fixture named "minimal_cucumber_app"
50
- Given a file named "features/lib/step_definitions/steps.rb" with:
51
- """
52
- When /^I attach file$/ do
53
- File.write('temp_file', 'some_text')
54
- file = File.open('temp_file')
55
- file.close
56
- attach_file('some_title', file)
57
- end
58
-
59
- Given /^This step is passed$/ do
60
- puts 'This is a message from passed step'
61
- end
62
-
63
- """
64
-
65
- And a file named "features/lib/support/env.rb" with:
66
- """
67
- require 'bundler/setup'
68
- require 'allure-cucumber'
69
-
70
- AllureCucumber.configure do |c|
71
- c.output_dir = "reports"
72
- end
73
-
74
- World(AllureCucumber::DSL)
75
-
76
- """
77
-
78
- @scenario1
79
- @known_defect
80
- Scenario: Should not raise error message if "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameters were not passed.
81
- Given a file named "features/docs/attach_file.feature" with:
82
- """
83
- Feature: title
84
- Scenario: attach_file
85
- When I attach file
86
- """
87
-
88
- When I run `cucumber --expand`
89
- Then the output from "cucumber --expand" should contain "1 scenario (1 passed)"
90
- And the exit status should be 0
91
-
92
- @scenario2
93
- @scenario_pw_2_01
94
- @known_defect
95
- Scenario: Should not put 'Cannot attach...' message if "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified. BUT DOES IT
96
- Given a file named "features/docs/attach_file.feature" with:
97
- """
98
- Feature: title
99
- Scenario: attach_file
100
- When I attach file
101
- """
102
- When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
103
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
104
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
105
- And the exit status should be 0
106
-
107
-
108
- @scenario3
109
- @scenario_pw_2_08
110
- Scenario: Should not be difference how much steps was run before attaching file.
111
- Given a file named "features/docs/attach_file.feature" with:
112
- """
113
- Feature: title
114
- Scenario: attach_file
115
- Given This step is passed
116
- When I attach file
117
- """
118
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
119
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
120
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
121
- And the exit status should be 0
122
-
123
-
124
- @scenario4
125
- @scenario_pw_2_02
126
- @known_defect
127
- Scenario: Should not put 'Cannot attach...' message if file was attached into Scenario outline and "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified. BUT DOES IT
128
- Given a file named "features/docs/attach_file.feature" with:
129
- """
130
- Feature: title
131
- Scenario Outline: attach_file
132
- When I attach file
133
- Examples:
134
- |run_count|
135
- | 1 |
136
- | 2 |
137
-
138
- """
139
- When I run "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty"
140
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
141
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
142
- And the exit status should be 0
143
-
144
-
145
-
146
- # This scenario illustrates an incorrect behaviour for scenario '@scenario4'.
147
- @scenario5
148
- Scenario: Should not be difference how much steps was run before attaching file in Scenario Outline. BUT THE DIFFERENCE IS PRESENT
149
- Given a file named "features/docs/attach_file.feature" with:
150
- """
151
- Feature: title
152
- Scenario Outline: attach_file
153
- Given This step is passed
154
- When I attach file
155
- Examples:
156
- |run_count|
157
- | 1 |
158
- | 2 |
159
-
160
- """
161
- When I run "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty"
162
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
163
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
164
- And the exit status should be 0
165
-
166
-
167
-
168
- @scenario_6
169
- @scenario_pw_2_03
170
- @known_defect
171
- Scenario: Should not put 'Cannot attach...' if file was attached into Background's step and "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
172
- Given a file named "features/docs/attach_file.feature" with:
173
- """
174
- Feature: title
175
- Background:
176
- When I attach file
177
-
178
- Scenario: attach_file
179
- Given This step is passed
180
- """
181
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
182
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
183
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
184
- And the exit status should be 0
185
-
186
-
187
- @scenario_7
188
- @scenario_pw_2_04
189
- @known_defect
190
- Scenario: Should not put 'Cannot attach...' if file was attached in hook Before and "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
191
- Given a file named "features/docs/attach_file.feature" with:
192
- """
193
- Feature: title
194
- Scenario: attach_file
195
- Given This step is passed
196
- """
197
- And a file named "features/lib/support/hooks.rb" with:
198
- """
199
- Before do
200
- File.write('temp_file', 'some_text')
201
- file = File.open('temp_file')
202
- file.close
203
- attach_file('some_title', file)
204
-
205
- end
206
- """
207
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
208
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
209
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
210
- And the exit status should be 0
211
-
212
- @scenario_8
213
- @scenario_pw_2_05
214
- Scenario: Should not put 'Cannot attach...' if file was attached in hook After and "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
215
- Given a file named "features/docs/attach_file.feature" with:
216
- """
217
- Feature: title
218
- Scenario: attach_file
219
- Given This step is passed
220
- """
221
- And a file named "features/lib/support/hooks.rb" with:
222
- """
223
- After do
224
- File.write('temp_file', 'some_text')
225
- file = File.open('temp_file')
226
- file.close
227
- attach_file('some_title', file)
228
-
229
- end
230
- """
231
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
232
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
233
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
234
- And the exit status should be 0
235
-
236
-
237
- @scenario_9
238
- @scenario_pw_2_07
239
- Scenario: Should not put 'Cannot attach...' if file was attached in hook Around when 'attach_file' is called AFTER 'block.call' and "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
240
- Given a file named "features/docs/attach_file.feature" with:
241
- """
242
- Feature: title
243
- Scenario: attach_file
244
- Given This step is passed
245
- """
246
- And a file named "features/lib/support/hooks.rb" with:
247
- """
248
- Around do |scenario, block|
249
- block.call
250
- File.write('temp_file', 'some_text')
251
- file = File.open('temp_file')
252
- file.close
253
- attach_file('some_title', file)
254
-
255
- end
256
- """
257
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
258
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
259
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
260
- And the exit status should be 0
261
-
262
-
263
- @scenario_10
264
- @scenario_pw_2_06
265
- @known_defect
266
- Scenario: Should not put 'Cannot attach...' if file was attached in hook Around when 'attach_file' is called BEFORE 'block.call' and "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
267
- Given a file named "features/docs/attach_file.feature" with:
268
- """
269
- Feature: title
270
- Scenario: attach_file
271
- Given This step is passed
272
- """
273
- And a file named "features/lib/support/hooks.rb" with:
274
- """
275
- Around do |scenario, block|
276
- File.write('temp_file', 'some_text')
277
- file = File.open('temp_file')
278
- file.close
279
- attach_file('some_title', file)
280
- block.call
281
- end
282
- """
283
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
284
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
285
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
286
- And the exit status should be 0
287
-
288
- @scenario_11
289
- @scenario_pw_2_09
290
- @known_defect
291
- Scenario: Should not put 'Cannot attach...' message if file was attached into second step of Scenario Outline and "--expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
292
- Given a file named "features/docs/attach_file.feature" with:
293
- """
294
- Feature: title
295
- Scenario Outline: attach_file
296
- Given This step is passed
297
- When I attach file
298
- Examples:
299
- |run_count|
300
- | 1 |
301
- | 2 |
302
-
303
- """
304
- When I run "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty"
305
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
306
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
307
- And the exit status should be 0
308
-
309
- @scenario_12
310
- @scenario_pw_2_10
311
- @known_defect
312
- Scenario: Should not put 'Cannot attach...' if file was attached into Background's second step and "--expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
313
- Given a file named "features/docs/attach_file.feature" with:
314
- """
315
- Feature: title
316
- Background:
317
- Given This step is passed
318
- And I attach file
319
-
320
- Scenario: attach_file
321
- Given This step is passed
322
- """
323
- When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
324
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
325
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
326
- And the exit status should be 0
327
-
328
-
329
- @scenario_13
330
- @scenario_pw_2_11
331
- @known_defect
332
- Scenario: Should not put 'Cannot attach...' if file was attached in hook Before and "--expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
333
- Given a file named "features/docs/attach_file.feature" with:
334
- """
335
- Feature: title
336
- Scenario: attach_file
337
- Given This step is passed
338
- """
339
- And a file named "features/lib/support/hooks.rb" with:
340
- """
341
- Before do
342
- File.write('temp_file', 'some_text')
343
- file = File.open('temp_file')
344
- file.close
345
- attach_file('some_title', file)
346
-
347
- end
348
- """
349
- When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
350
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
351
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
352
- And the exit status should be 0
353
-
354
-
355
- @scenario_14
356
- @scenario_pw_2_12
357
- Scenario: Should not put 'Cannot attach...' if file was attached in hook After and "--expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
358
- Given a file named "features/docs/attach_file.feature" with:
359
- """
360
- Feature: title
361
- Scenario: attach_file
362
- Given This step is passed
363
- """
364
- And a file named "features/lib/support/hooks.rb" with:
365
- """
366
- After do
367
- File.write('temp_file', 'some_text')
368
- file = File.open('temp_file')
369
- file.close
370
- attach_file('some_title', file)
371
-
372
- end
373
- """
374
- When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
375
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
376
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
377
- And the exit status should be 0
378
-
379
-
380
- @scenario_15
381
- @scenario_pw_2_14
382
- Scenario: Should not put 'Cannot attach...' if file was attached in hook Around when 'attach_file' is called AFTER 'block.call' and "--expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
383
- Given a file named "features/docs/attach_file.feature" with:
384
- """
385
- Feature: title
386
- Scenario: attach_file
387
- Given This step is passed
388
- """
389
- And a file named "features/lib/support/hooks.rb" with:
390
- """
391
- Around do |scenario, block|
392
- block.call
393
- File.write('temp_file', 'some_text')
394
- file = File.open('temp_file')
395
- file.close
396
- attach_file('some_title', file)
397
-
398
- end
399
- """
400
- When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
401
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
402
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
403
- And the exit status should be 0
404
-
405
-
406
-
407
- @scenario_16
408
- @scenario_pw_2_13
409
- @known_defect
410
- Scenario: Should not put 'Cannot attach...' if file was attached in hook Around when 'attach_file' is called BEFORE 'block.call' and "--expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified.
411
- Given a file named "features/docs/attach_file.feature" with:
412
- """
413
- Feature: title
414
- Scenario: attach_file
415
- Given This step is passed
416
- """
417
- And a file named "features/lib/support/hooks.rb" with:
418
- """
419
- Around do |scenario, block|
420
- File.write('temp_file', 'some_text')
421
- file = File.open('temp_file')
422
- file.close
423
- attach_file('some_title', file)
424
- block.call
425
- end
426
- """
427
- When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
428
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
429
- Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
430
- And the exit status should be 0
431
-
432
-
433
- @scenario_17
434
- Scenario: Should not fail if Scenario Outline was run and then Scenario where a file was attached
435
- Given a file named "features/docs/01_attach_file.feature" with:
436
- """
437
- Feature: title
438
-
439
- Scenario Outline: first outline
440
- Given I attach file
441
-
442
- Examples:
443
- | run_number |
444
- | 1 |
445
-
446
- """
447
- Given a file named "features/docs/02_attach_file.feature" with:
448
- """
449
- Feature: title
450
- Scenario: second scenario
451
- Given I attach file
452
-
453
- """
454
-
455
- When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
456
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "undefined method `[]' for nil:NilClass (NoMethodError)"
457
- Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
458
- And the exit status should be 0