allure-cucumber 0.5.8 → 0.6.0

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
  SHA1:
3
- metadata.gz: 6f97bda72289702d62c88bce96cd1e84eab6e065
4
- data.tar.gz: f1ab2dfbec3c25a134621a756c8e7ce3289f1122
3
+ metadata.gz: c81ea31ccf6e9c613cb612c3c842a02c54434803
4
+ data.tar.gz: 6dda18dc589e6e9da900eaeb7d7e37846e45f35e
5
5
  SHA512:
6
- metadata.gz: 4858c91721f5ea6c224e050ff4bfe2e1c8520f8ed30eb3ea7cbb974b9d68997e7101f5fc2e8db5a50e6dba72115a054c8cfc6d9753e505a0ee23ac8ba3b18d1b
7
- data.tar.gz: 58b3e4ad28c151c2ce4fbb3b7e9d1502b74e1c3166ae7d81a168f96fd29da8878a3f7732b1d0dd9d3cfbc0b99c581fe21e75da4e083243fd617028134cd48a81
6
+ metadata.gz: 9eab28b2fcbcb2cd861eb85a59ea60cf3ae0bd937b989a7c8b4aad601b4ad4ae515b122f30466059b6da0733d76b0e85257098e0471b9bd49dd01907240ab593
7
+ data.tar.gz: cf14553b4e7530394e324f72b7461124aa0cbd8c5e449bf59168602f15eaf172110d76c67482ec2aa74f6248b75a6560e2a07a388796d5d3bcb42c05337dcc5f
@@ -1,4 +1,3 @@
1
- @feature1
2
1
  @dsl_attach_file
3
2
  Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all possible cases
4
3
 
@@ -77,7 +76,8 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
77
76
  """
78
77
 
79
78
  @scenario1
80
- Scenario: Should not raise error message if "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameters were not passed. BUT DOES IT
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
81
  Given a file named "features/docs/attach_file.feature" with:
82
82
  """
83
83
  Feature: title
@@ -91,6 +91,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
91
91
 
92
92
  @scenario2
93
93
  @scenario_pw_2_01
94
+ @known_defect
94
95
  Scenario: Should not put 'Cannot attach...' message if "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified. BUT DOES IT
95
96
  Given a file named "features/docs/attach_file.feature" with:
96
97
  """
@@ -104,10 +105,9 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
104
105
  And the exit status should be 0
105
106
 
106
107
 
107
- # This scenario illustrates an incorrect behaviour for scenario '@scenario2'.
108
108
  @scenario3
109
109
  @scenario_pw_2_08
110
- Scenario: Should not be difference how much steps was run before attaching file. BUT THE DIFFERENCE IS PRESENT
110
+ Scenario: Should not be difference how much steps was run before attaching file.
111
111
  Given a file named "features/docs/attach_file.feature" with:
112
112
  """
113
113
  Feature: title
@@ -167,6 +167,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
167
167
 
168
168
  @scenario_6
169
169
  @scenario_pw_2_03
170
+ @known_defect
170
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.
171
172
  Given a file named "features/docs/attach_file.feature" with:
172
173
  """
@@ -185,6 +186,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
185
186
 
186
187
  @scenario_7
187
188
  @scenario_pw_2_04
189
+ @known_defect
188
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.
189
191
  Given a file named "features/docs/attach_file.feature" with:
190
192
  """
@@ -260,6 +262,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
260
262
 
261
263
  @scenario_10
262
264
  @scenario_pw_2_06
265
+ @known_defect
263
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.
264
267
  Given a file named "features/docs/attach_file.feature" with:
265
268
  """
@@ -305,6 +308,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
305
308
 
306
309
  @scenario_12
307
310
  @scenario_pw_2_10
311
+ @known_defect
308
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.
309
313
  Given a file named "features/docs/attach_file.feature" with:
310
314
  """
@@ -324,6 +328,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
324
328
 
325
329
  @scenario_13
326
330
  @scenario_pw_2_11
