allure-cucumber 0.6.1 → 2.10.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,460 +0,0 @@
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