331
+ @known_defect
327
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.
328
333
  Given a file named "features/docs/attach_file.feature" with:
329
334
  """
@@ -401,6 +406,7 @@ Feature: "AllureCucumber::DSL#attach_file' method should work correctly in all p
401
406
 
402
407
  @scenario_16
403
408
  @scenario_pw_2_13
409
+ @known_defect
404
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.
405
411
  Given a file named "features/docs/attach_file.feature" with:
406
412
  """
@@ -0,0 +1,460 @@
1
+ @embed_attach_file
2
+ Feature: "AllureCucumber::Formatter#embed' method should work correctly in all possible cases
3
+
4
+
5
+ In order to be sure that attaching a file works correctly
6
+ I want to verify all possible ways how a file can be attached to Allure report
7
+
8
+ Variations how a file can be attached:
9
+ by place of 'attach_file' code: [
10
+ in a step of Scenario,
11
+ in a step of Scenario Outline,
12
+ in a step of Background,
13
+ in hook 'Before',
14
+ in hook 'After',
15
+ in Around if call 'attach_file' before block.call,
16
+ in Around if call 'attach_file' after block.call
17
+ ]
18
+
19
+ by using '--expand': [
20
+ expand yes,
21
+ expand no
22
+ ]
23
+
24
+ by attach_file's step position: [
25
+ first step ,
26
+ second step
27
+ ]
28
+
29
+ Generated combinations for testing using 'pairwise' Ruby gem:
30
+
31
+ | by attach_file's step position | by place of 'attach_file' code | by using '--expand' |
32
+ | first step | in a step of Scenario | expand yes | @scenario_pw_2_01
33
+ | first step | in a step of Scenario Outline | expand no | @scenario_pw_2_02
34
+ | first step | in a step of Background | expand no | @scenario_pw_2_03
35
+ | first step | in hook 'Before' | expand no | @scenario_pw_2_04
36
+ | first step | in hook 'After' | expand no | @scenario_pw_2_05
37
+ | first step | in Around if call 'attach_file' before block.call | expand no | @scenario_pw_2_06
38
+ | first step | in Around if call 'attach_file' after block.call | expand no | @scenario_pw_2_07
39
+ | second step | in a step of Scenario | expand no | @scenario_pw_2_08
40
+ | second step | in a step of Scenario Outline | expand yes | @scenario_pw_2_09
41
+ | second step | in a step of Background | expand yes | @scenario_pw_2_10
42
+ | second step | in hook 'Before' | expand yes | @scenario_pw_2_11
43
+ | second step | in hook 'After' | expand yes | @scenario_pw_2_12
44
+ | second step | in Around if call 'attach_file' before block.call | expand yes | @scenario_pw_2_13
45
+ | second step | in Around if call 'attach_file' after block.call | expand yes | @scenario_pw_2_14
46
+
47
+
48
+
49
+ Background:
50
+ Given I use a fixture named "minimal_cucumber_app"
51
+ Given a file named "features/lib/step_definitions/steps.rb" with:
52
+ """
53
+ When /^I attach file using embed$/ do
54
+ File.write('temp_file', 'some_text')
55
+ file = File.open('temp_file')
56
+ file.close
57
+ embed(file, 'not_used_param', 'some_title')
58
+ end
59
+
60
+ Given /^This step is passed$/ do
61
+ puts 'This is a message from passed step'
62
+ end
63
+
64
+ """
65
+
66
+ And a file named "features/lib/support/env.rb" with:
67
+ """
68
+ require 'bundler/setup'
69
+ require 'allure-cucumber'
70
+
71
+ AllureCucumber.configure do |c|
72
+ c.output_dir = "reports"
73
+ end
74
+
75
+ World(AllureCucumber::DSL)
76
+
77
+ """
78
+
79
+
80
+
81
+
82
+ @scenario1
83
+ Scenario: Should not raise error message if "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameters were not passed. BUT DOES IT
84
+ Given a file named "features/docs/attach_file.feature" with:
85
+ """
86
+ Feature: title
87
+ Scenario: attach_file
88
+ When I attach file using embed
89
+ """
90
+
91
+ When I run `cucumber --expand`
92
+ Then the output from "cucumber --expand" should contain "1 scenario (1 passed)"
93
+ And the exit status should be 0
94
+
95
+ @scenario2
96
+ @scenario_pw_2_01
97
+ Scenario: Should not put 'Cannot attach...' message if "--format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" parameter was specified. BUT DOES IT
98
+ Given a file named "features/docs/attach_file.feature" with:
99
+ """
100
+ Feature: title
101
+ Scenario: attach_file
102
+ When I attach file using embed
103
+ """
104
+ When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
105
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
106
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
107
+ And the exit status should be 0
108
+
109
+
110
+ @scenario3
111
+ @scenario_pw_2_08
112
+ Scenario: Should not be difference how much steps was run before attaching file.
113
+ Given a file named "features/docs/attach_file.feature" with:
114
+ """
115
+ Feature: title
116
+ Scenario: attach_file
117
+ Given This step is passed
118
+ When I attach file using embed
119
+ """
120
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
121
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
122
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
123
+ And the exit status should be 0
124
+
125
+
126
+ @scenario4
127
+ @scenario_pw_2_02
128
+ 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
129
+ Given a file named "features/docs/attach_file.feature" with:
130
+ """
131
+ Feature: title
132
+ Scenario Outline: attach_file
133
+ When I attach file using embed
134
+ Examples:
135
+ |run_count|
136
+ | 1 |
137
+ | 2 |
138
+
139
+ """
140
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
141
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
142
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
143
+ And the exit status should be 0
144
+
145
+
146
+
147
+ # This scenario illustrates an incorrect behaviour for scenario '@scenario4'.
148
+ @scenario5
149
+ Scenario: Should not be difference how much steps was run before attaching file in Scenario Outline. BUT THE DIFFERENCE IS PRESENT
150
+ Given a file named "features/docs/attach_file.feature" with:
151
+ """
152
+ Feature: title
153
+ Scenario Outline: attach_file
154
+ Given This step is passed
155
+ When I attach file using embed
156
+ Examples:
157
+ |run_count|
158
+ | 1 |
159
+ | 2 |
160
+
161
+ """
162
+ When I run "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty"
163
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
164
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
165
+ And the exit status should be 0
166
+
167
+
168
+
169
+ @scenario_6
170
+ @scenario_pw_2_03
171
+ @known_defect
172
+ 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.
173
+ Given a file named "features/docs/attach_file.feature" with:
174
+ """
175
+ Feature: title
176
+ Background:
177
+ When I attach file using embed
178
+
179
+ Scenario: attach_file
180
+ Given This step is passed
181
+ """
182
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
183
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
184
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
185
+ And the exit status should be 0
186
+
187
+
188
+ @scenario_7
189
+ @scenario_pw_2_04
190
+ @known_defect
191
+ 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.
192
+ Given a file named "features/docs/attach_file.feature" with:
193
+ """
194
+ Feature: title
195
+ Scenario: attach_file
196
+ Given This step is passed
197
+ """
198
+ And a file named "features/lib/support/hooks.rb" with:
199
+ """
200
+ Before do
201
+ File.write('temp_file', 'some_text')
202
+ file = File.open('temp_file')
203
+ file.close
204
+ embed(file, 'not_used_param', 'some_title')
205
+
206
+ end
207
+ """
208
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
209
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
210
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
211
+ And the exit status should be 0
212
+
213
+ @scenario_8
214
+ @scenario_pw_2_05
215
+ 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.
216
+ Given a file named "features/docs/attach_file.feature" with:
217
+ """
218
+ Feature: title
219
+ Scenario: attach_file
220
+ Given This step is passed
221
+ """
222
+ And a file named "features/lib/support/hooks.rb" with:
223
+ """
224
+ After do
225
+ File.write('temp_file', 'some_text')
226
+ file = File.open('temp_file')
227
+ file.close
228
+ embed(file, 'not_used_param', 'some_title')
229
+
230
+ end
231
+ """
232
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
233
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
234
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
235
+ And the exit status should be 0
236
+
237
+
238
+ @scenario_9
239
+ @scenario_pw_2_07
240
+ 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.
241
+ Given a file named "features/docs/attach_file.feature" with:
242
+ """
243
+ Feature: title
244
+ Scenario: attach_file
245
+ Given This step is passed
246
+ """
247
+ And a file named "features/lib/support/hooks.rb" with:
248
+ """
249
+ Around do |scenario, block|
250
+ block.call
251
+ File.write('temp_file', 'some_text')
252
+ file = File.open('temp_file')
253
+ file.close
254
+ embed(file, 'not_used_param', 'some_title')
255
+
256
+ end
257
+ """
258
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
259
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
260
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
261
+ And the exit status should be 0
262
+
263
+
264
+ @scenario_10
265
+ @scenario_pw_2_06
266
+ @known_defect
267
+ 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.
268
+ Given a file named "features/docs/attach_file.feature" with:
269
+ """
270
+ Feature: title
271
+ Scenario: attach_file
272
+ Given This step is passed
273
+ """
274
+ And a file named "features/lib/support/hooks.rb" with:
275
+ """
276
+ Around do |scenario, block|
277
+ File.write('temp_file', 'some_text')
278
+ file = File.open('temp_file')
279
+ file.close
280
+ embed(file, 'not_used_param', 'some_title')
281
+ block.call
282
+ end
283
+ """
284
+ When I run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
285
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
286
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
287
+ And the exit status should be 0
288
+
289
+ @scenario_11
290
+ @scenario_pw_2_09
291
+ @known_defect
292
+ 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.
293
+ Given a file named "features/docs/attach_file.feature" with:
294
+ """
295
+ Feature: title
296
+ Scenario Outline: attach_file
297
+ Given This step is passed
298
+ When I attach file using embed
299
+ Examples:
300
+ |run_count|
301
+ | 1 |
302
+ | 2 |
303
+
304
+ """
305
+ When I run "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty"
306
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
307
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "2 scenarios (2 passed)"
308
+ And the exit status should be 0
309
+
310
+ @scenario_12
311
+ @scenario_pw_2_10
312
+ @known_defect
313
+ 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.
314
+ Given a file named "features/docs/attach_file.feature" with:
315
+ """
316
+ Feature: title
317
+ Background:
318
+ Given This step is passed
319
+ And I attach file using embed
320
+
321
+ Scenario: attach_file
322
+ Given This step is passed
323
+ """
324
+ When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
325
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
326
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
327
+ And the exit status should be 0
328
+
329
+
330
+ @scenario_13
331
+ @scenario_pw_2_11
332
+ @known_defect
333
+ 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.
334
+ Given a file named "features/docs/attach_file.feature" with:
335
+ """
336
+ Feature: title
337
+ Scenario: attach_file
338
+ Given This step is passed
339
+ """
340
+ And a file named "features/lib/support/hooks.rb" with:
341
+ """
342
+ Before do
343
+ File.write('temp_file', 'some_text')
344
+ file = File.open('temp_file')
345
+ file.close
346
+ embed(file, 'not_used_param', 'some_title')
347
+
348
+ end
349
+ """
350
+ When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
351
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
352
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
353
+ And the exit status should be 0
354
+
355
+
356
+ @scenario_14
357
+ @scenario_pw_2_12
358
+ 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.
359
+ Given a file named "features/docs/attach_file.feature" with:
360
+ """
361
+ Feature: title
362
+ Scenario: attach_file
363
+ Given This step is passed
364
+ """
365
+ And a file named "features/lib/support/hooks.rb" with:
366
+ """
367
+ After do
368
+ File.write('temp_file', 'some_text')
369
+ file = File.open('temp_file')
370
+ file.close
371
+ embed(file, 'not_used_param', 'some_title')
372
+
373
+ end
374
+ """
375
+ When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
376
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
377
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
378
+ And the exit status should be 0
379
+
380
+
381
+ @scenario_15
382
+ @scenario_pw_2_14
383
+ 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.
384
+ Given a file named "features/docs/attach_file.feature" with:
385
+ """
386
+ Feature: title
387
+ Scenario: attach_file
388
+ Given This step is passed
389
+ """
390
+ And a file named "features/lib/support/hooks.rb" with:
391
+ """
392
+ Around do |scenario, block|
393
+ block.call
394
+ File.write('temp_file', 'some_text')
395
+ file = File.open('temp_file')
396
+ file.close
397
+ embed(file, 'not_used_param', 'some_title')
398
+
399
+ end
400
+ """
401
+ When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
402
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
403
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
404
+ And the exit status should be 0
405
+
406
+
407
+
408
+ @scenario_16
409
+ @scenario_pw_2_13
410
+ @known_defect
411
+ 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.
412
+ Given a file named "features/docs/attach_file.feature" with:
413
+ """
414
+ Feature: title
415
+ Scenario: attach_file
416
+ Given This step is passed
417
+ """
418
+ And a file named "features/lib/support/hooks.rb" with:
419
+ """
420
+ Around do |scenario, block|
421
+ File.write('temp_file', 'some_text')
422
+ file = File.open('temp_file')
423
+ file.close
424
+ embed(file, 'not_used_param', 'some_title')
425
+ block.call
426
+ end
427
+ """
428
+ When I run `cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
429
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
430
+ Then the output from "cucumber --expand --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "1 scenario (1 passed)"
431
+ And the exit status should be 0
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 This step is passed
441
+
442
+ Examples:
443
+ | run_number |
444
+ | 1 |
445
+ | 2 |
446
+ """
447
+ Given a file named "features/docs/02_attach_file.feature" with:
448
+ """
449
+ Feature: title
450
+ Scenario: second scenario
451
+ Given This step is passed
452
+ And I attach file using embed
453
+
454
+ """
455
+
456
+ When I successfully run `cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty`
457
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "Cannot attach"
458
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should not contain "undefined method `[]' for nil:NilClass (NoMethodError)"
459
+ Then the output from "cucumber --format AllureCucumber::Formatter --out reports/allure-report/ --format pretty" should contain "3 scenarios (3 passed)"
460
+ And the exit status should be 0
@@ -154,7 +154,13 @@ module AllureCucumber
154
154
  def after_multiline_arg(multiline_arg)
155
155
  @in_multiline_arg = false
156
156
  end
157
-
157
+
158
+ def embed(src, mime_type, label)
159
+ file = File.open(src)
160
+ file.close
161
+ attach_file(label, file)
162
+ end
163
+
158
164
  private
159
165
 
160
166
  def remove_tag_prefix(tag, prefix)
@@ -1,5 +1,5 @@
1
1
  module AllureCucumber
2
2
  module Version
3
- STRING = '0.5.8'
3
+ STRING = '0.6.0'
4
4
  end
5
5
  end
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: 0.5.8
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Imran Khan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-23 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -94,6 +94,7 @@ files:
94
94
  - Rakefile
95
95
  - allure-cucumber.gemspec
96
96
  - features/docs/acceptance_tests/dsl_attach_file.feature
97
+ - features/docs/acceptance_tests/embed_attach_file.feature
97
98
  - features/lib/support/aruba.rb
98
99
  - features/lib/support/env.rb
99
100
  - fixtures/minimal_cucumber_app/features/lib/support/env.rb
@@ -125,8 +126,9 @@ rubyforge_project:
125
126
  rubygems_version: 2.4.8
126
127
  signing_key:
127
128
  specification_version: 4
128
- summary: allure-cucumber-0.5.8
129
+ summary: allure-cucumber-0.6.0
129
130
  test_files:
130
131
  - features/docs/acceptance_tests/dsl_attach_file.feature
132
+ - features/docs/acceptance_tests/embed_attach_file.feature
131
133
  - features/lib/support/aruba.rb
132
134
  - features/lib/support/env.rb