cucumber-messages 22.0.0 → 27.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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +2 -2
  3. data/README.md +1 -0
  4. data/VERSION +1 -1
  5. data/lib/cucumber/messages/attachment.rb +131 -0
  6. data/lib/cucumber/messages/attachment_content_encoding.rb +11 -0
  7. data/lib/cucumber/messages/background.rb +64 -0
  8. data/lib/cucumber/messages/ci.rb +62 -0
  9. data/lib/cucumber/messages/comment.rb +50 -0
  10. data/lib/cucumber/messages/data_table.rb +41 -0
  11. data/lib/cucumber/messages/doc_string.rb +51 -0
  12. data/lib/cucumber/messages/duration.rb +50 -0
  13. data/lib/cucumber/messages/envelope.rb +134 -0
  14. data/lib/cucumber/messages/examples.rb +74 -0
  15. data/lib/cucumber/messages/exception.rb +57 -0
  16. data/lib/cucumber/messages/feature.rb +87 -0
  17. data/lib/cucumber/messages/feature_child.rb +49 -0
  18. data/lib/cucumber/messages/gherkin_document.rb +62 -0
  19. data/lib/cucumber/messages/git.rb +54 -0
  20. data/lib/cucumber/messages/group.rb +46 -0
  21. data/lib/cucumber/messages/helpers/id_generator/incrementing.rb +20 -0
  22. data/lib/cucumber/messages/helpers/id_generator/uuid.rb +17 -0
  23. data/lib/cucumber/messages/helpers/id_generator.rb +4 -0
  24. data/lib/cucumber/messages/helpers/ndjson_to_message_enumerator.rb +30 -0
  25. data/lib/cucumber/messages/helpers/time_conversion.rb +31 -0
  26. data/lib/cucumber/messages/hook.rb +56 -0
  27. data/lib/cucumber/messages/hook_type.rb +15 -0
  28. data/lib/cucumber/messages/java_method.rb +46 -0
  29. data/lib/cucumber/messages/java_stack_trace_element.rb +46 -0
  30. data/lib/cucumber/messages/location.rb +44 -0
  31. data/lib/cucumber/messages/message.rb +93 -5
  32. data/lib/cucumber/messages/meta.rb +81 -0
  33. data/lib/cucumber/messages/parameter_type.rb +64 -0
  34. data/lib/cucumber/messages/parse_error.rb +41 -0
  35. data/lib/cucumber/messages/pickle.rb +107 -0
  36. data/lib/cucumber/messages/pickle_doc_string.rb +41 -0
  37. data/lib/cucumber/messages/pickle_step.rb +71 -0
  38. data/lib/cucumber/messages/pickle_step_argument.rb +43 -0
  39. data/lib/cucumber/messages/pickle_step_type.rb +13 -0
  40. data/lib/cucumber/messages/pickle_table.rb +36 -0
  41. data/lib/cucumber/messages/pickle_table_cell.rb +36 -0
  42. data/lib/cucumber/messages/pickle_table_row.rb +36 -0
  43. data/lib/cucumber/messages/pickle_tag.rb +47 -0
  44. data/lib/cucumber/messages/product.rb +49 -0
  45. data/lib/cucumber/messages/rule.rb +72 -0
  46. data/lib/cucumber/messages/rule_child.rb +44 -0
  47. data/lib/cucumber/messages/scenario.rb +74 -0
  48. data/lib/cucumber/messages/source.rb +63 -0
  49. data/lib/cucumber/messages/source_media_type.rb +11 -0
  50. data/lib/cucumber/messages/source_reference.rb +55 -0
  51. data/lib/cucumber/messages/step.rb +80 -0
  52. data/lib/cucumber/messages/step_definition.rb +46 -0
  53. data/lib/cucumber/messages/step_definition_pattern.rb +41 -0
  54. data/lib/cucumber/messages/step_definition_pattern_type.rb +11 -0
  55. data/lib/cucumber/messages/step_keyword_type.rb +14 -0
  56. data/lib/cucumber/messages/step_match_argument.rb +54 -0
  57. data/lib/cucumber/messages/step_match_arguments_list.rb +36 -0
  58. data/lib/cucumber/messages/table_cell.rb +49 -0
  59. data/lib/cucumber/messages/table_row.rb +54 -0
  60. data/lib/cucumber/messages/tag.rb +58 -0
  61. data/lib/cucumber/messages/test_case.rb +62 -0
  62. data/lib/cucumber/messages/test_case_finished.rb +46 -0
  63. data/lib/cucumber/messages/test_case_started.rb +69 -0
  64. data/lib/cucumber/messages/test_run_finished.rb +68 -0
  65. data/lib/cucumber/messages/test_run_hook_finished.rb +49 -0
  66. data/lib/cucumber/messages/test_run_hook_started.rb +60 -0
  67. data/lib/cucumber/messages/test_run_started.rb +41 -0
  68. data/lib/cucumber/messages/test_step.rb +74 -0
  69. data/lib/cucumber/messages/test_step_finished.rb +51 -0
  70. data/lib/cucumber/messages/test_step_result.rb +57 -0
  71. data/lib/cucumber/messages/test_step_result_status.rb +16 -0
  72. data/lib/cucumber/messages/test_step_started.rb +46 -0
  73. data/lib/cucumber/messages/timestamp.rb +52 -0
  74. data/lib/cucumber/messages/undefined_parameter_type.rb +41 -0
  75. data/lib/cucumber/messages.rb +9 -5
  76. metadata +140 -61
  77. data/lib/cucumber/messages/id_generator.rb +0 -24
  78. data/lib/cucumber/messages/message/deserialization.rb +0 -39
  79. data/lib/cucumber/messages/message/serialization.rb +0 -73
  80. data/lib/cucumber/messages/message/utils.rb +0 -46
  81. data/lib/cucumber/messages/ndjson_to_message_enumerator.rb +0 -21
  82. data/lib/cucumber/messages/time_conversion.rb +0 -33
  83. data/lib/cucumber/messages.deserializers.rb +0 -1207
  84. data/lib/cucumber/messages.dtos.rb +0 -2000
  85. data/spec/capture_warnings.rb +0 -74
  86. data/spec/cucumber/messages/acceptance_spec.rb +0 -33
  87. data/spec/cucumber/messages/id_generator_spec.rb +0 -29
  88. data/spec/cucumber/messages/message/deserialization_spec.rb +0 -30
  89. data/spec/cucumber/messages/message/dummy_messages.rb +0 -38
  90. data/spec/cucumber/messages/message/serialization_spec.rb +0 -89
  91. data/spec/cucumber/messages/message/utils_spec.rb +0 -30
  92. data/spec/cucumber/messages/ndjson_serialization_spec.rb +0 -56
  93. data/spec/cucumber/messages/time_conversion_spec.rb +0 -41
  94. data/spec/cucumber/messages/version_spec.rb +0 -11
@@ -1,2000 +0,0 @@
1
- require 'cucumber/messages/message'
2
-
3
- # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/jsonschema/scripts/codegen.rb]
4
- #
5
-
6
- module Cucumber
7
- module Messages
8
-
9
-
10
- ##
11
- # Represents the Attachment message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
12
- #
13
- # //// Attachments (parse errors, execution errors, screenshots, links...)
14
- #
15
- # *
16
- # An attachment represents any kind of data associated with a line in a
17
- # [Source](#io.cucumber.messages.Source) file. It can be used for:
18
- #
19
- # * Syntax errors during parse time
20
- # * Screenshots captured and attached during execution
21
- # * Logs captured and attached during execution
22
- #
23
- # It is not to be used for runtime errors raised/thrown during execution. This
24
- # is captured in `TestResult`.
25
- #
26
-
27
- class Attachment < ::Cucumber::Messages::Message
28
-
29
- ##
30
- # *
31
- # The body of the attachment. If `contentEncoding` is `IDENTITY`, the attachment
32
- # is simply the string. If it's `BASE64`, the string should be Base64 decoded to
33
- # obtain the attachment.
34
-
35
- attr_reader :body
36
-
37
- ##
38
- # *
39
- # Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
40
- #
41
- # Content encoding is *not* determined by the media type, but rather by the type
42
- # of the object being attached:
43
- #
44
- # - string: IDENTITY
45
- # - byte array: BASE64
46
- # - stream: BASE64
47
-
48
- attr_reader :content_encoding
49
-
50
- ##
51
- # *
52
- # Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
53
-
54
- attr_reader :file_name
55
-
56
- ##
57
- # *
58
- # The media type of the data. This can be any valid
59
- # [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
60
- # as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
61
- # and `text/x.cucumber.stacktrace+plain`
62
-
63
- attr_reader :media_type
64
-
65
- attr_reader :source
66
-
67
- attr_reader :test_case_started_id
68
-
69
- attr_reader :test_step_id
70
-
71
- ##
72
- # *
73
- # A URL where the attachment can be retrieved. This field should not be set by Cucumber.
74
- # It should be set by a program that reads a message stream and does the following for
75
- # each Attachment message:
76
- #
77
- # - Writes the body (after base64 decoding if necessary) to a new file.
78
- # - Sets `body` and `contentEncoding` to `null`
79
- # - Writes out the new attachment message
80
- #
81
- # This will result in a smaller message stream, which can improve performance and
82
- # reduce bandwidth of message consumers. It also makes it easier to process and download attachments
83
- # separately from reports.
84
-
85
- attr_reader :url
86
-
87
- def initialize(
88
- body: '',
89
- content_encoding: AttachmentContentEncoding::IDENTITY,
90
- file_name: nil,
91
- media_type: '',
92
- source: nil,
93
- test_case_started_id: nil,
94
- test_step_id: nil,
95
- url: nil
96
- )
97
- @body = body
98
- @content_encoding = content_encoding
99
- @file_name = file_name
100
- @media_type = media_type
101
- @source = source
102
- @test_case_started_id = test_case_started_id
103
- @test_step_id = test_step_id
104
- @url = url
105
- end
106
- end
107
-
108
-
109
- ##
110
- # Represents the Duration message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
111
- #
112
- # The structure is pretty close of the Timestamp one. For clarity, a second type
113
- # of message is used.
114
- #
115
-
116
- class Duration < ::Cucumber::Messages::Message
117
-
118
- attr_reader :seconds
119
-
120
- ##
121
- # Non-negative fractions of a second at nanosecond resolution. Negative
122
- # second values with fractions must still have non-negative nanos values
123
- # that count forward in time. Must be from 0 to 999,999,999
124
- # inclusive.
125
-
126
- attr_reader :nanos
127
-
128
- def initialize(
129
- seconds: 0,
130
- nanos: 0
131
- )
132
- @seconds = seconds
133
- @nanos = nanos
134
- end
135
- end
136
-
137
-
138
- ##
139
- # Represents the Envelope message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
140
- #
141
- # When removing a field, replace it with reserved, rather than deleting the line.
142
- # When adding a field, add it to the end and increment the number by one.
143
- # See https://developers.google.com/protocol-buffers/docs/proto#updating for details
144
- #
145
- # *
146
- # All the messages that are passed between different components/processes are Envelope
147
- # messages.
148
- #
149
-
150
- class Envelope < ::Cucumber::Messages::Message
151
-
152
- attr_reader :attachment
153
-
154
- attr_reader :gherkin_document
155
-
156
- attr_reader :hook
157
-
158
- attr_reader :meta
159
-
160
- attr_reader :parameter_type
161
-
162
- attr_reader :parse_error
163
-
164
- attr_reader :pickle
165
-
166
- attr_reader :source
167
-
168
- attr_reader :step_definition
169
-
170
- attr_reader :test_case
171
-
172
- attr_reader :test_case_finished
173
-
174
- attr_reader :test_case_started
175
-
176
- attr_reader :test_run_finished
177
-
178
- attr_reader :test_run_started
179
-
180
- attr_reader :test_step_finished
181
-
182
- attr_reader :test_step_started
183
-
184
- attr_reader :undefined_parameter_type
185
-
186
- def initialize(
187
- attachment: nil,
188
- gherkin_document: nil,
189
- hook: nil,
190
- meta: nil,
191
- parameter_type: nil,
192
- parse_error: nil,
193
- pickle: nil,
194
- source: nil,
195
- step_definition: nil,
196
- test_case: nil,
197
- test_case_finished: nil,
198
- test_case_started: nil,
199
- test_run_finished: nil,
200
- test_run_started: nil,
201
- test_step_finished: nil,
202
- test_step_started: nil,
203
- undefined_parameter_type: nil
204
- )
205
- @attachment = attachment
206
- @gherkin_document = gherkin_document
207
- @hook = hook
208
- @meta = meta
209
- @parameter_type = parameter_type
210
- @parse_error = parse_error
211
- @pickle = pickle
212
- @source = source
213
- @step_definition = step_definition
214
- @test_case = test_case
215
- @test_case_finished = test_case_finished
216
- @test_case_started = test_case_started
217
- @test_run_finished = test_run_finished
218
- @test_run_started = test_run_started
219
- @test_step_finished = test_step_finished
220
- @test_step_started = test_step_started
221
- @undefined_parameter_type = undefined_parameter_type
222
- end
223
- end
224
-
225
-
226
- ##
227
- # Represents the Exception message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
228
- #
229
- # A simplified representation of an exception
230
- #
231
-
232
- class Exception < ::Cucumber::Messages::Message
233
-
234
- ##
235
- # The type of the exception that caused this result. E.g. "Error" or "org.opentest4j.AssertionFailedError"
236
-
237
- attr_reader :type
238
-
239
- ##
240
- # The message of exception that caused this result. E.g. expected: "a" but was: "b"
241
-
242
- attr_reader :message
243
-
244
- def initialize(
245
- type: '',
246
- message: nil
247
- )
248
- @type = type
249
- @message = message
250
- end
251
- end
252
-
253
-
254
- ##
255
- # Represents the GherkinDocument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
256
- #
257
- # *
258
- # The [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of a Gherkin document.
259
- # Cucumber implementations should *not* depend on `GherkinDocument` or any of its
260
- # children for execution - use [Pickle](#io.cucumber.messages.Pickle) instead.
261
- #
262
- # The only consumers of `GherkinDocument` should only be formatters that produce
263
- # "rich" output, resembling the original Gherkin document.
264
- #
265
-
266
- class GherkinDocument < ::Cucumber::Messages::Message
267
-
268
- ##
269
- # *
270
- # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
271
- # of the source, typically a file path relative to the root directory
272
-
273
- attr_reader :uri
274
-
275
- attr_reader :feature
276
-
277
- ##
278
- # All the comments in the Gherkin document
279
-
280
- attr_reader :comments
281
-
282
- def initialize(
283
- uri: nil,
284
- feature: nil,
285
- comments: []
286
- )
287
- @uri = uri
288
- @feature = feature
289
- @comments = comments
290
- end
291
- end
292
-
293
-
294
- ##
295
- # Represents the Background message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
296
- #
297
-
298
- #
299
-
300
- class Background < ::Cucumber::Messages::Message
301
-
302
- ##
303
- # The location of the `Background` keyword
304
-
305
- attr_reader :location
306
-
307
- attr_reader :keyword
308
-
309
- attr_reader :name
310
-
311
- attr_reader :description
312
-
313
- attr_reader :steps
314
-
315
- attr_reader :id
316
-
317
- def initialize(
318
- location: Location.new,
319
- keyword: '',
320
- name: '',
321
- description: '',
322
- steps: [],
323
- id: ''
324
- )
325
- @location = location
326
- @keyword = keyword
327
- @name = name
328
- @description = description
329
- @steps = steps
330
- @id = id
331
- end
332
- end
333
-
334
-
335
- ##
336
- # Represents the Comment message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
337
- #
338
- # *
339
- # A comment in a Gherkin document
340
- #
341
-
342
- class Comment < ::Cucumber::Messages::Message
343
-
344
- ##
345
- # The location of the comment
346
-
347
- attr_reader :location
348
-
349
- ##
350
- # The text of the comment
351
-
352
- attr_reader :text
353
-
354
- def initialize(
355
- location: Location.new,
356
- text: ''
357
- )
358
- @location = location
359
- @text = text
360
- end
361
- end
362
-
363
-
364
- ##
365
- # Represents the DataTable message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
366
- #
367
-
368
- #
369
-
370
- class DataTable < ::Cucumber::Messages::Message
371
-
372
- attr_reader :location
373
-
374
- attr_reader :rows
375
-
376
- def initialize(
377
- location: Location.new,
378
- rows: []
379
- )
380
- @location = location
381
- @rows = rows
382
- end
383
- end
384
-
385
-
386
- ##
387
- # Represents the DocString message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
388
- #
389
-
390
- #
391
-
392
- class DocString < ::Cucumber::Messages::Message
393
-
394
- attr_reader :location
395
-
396
- attr_reader :media_type
397
-
398
- attr_reader :content
399
-
400
- attr_reader :delimiter
401
-
402
- def initialize(
403
- location: Location.new,
404
- media_type: nil,
405
- content: '',
406
- delimiter: ''
407
- )
408
- @location = location
409
- @media_type = media_type
410
- @content = content
411
- @delimiter = delimiter
412
- end
413
- end
414
-
415
-
416
- ##
417
- # Represents the Examples message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
418
- #
419
-
420
- #
421
-
422
- class Examples < ::Cucumber::Messages::Message
423
-
424
- ##
425
- # The location of the `Examples` keyword
426
-
427
- attr_reader :location
428
-
429
- attr_reader :tags
430
-
431
- attr_reader :keyword
432
-
433
- attr_reader :name
434
-
435
- attr_reader :description
436
-
437
- attr_reader :table_header
438
-
439
- attr_reader :table_body
440
-
441
- attr_reader :id
442
-
443
- def initialize(
444
- location: Location.new,
445
- tags: [],
446
- keyword: '',
447
- name: '',
448
- description: '',
449
- table_header: nil,
450
- table_body: [],
451
- id: ''
452
- )
453
- @location = location
454
- @tags = tags
455
- @keyword = keyword
456
- @name = name
457
- @description = description
458
- @table_header = table_header
459
- @table_body = table_body
460
- @id = id
461
- end
462
- end
463
-
464
-
465
- ##
466
- # Represents the Feature message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
467
- #
468
-
469
- #
470
-
471
- class Feature < ::Cucumber::Messages::Message
472
-
473
- ##
474
- # The location of the `Feature` keyword
475
-
476
- attr_reader :location
477
-
478
- ##
479
- # All the tags placed above the `Feature` keyword
480
-
481
- attr_reader :tags
482
-
483
- ##
484
- # The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code of the Gherkin document
485
-
486
- attr_reader :language
487
-
488
- ##
489
- # The text of the `Feature` keyword (in the language specified by `language`)
490
-
491
- attr_reader :keyword
492
-
493
- ##
494
- # The name of the feature (the text following the `keyword`)
495
-
496
- attr_reader :name
497
-
498
- ##
499
- # The line(s) underneath the line with the `keyword` that are used as description
500
-
501
- attr_reader :description
502
-
503
- ##
504
- # Zero or more children
505
-
506
- attr_reader :children
507
-
508
- def initialize(
509
- location: Location.new,
510
- tags: [],
511
- language: '',
512
- keyword: '',
513
- name: '',
514
- description: '',
515
- children: []
516
- )
517
- @location = location
518
- @tags = tags
519
- @language = language
520
- @keyword = keyword
521
- @name = name
522
- @description = description
523
- @children = children
524
- end
525
- end
526
-
527
-
528
- ##
529
- # Represents the FeatureChild message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
530
- #
531
- # *
532
- # A child node of a `Feature` node
533
- #
534
-
535
- class FeatureChild < ::Cucumber::Messages::Message
536
-
537
- attr_reader :rule
538
-
539
- attr_reader :background
540
-
541
- attr_reader :scenario
542
-
543
- def initialize(
544
- rule: nil,
545
- background: nil,
546
- scenario: nil
547
- )
548
- @rule = rule
549
- @background = background
550
- @scenario = scenario
551
- end
552
- end
553
-
554
-
555
- ##
556
- # Represents the Rule message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
557
- #
558
-
559
- #
560
-
561
- class Rule < ::Cucumber::Messages::Message
562
-
563
- ##
564
- # The location of the `Rule` keyword
565
-
566
- attr_reader :location
567
-
568
- ##
569
- # All the tags placed above the `Rule` keyword
570
-
571
- attr_reader :tags
572
-
573
- attr_reader :keyword
574
-
575
- attr_reader :name
576
-
577
- attr_reader :description
578
-
579
- attr_reader :children
580
-
581
- attr_reader :id
582
-
583
- def initialize(
584
- location: Location.new,
585
- tags: [],
586
- keyword: '',
587
- name: '',
588
- description: '',
589
- children: [],
590
- id: ''
591
- )
592
- @location = location
593
- @tags = tags
594
- @keyword = keyword
595
- @name = name
596
- @description = description
597
- @children = children
598
- @id = id
599
- end
600
- end
601
-
602
-
603
- ##
604
- # Represents the RuleChild message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
605
- #
606
- # *
607
- # A child node of a `Rule` node
608
- #
609
-
610
- class RuleChild < ::Cucumber::Messages::Message
611
-
612
- attr_reader :background
613
-
614
- attr_reader :scenario
615
-
616
- def initialize(
617
- background: nil,
618
- scenario: nil
619
- )
620
- @background = background
621
- @scenario = scenario
622
- end
623
- end
624
-
625
-
626
- ##
627
- # Represents the Scenario message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
628
- #
629
-
630
- #
631
-
632
- class Scenario < ::Cucumber::Messages::Message
633
-
634
- ##
635
- # The location of the `Scenario` keyword
636
-
637
- attr_reader :location
638
-
639
- attr_reader :tags
640
-
641
- attr_reader :keyword
642
-
643
- attr_reader :name
644
-
645
- attr_reader :description
646
-
647
- attr_reader :steps
648
-
649
- attr_reader :examples
650
-
651
- attr_reader :id
652
-
653
- def initialize(
654
- location: Location.new,
655
- tags: [],
656
- keyword: '',
657
- name: '',
658
- description: '',
659
- steps: [],
660
- examples: [],
661
- id: ''
662
- )
663
- @location = location
664
- @tags = tags
665
- @keyword = keyword
666
- @name = name
667
- @description = description
668
- @steps = steps
669
- @examples = examples
670
- @id = id
671
- end
672
- end
673
-
674
-
675
- ##
676
- # Represents the Step message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
677
- #
678
- # A step
679
- #
680
-
681
- class Step < ::Cucumber::Messages::Message
682
-
683
- ##
684
- # The location of the steps' `keyword`
685
-
686
- attr_reader :location
687
-
688
- ##
689
- # The actual keyword as it appeared in the source.
690
-
691
- attr_reader :keyword
692
-
693
- ##
694
- # The test phase signalled by the keyword: Context definition (Given), Action performance (When), Outcome assertion (Then). Other keywords signal Continuation (And and But) from a prior keyword. Please note that all translations which a dialect maps to multiple keywords (`*` is in this category for all dialects), map to 'Unknown'.
695
-
696
- attr_reader :keyword_type
697
-
698
- attr_reader :text
699
-
700
- attr_reader :doc_string
701
-
702
- attr_reader :data_table
703
-
704
- ##
705
- # Unique ID to be able to reference the Step from PickleStep
706
-
707
- attr_reader :id
708
-
709
- def initialize(
710
- location: Location.new,
711
- keyword: '',
712
- keyword_type: nil,
713
- text: '',
714
- doc_string: nil,
715
- data_table: nil,
716
- id: ''
717
- )
718
- @location = location
719
- @keyword = keyword
720
- @keyword_type = keyword_type
721
- @text = text
722
- @doc_string = doc_string
723
- @data_table = data_table
724
- @id = id
725
- end
726
- end
727
-
728
-
729
- ##
730
- # Represents the TableCell message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
731
- #
732
- # A cell in a `TableRow`
733
- #
734
-
735
- class TableCell < ::Cucumber::Messages::Message
736
-
737
- ##
738
- # The location of the cell
739
-
740
- attr_reader :location
741
-
742
- ##
743
- # The value of the cell
744
-
745
- attr_reader :value
746
-
747
- def initialize(
748
- location: Location.new,
749
- value: ''
750
- )
751
- @location = location
752
- @value = value
753
- end
754
- end
755
-
756
-
757
- ##
758
- # Represents the TableRow message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
759
- #
760
- # A row in a table
761
- #
762
-
763
- class TableRow < ::Cucumber::Messages::Message
764
-
765
- ##
766
- # The location of the first cell in the row
767
-
768
- attr_reader :location
769
-
770
- ##
771
- # Cells in the row
772
-
773
- attr_reader :cells
774
-
775
- attr_reader :id
776
-
777
- def initialize(
778
- location: Location.new,
779
- cells: [],
780
- id: ''
781
- )
782
- @location = location
783
- @cells = cells
784
- @id = id
785
- end
786
- end
787
-
788
-
789
- ##
790
- # Represents the Tag message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
791
- #
792
- # *
793
- # A tag
794
- #
795
-
796
- class Tag < ::Cucumber::Messages::Message
797
-
798
- ##
799
- # Location of the tag
800
-
801
- attr_reader :location
802
-
803
- ##
804
- # The name of the tag (including the leading `@`)
805
-
806
- attr_reader :name
807
-
808
- ##
809
- # Unique ID to be able to reference the Tag from PickleTag
810
-
811
- attr_reader :id
812
-
813
- def initialize(
814
- location: Location.new,
815
- name: '',
816
- id: ''
817
- )
818
- @location = location
819
- @name = name
820
- @id = id
821
- end
822
- end
823
-
824
-
825
- ##
826
- # Represents the Hook message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
827
- #
828
-
829
- #
830
-
831
- class Hook < ::Cucumber::Messages::Message
832
-
833
- attr_reader :id
834
-
835
- attr_reader :name
836
-
837
- attr_reader :source_reference
838
-
839
- attr_reader :tag_expression
840
-
841
- def initialize(
842
- id: '',
843
- name: nil,
844
- source_reference: SourceReference.new,
845
- tag_expression: nil
846
- )
847
- @id = id
848
- @name = name
849
- @source_reference = source_reference
850
- @tag_expression = tag_expression
851
- end
852
- end
853
-
854
-
855
- ##
856
- # Represents the Location message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
857
- #
858
- # *
859
- # Points to a line and a column in a text file
860
- #
861
-
862
- class Location < ::Cucumber::Messages::Message
863
-
864
- attr_reader :line
865
-
866
- attr_reader :column
867
-
868
- def initialize(
869
- line: 0,
870
- column: nil
871
- )
872
- @line = line
873
- @column = column
874
- end
875
- end
876
-
877
-
878
- ##
879
- # Represents the Meta message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
880
- #
881
- # *
882
- # This message contains meta information about the environment. Consumers can use
883
- # this for various purposes.
884
- #
885
-
886
- class Meta < ::Cucumber::Messages::Message
887
-
888
- ##
889
- # *
890
- # The [SEMVER](https://semver.org/) version number of the protocol
891
-
892
- attr_reader :protocol_version
893
-
894
- ##
895
- # SpecFlow, Cucumber-JVM, Cucumber.js, Cucumber-Ruby, Behat etc.
896
-
897
- attr_reader :implementation
898
-
899
- ##
900
- # Java, Ruby, Node.js etc
901
-
902
- attr_reader :runtime
903
-
904
- ##
905
- # Windows, Linux, MacOS etc
906
-
907
- attr_reader :os
908
-
909
- ##
910
- # 386, arm, amd64 etc
911
-
912
- attr_reader :cpu
913
-
914
- attr_reader :ci
915
-
916
- def initialize(
917
- protocol_version: '',
918
- implementation: Product.new,
919
- runtime: Product.new,
920
- os: Product.new,
921
- cpu: Product.new,
922
- ci: nil
923
- )
924
- @protocol_version = protocol_version
925
- @implementation = implementation
926
- @runtime = runtime
927
- @os = os
928
- @cpu = cpu
929
- @ci = ci
930
- end
931
- end
932
-
933
-
934
- ##
935
- # Represents the Ci message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
936
- #
937
- # CI environment
938
- #
939
-
940
- class Ci < ::Cucumber::Messages::Message
941
-
942
- ##
943
- # Name of the CI product, e.g. "Jenkins", "CircleCI" etc.
944
-
945
- attr_reader :name
946
-
947
- ##
948
- # Link to the build
949
-
950
- attr_reader :url
951
-
952
- ##
953
- # The build number. Some CI servers use non-numeric build numbers, which is why this is a string
954
-
955
- attr_reader :build_number
956
-
957
- attr_reader :git
958
-
959
- def initialize(
960
- name: '',
961
- url: nil,
962
- build_number: nil,
963
- git: nil
964
- )
965
- @name = name
966
- @url = url
967
- @build_number = build_number
968
- @git = git
969
- end
970
- end
971
-
972
-
973
- ##
974
- # Represents the Git message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
975
- #
976
- # Information about Git, provided by the Build/CI server as environment
977
- # variables.
978
- #
979
-
980
- class Git < ::Cucumber::Messages::Message
981
-
982
- attr_reader :remote
983
-
984
- attr_reader :revision
985
-
986
- attr_reader :branch
987
-
988
- attr_reader :tag
989
-
990
- def initialize(
991
- remote: '',
992
- revision: '',
993
- branch: nil,
994
- tag: nil
995
- )
996
- @remote = remote
997
- @revision = revision
998
- @branch = branch
999
- @tag = tag
1000
- end
1001
- end
1002
-
1003
-
1004
- ##
1005
- # Represents the Product message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1006
- #
1007
- # Used to describe various properties of Meta
1008
- #
1009
-
1010
- class Product < ::Cucumber::Messages::Message
1011
-
1012
- ##
1013
- # The product name
1014
-
1015
- attr_reader :name
1016
-
1017
- ##
1018
- # The product version
1019
-
1020
- attr_reader :version
1021
-
1022
- def initialize(
1023
- name: '',
1024
- version: nil
1025
- )
1026
- @name = name
1027
- @version = version
1028
- end
1029
- end
1030
-
1031
-
1032
- ##
1033
- # Represents the ParameterType message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1034
- #
1035
-
1036
- #
1037
-
1038
- class ParameterType < ::Cucumber::Messages::Message
1039
-
1040
- ##
1041
- # The name is unique, so we don't need an id.
1042
-
1043
- attr_reader :name
1044
-
1045
- attr_reader :regular_expressions
1046
-
1047
- attr_reader :prefer_for_regular_expression_match
1048
-
1049
- attr_reader :use_for_snippets
1050
-
1051
- attr_reader :id
1052
-
1053
- attr_reader :source_reference
1054
-
1055
- def initialize(
1056
- name: '',
1057
- regular_expressions: [],
1058
- prefer_for_regular_expression_match: false,
1059
- use_for_snippets: false,
1060
- id: '',
1061
- source_reference: nil
1062
- )
1063
- @name = name
1064
- @regular_expressions = regular_expressions
1065
- @prefer_for_regular_expression_match = prefer_for_regular_expression_match
1066
- @use_for_snippets = use_for_snippets
1067
- @id = id
1068
- @source_reference = source_reference
1069
- end
1070
- end
1071
-
1072
-
1073
- ##
1074
- # Represents the ParseError message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1075
- #
1076
-
1077
- #
1078
-
1079
- class ParseError < ::Cucumber::Messages::Message
1080
-
1081
- attr_reader :source
1082
-
1083
- attr_reader :message
1084
-
1085
- def initialize(
1086
- source: SourceReference.new,
1087
- message: ''
1088
- )
1089
- @source = source
1090
- @message = message
1091
- end
1092
- end
1093
-
1094
-
1095
- ##
1096
- # Represents the Pickle message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1097
- #
1098
- # //// Pickles
1099
- #
1100
- # *
1101
- # A `Pickle` represents a template for a `TestCase`. It is typically derived
1102
- # from another format, such as [GherkinDocument](#io.cucumber.messages.GherkinDocument).
1103
- # In the future a `Pickle` may be derived from other formats such as Markdown or
1104
- # Excel files.
1105
- #
1106
- # By making `Pickle` the main data structure Cucumber uses for execution, the
1107
- # implementation of Cucumber itself becomes simpler, as it doesn't have to deal
1108
- # with the complex structure of a [GherkinDocument](#io.cucumber.messages.GherkinDocument).
1109
- #
1110
- # Each `PickleStep` of a `Pickle` is matched with a `StepDefinition` to create a `TestCase`
1111
- #
1112
-
1113
- class Pickle < ::Cucumber::Messages::Message
1114
-
1115
- ##
1116
- # *
1117
- # A unique id for the pickle
1118
-
1119
- attr_reader :id
1120
-
1121
- ##
1122
- # The uri of the source file
1123
-
1124
- attr_reader :uri
1125
-
1126
- ##
1127
- # The name of the pickle
1128
-
1129
- attr_reader :name
1130
-
1131
- ##
1132
- # The language of the pickle
1133
-
1134
- attr_reader :language
1135
-
1136
- ##
1137
- # One or more steps
1138
-
1139
- attr_reader :steps
1140
-
1141
- ##
1142
- # *
1143
- # One or more tags. If this pickle is constructed from a Gherkin document,
1144
- # It includes inherited tags from the `Feature` as well.
1145
-
1146
- attr_reader :tags
1147
-
1148
- ##
1149
- # *
1150
- # Points to the AST node locations of the pickle. The last one represents the unique
1151
- # id of the pickle. A pickle constructed from `Examples` will have the first
1152
- # id originating from the `Scenario` AST node, and the second from the `TableRow` AST node.
1153
-
1154
- attr_reader :ast_node_ids
1155
-
1156
- def initialize(
1157
- id: '',
1158
- uri: '',
1159
- name: '',
1160
- language: '',
1161
- steps: [],
1162
- tags: [],
1163
- ast_node_ids: []
1164
- )
1165
- @id = id
1166
- @uri = uri
1167
- @name = name
1168
- @language = language
1169
- @steps = steps
1170
- @tags = tags
1171
- @ast_node_ids = ast_node_ids
1172
- end
1173
- end
1174
-
1175
-
1176
- ##
1177
- # Represents the PickleDocString message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1178
- #
1179
-
1180
- #
1181
-
1182
- class PickleDocString < ::Cucumber::Messages::Message
1183
-
1184
- attr_reader :media_type
1185
-
1186
- attr_reader :content
1187
-
1188
- def initialize(
1189
- media_type: nil,
1190
- content: ''
1191
- )
1192
- @media_type = media_type
1193
- @content = content
1194
- end
1195
- end
1196
-
1197
-
1198
- ##
1199
- # Represents the PickleStep message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1200
- #
1201
- # *
1202
- # An executable step
1203
- #
1204
-
1205
- class PickleStep < ::Cucumber::Messages::Message
1206
-
1207
- attr_reader :argument
1208
-
1209
- ##
1210
- # References the IDs of the source of the step. For Gherkin, this can be
1211
- # the ID of a Step, and possibly also the ID of a TableRow
1212
-
1213
- attr_reader :ast_node_ids
1214
-
1215
- ##
1216
- # A unique ID for the PickleStep
1217
-
1218
- attr_reader :id
1219
-
1220
- ##
1221
- # The context in which the step was specified: context (Given), action (When) or outcome (Then).
1222
- #
1223
- # Note that the keywords `But` and `And` inherit their meaning from prior steps and the `*` 'keyword' doesn't have specific meaning (hence Unknown)
1224
-
1225
- attr_reader :type
1226
-
1227
- attr_reader :text
1228
-
1229
- def initialize(
1230
- argument: nil,
1231
- ast_node_ids: [],
1232
- id: '',
1233
- type: nil,
1234
- text: ''
1235
- )
1236
- @argument = argument
1237
- @ast_node_ids = ast_node_ids
1238
- @id = id
1239
- @type = type
1240
- @text = text
1241
- end
1242
- end
1243
-
1244
-
1245
- ##
1246
- # Represents the PickleStepArgument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1247
- #
1248
- # An optional argument
1249
- #
1250
-
1251
- class PickleStepArgument < ::Cucumber::Messages::Message
1252
-
1253
- attr_reader :doc_string
1254
-
1255
- attr_reader :data_table
1256
-
1257
- def initialize(
1258
- doc_string: nil,
1259
- data_table: nil
1260
- )
1261
- @doc_string = doc_string
1262
- @data_table = data_table
1263
- end
1264
- end
1265
-
1266
-
1267
- ##
1268
- # Represents the PickleTable message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1269
- #
1270
-
1271
- #
1272
-
1273
- class PickleTable < ::Cucumber::Messages::Message
1274
-
1275
- attr_reader :rows
1276
-
1277
- def initialize(
1278
- rows: []
1279
- )
1280
- @rows = rows
1281
- end
1282
- end
1283
-
1284
-
1285
- ##
1286
- # Represents the PickleTableCell message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1287
- #
1288
-
1289
- #
1290
-
1291
- class PickleTableCell < ::Cucumber::Messages::Message
1292
-
1293
- attr_reader :value
1294
-
1295
- def initialize(
1296
- value: ''
1297
- )
1298
- @value = value
1299
- end
1300
- end
1301
-
1302
-
1303
- ##
1304
- # Represents the PickleTableRow message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1305
- #
1306
-
1307
- #
1308
-
1309
- class PickleTableRow < ::Cucumber::Messages::Message
1310
-
1311
- attr_reader :cells
1312
-
1313
- def initialize(
1314
- cells: []
1315
- )
1316
- @cells = cells
1317
- end
1318
- end
1319
-
1320
-
1321
- ##
1322
- # Represents the PickleTag message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1323
- #
1324
- # *
1325
- # A tag
1326
- #
1327
-
1328
- class PickleTag < ::Cucumber::Messages::Message
1329
-
1330
- attr_reader :name
1331
-
1332
- ##
1333
- # Points to the AST node this was created from
1334
-
1335
- attr_reader :ast_node_id
1336
-
1337
- def initialize(
1338
- name: '',
1339
- ast_node_id: ''
1340
- )
1341
- @name = name
1342
- @ast_node_id = ast_node_id
1343
- end
1344
- end
1345
-
1346
-
1347
- ##
1348
- # Represents the Source message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1349
- #
1350
- # //// Source
1351
- #
1352
- # *
1353
- # A source file, typically a Gherkin document or Java/Ruby/JavaScript source code
1354
- #
1355
-
1356
- class Source < ::Cucumber::Messages::Message
1357
-
1358
- ##
1359
- # *
1360
- # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
1361
- # of the source, typically a file path relative to the root directory
1362
-
1363
- attr_reader :uri
1364
-
1365
- ##
1366
- # The contents of the file
1367
-
1368
- attr_reader :data
1369
-
1370
- ##
1371
- # The media type of the file. Can be used to specify custom types, such as
1372
- # text/x.cucumber.gherkin+plain
1373
-
1374
- attr_reader :media_type
1375
-
1376
- def initialize(
1377
- uri: '',
1378
- data: '',
1379
- media_type: SourceMediaType::TEXT_X_CUCUMBER_GHERKIN_PLAIN
1380
- )
1381
- @uri = uri
1382
- @data = data
1383
- @media_type = media_type
1384
- end
1385
- end
1386
-
1387
-
1388
- ##
1389
- # Represents the SourceReference message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1390
- #
1391
- # *
1392
- # Points to a [Source](#io.cucumber.messages.Source) identified by `uri` and a
1393
- # [Location](#io.cucumber.messages.Location) within that file.
1394
- #
1395
-
1396
- class SourceReference < ::Cucumber::Messages::Message
1397
-
1398
- attr_reader :uri
1399
-
1400
- attr_reader :java_method
1401
-
1402
- attr_reader :java_stack_trace_element
1403
-
1404
- attr_reader :location
1405
-
1406
- def initialize(
1407
- uri: nil,
1408
- java_method: nil,
1409
- java_stack_trace_element: nil,
1410
- location: nil
1411
- )
1412
- @uri = uri
1413
- @java_method = java_method
1414
- @java_stack_trace_element = java_stack_trace_element
1415
- @location = location
1416
- end
1417
- end
1418
-
1419
-
1420
- ##
1421
- # Represents the JavaMethod message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1422
- #
1423
-
1424
- #
1425
-
1426
- class JavaMethod < ::Cucumber::Messages::Message
1427
-
1428
- attr_reader :class_name
1429
-
1430
- attr_reader :method_name
1431
-
1432
- attr_reader :method_parameter_types
1433
-
1434
- def initialize(
1435
- class_name: '',
1436
- method_name: '',
1437
- method_parameter_types: []
1438
- )
1439
- @class_name = class_name
1440
- @method_name = method_name
1441
- @method_parameter_types = method_parameter_types
1442
- end
1443
- end
1444
-
1445
-
1446
- ##
1447
- # Represents the JavaStackTraceElement message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1448
- #
1449
-
1450
- #
1451
-
1452
- class JavaStackTraceElement < ::Cucumber::Messages::Message
1453
-
1454
- attr_reader :class_name
1455
-
1456
- attr_reader :file_name
1457
-
1458
- attr_reader :method_name
1459
-
1460
- def initialize(
1461
- class_name: '',
1462
- file_name: '',
1463
- method_name: ''
1464
- )
1465
- @class_name = class_name
1466
- @file_name = file_name
1467
- @method_name = method_name
1468
- end
1469
- end
1470
-
1471
-
1472
- ##
1473
- # Represents the StepDefinition message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1474
- #
1475
-
1476
- #
1477
-
1478
- class StepDefinition < ::Cucumber::Messages::Message
1479
-
1480
- attr_reader :id
1481
-
1482
- attr_reader :pattern
1483
-
1484
- attr_reader :source_reference
1485
-
1486
- def initialize(
1487
- id: '',
1488
- pattern: StepDefinitionPattern.new,
1489
- source_reference: SourceReference.new
1490
- )
1491
- @id = id
1492
- @pattern = pattern
1493
- @source_reference = source_reference
1494
- end
1495
- end
1496
-
1497
-
1498
- ##
1499
- # Represents the StepDefinitionPattern message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1500
- #
1501
-
1502
- #
1503
-
1504
- class StepDefinitionPattern < ::Cucumber::Messages::Message
1505
-
1506
- attr_reader :source
1507
-
1508
- attr_reader :type
1509
-
1510
- def initialize(
1511
- source: '',
1512
- type: StepDefinitionPatternType::CUCUMBER_EXPRESSION
1513
- )
1514
- @source = source
1515
- @type = type
1516
- end
1517
- end
1518
-
1519
-
1520
- ##
1521
- # Represents the TestCase message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1522
- #
1523
- # //// TestCases
1524
- #
1525
- # *
1526
- # A `TestCase` contains a sequence of `TestStep`s.
1527
- #
1528
-
1529
- class TestCase < ::Cucumber::Messages::Message
1530
-
1531
- attr_reader :id
1532
-
1533
- ##
1534
- # The ID of the `Pickle` this `TestCase` is derived from.
1535
-
1536
- attr_reader :pickle_id
1537
-
1538
- attr_reader :test_steps
1539
-
1540
- def initialize(
1541
- id: '',
1542
- pickle_id: '',
1543
- test_steps: []
1544
- )
1545
- @id = id
1546
- @pickle_id = pickle_id
1547
- @test_steps = test_steps
1548
- end
1549
- end
1550
-
1551
-
1552
- ##
1553
- # Represents the Group message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1554
- #
1555
-
1556
- #
1557
-
1558
- class Group < ::Cucumber::Messages::Message
1559
-
1560
- attr_reader :children
1561
-
1562
- attr_reader :start
1563
-
1564
- attr_reader :value
1565
-
1566
- def initialize(
1567
- children: [],
1568
- start: nil,
1569
- value: nil
1570
- )
1571
- @children = children
1572
- @start = start
1573
- @value = value
1574
- end
1575
- end
1576
-
1577
-
1578
- ##
1579
- # Represents the StepMatchArgument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1580
- #
1581
- # *
1582
- # Represents a single argument extracted from a step match and passed to a step definition.
1583
- # This is used for the following purposes:
1584
- # - Construct an argument to pass to a step definition (possibly through a parameter type transform)
1585
- # - Highlight the matched parameter in rich formatters such as the HTML formatter
1586
- #
1587
- # This message closely matches the `Argument` class in the `cucumber-expressions` library.
1588
- #
1589
-
1590
- class StepMatchArgument < ::Cucumber::Messages::Message
1591
-
1592
- ##
1593
- # *
1594
- # Represents the outermost capture group of an argument. This message closely matches the
1595
- # `Group` class in the `cucumber-expressions` library.
1596
-
1597
- attr_reader :group
1598
-
1599
- attr_reader :parameter_type_name
1600
-
1601
- def initialize(
1602
- group: Group.new,
1603
- parameter_type_name: nil
1604
- )
1605
- @group = group
1606
- @parameter_type_name = parameter_type_name
1607
- end
1608
- end
1609
-
1610
-
1611
- ##
1612
- # Represents the StepMatchArgumentsList message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1613
- #
1614
-
1615
- #
1616
-
1617
- class StepMatchArgumentsList < ::Cucumber::Messages::Message
1618
-
1619
- attr_reader :step_match_arguments
1620
-
1621
- def initialize(
1622
- step_match_arguments: []
1623
- )
1624
- @step_match_arguments = step_match_arguments
1625
- end
1626
- end
1627
-
1628
-
1629
- ##
1630
- # Represents the TestStep message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1631
- #
1632
- # *
1633
- # A `TestStep` is derived from either a `PickleStep`
1634
- # combined with a `StepDefinition`, or from a `Hook`.
1635
- #
1636
-
1637
- class TestStep < ::Cucumber::Messages::Message
1638
-
1639
- ##
1640
- # Pointer to the `Hook` (if derived from a Hook)
1641
-
1642
- attr_reader :hook_id
1643
-
1644
- attr_reader :id
1645
-
1646
- ##
1647
- # Pointer to the `PickleStep` (if derived from a `PickleStep`)
1648
-
1649
- attr_reader :pickle_step_id
1650
-
1651
- ##
1652
- # Pointer to all the matching `StepDefinition`s (if derived from a `PickleStep`)
1653
-
1654
- attr_reader :step_definition_ids
1655
-
1656
- ##
1657
- # A list of list of StepMatchArgument (if derived from a `PickleStep`).
1658
- # Each element represents a matching step definition. A size of 0 means `UNDEFINED`,
1659
- # and a size of 2+ means `AMBIGUOUS`
1660
-
1661
- attr_reader :step_match_arguments_lists
1662
-
1663
- def initialize(
1664
- hook_id: nil,
1665
- id: '',
1666
- pickle_step_id: nil,
1667
- step_definition_ids: nil,
1668
- step_match_arguments_lists: nil
1669
- )
1670
- @hook_id = hook_id
1671
- @id = id
1672
- @pickle_step_id = pickle_step_id
1673
- @step_definition_ids = step_definition_ids
1674
- @step_match_arguments_lists = step_match_arguments_lists
1675
- end
1676
- end
1677
-
1678
-
1679
- ##
1680
- # Represents the TestCaseFinished message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1681
- #
1682
-
1683
- #
1684
-
1685
- class TestCaseFinished < ::Cucumber::Messages::Message
1686
-
1687
- attr_reader :test_case_started_id
1688
-
1689
- attr_reader :timestamp
1690
-
1691
- attr_reader :will_be_retried
1692
-
1693
- def initialize(
1694
- test_case_started_id: '',
1695
- timestamp: Timestamp.new,
1696
- will_be_retried: false
1697
- )
1698
- @test_case_started_id = test_case_started_id
1699
- @timestamp = timestamp
1700
- @will_be_retried = will_be_retried
1701
- end
1702
- end
1703
-
1704
-
1705
- ##
1706
- # Represents the TestCaseStarted message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1707
- #
1708
-
1709
- #
1710
-
1711
- class TestCaseStarted < ::Cucumber::Messages::Message
1712
-
1713
- ##
1714
- # *
1715
- # The first attempt should have value 0, and for each retry the value
1716
- # should increase by 1.
1717
-
1718
- attr_reader :attempt
1719
-
1720
- ##
1721
- # *
1722
- # Because a `TestCase` can be run multiple times (in case of a retry),
1723
- # we use this field to group messages relating to the same attempt.
1724
-
1725
- attr_reader :id
1726
-
1727
- attr_reader :test_case_id
1728
-
1729
- ##
1730
- # An identifier for the worker process running this test case, if test cases are being run in parallel. The identifier will be unique per worker, but no particular format is defined - it could be an index, uuid, machine name etc - and as such should be assumed that it's not human readable.
1731
-
1732
- attr_reader :worker_id
1733
-
1734
- attr_reader :timestamp
1735
-
1736
- def initialize(
1737
- attempt: 0,
1738
- id: '',
1739
- test_case_id: '',
1740
- worker_id: nil,
1741
- timestamp: Timestamp.new
1742
- )
1743
- @attempt = attempt
1744
- @id = id
1745
- @test_case_id = test_case_id
1746
- @worker_id = worker_id
1747
- @timestamp = timestamp
1748
- end
1749
- end
1750
-
1751
-
1752
- ##
1753
- # Represents the TestRunFinished message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1754
- #
1755
-
1756
- #
1757
-
1758
- class TestRunFinished < ::Cucumber::Messages::Message
1759
-
1760
- ##
1761
- # An informative message about the test run. Typically additional information about failure, but not necessarily.
1762
-
1763
- attr_reader :message
1764
-
1765
- ##
1766
- # A test run is successful if all steps are either passed or skipped, all before/after hooks passed and no other exceptions where thrown.
1767
-
1768
- attr_reader :success
1769
-
1770
- ##
1771
- # Timestamp when the TestRun is finished
1772
-
1773
- attr_reader :timestamp
1774
-
1775
- ##
1776
- # Any exception thrown during the test run, if any. Does not include exceptions thrown while executing steps.
1777
-
1778
- attr_reader :exception
1779
-
1780
- def initialize(
1781
- message: nil,
1782
- success: false,
1783
- timestamp: Timestamp.new,
1784
- exception: nil
1785
- )
1786
- @message = message
1787
- @success = success
1788
- @timestamp = timestamp
1789
- @exception = exception
1790
- end
1791
- end
1792
-
1793
-
1794
- ##
1795
- # Represents the TestRunStarted message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1796
- #
1797
-
1798
- #
1799
-
1800
- class TestRunStarted < ::Cucumber::Messages::Message
1801
-
1802
- attr_reader :timestamp
1803
-
1804
- def initialize(
1805
- timestamp: Timestamp.new
1806
- )
1807
- @timestamp = timestamp
1808
- end
1809
- end
1810
-
1811
-
1812
- ##
1813
- # Represents the TestStepFinished message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1814
- #
1815
-
1816
- #
1817
-
1818
- class TestStepFinished < ::Cucumber::Messages::Message
1819
-
1820
- attr_reader :test_case_started_id
1821
-
1822
- attr_reader :test_step_id
1823
-
1824
- attr_reader :test_step_result
1825
-
1826
- attr_reader :timestamp
1827
-
1828
- def initialize(
1829
- test_case_started_id: '',
1830
- test_step_id: '',
1831
- test_step_result: TestStepResult.new,
1832
- timestamp: Timestamp.new
1833
- )
1834
- @test_case_started_id = test_case_started_id
1835
- @test_step_id = test_step_id
1836
- @test_step_result = test_step_result
1837
- @timestamp = timestamp
1838
- end
1839
- end
1840
-
1841
-
1842
- ##
1843
- # Represents the TestStepResult message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1844
- #
1845
-
1846
- #
1847
-
1848
- class TestStepResult < ::Cucumber::Messages::Message
1849
-
1850
- attr_reader :duration
1851
-
1852
- ##
1853
- # An arbitrary bit of information that explains this result. This can be a stack trace of anything else.
1854
-
1855
- attr_reader :message
1856
-
1857
- attr_reader :status
1858
-
1859
- ##
1860
- # Exception thrown while executing this step, if any.
1861
-
1862
- attr_reader :exception
1863
-
1864
- def initialize(
1865
- duration: Duration.new,
1866
- message: nil,
1867
- status: TestStepResultStatus::UNKNOWN,
1868
- exception: nil
1869
- )
1870
- @duration = duration
1871
- @message = message
1872
- @status = status
1873
- @exception = exception
1874
- end
1875
- end
1876
-
1877
-
1878
- ##
1879
- # Represents the TestStepStarted message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1880
- #
1881
-
1882
- #
1883
-
1884
- class TestStepStarted < ::Cucumber::Messages::Message
1885
-
1886
- attr_reader :test_case_started_id
1887
-
1888
- attr_reader :test_step_id
1889
-
1890
- attr_reader :timestamp
1891
-
1892
- def initialize(
1893
- test_case_started_id: '',
1894
- test_step_id: '',
1895
- timestamp: Timestamp.new
1896
- )
1897
- @test_case_started_id = test_case_started_id
1898
- @test_step_id = test_step_id
1899
- @timestamp = timestamp
1900
- end
1901
- end
1902
-
1903
-
1904
- ##
1905
- # Represents the Timestamp message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1906
- #
1907
-
1908
- #
1909
-
1910
- class Timestamp < ::Cucumber::Messages::Message
1911
-
1912
- ##
1913
- # Represents seconds of UTC time since Unix epoch
1914
- # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
1915
- # 9999-12-31T23:59:59Z inclusive.
1916
-
1917
- attr_reader :seconds
1918
-
1919
- ##
1920
- # Non-negative fractions of a second at nanosecond resolution. Negative
1921
- # second values with fractions must still have non-negative nanos values
1922
- # that count forward in time. Must be from 0 to 999,999,999
1923
- # inclusive.
1924
-
1925
- attr_reader :nanos
1926
-
1927
- def initialize(
1928
- seconds: 0,
1929
- nanos: 0
1930
- )
1931
- @seconds = seconds
1932
- @nanos = nanos
1933
- end
1934
- end
1935
-
1936
-
1937
- ##
1938
- # Represents the UndefinedParameterType message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
1939
- #
1940
-
1941
- #
1942
-
1943
- class UndefinedParameterType < ::Cucumber::Messages::Message
1944
-
1945
- attr_reader :expression
1946
-
1947
- attr_reader :name
1948
-
1949
- def initialize(
1950
- expression: '',
1951
- name: ''
1952
- )
1953
- @expression = expression
1954
- @name = name
1955
- end
1956
- end
1957
-
1958
- end
1959
- end
1960
-
1961
- class Cucumber::Messages::AttachmentContentEncoding
1962
- IDENTITY = 'IDENTITY'
1963
- BASE64 = 'BASE64'
1964
- end
1965
-
1966
- class Cucumber::Messages::PickleStepType
1967
- UNKNOWN = 'Unknown'
1968
- CONTEXT = 'Context'
1969
- ACTION = 'Action'
1970
- OUTCOME = 'Outcome'
1971
- end
1972
-
1973
- class Cucumber::Messages::SourceMediaType
1974
- TEXT_X_CUCUMBER_GHERKIN_PLAIN = 'text/x.cucumber.gherkin+plain'
1975
- TEXT_X_CUCUMBER_GHERKIN_MARKDOWN = 'text/x.cucumber.gherkin+markdown'
1976
- end
1977
-
1978
- class Cucumber::Messages::StepDefinitionPatternType
1979
- CUCUMBER_EXPRESSION = 'CUCUMBER_EXPRESSION'
1980
- REGULAR_EXPRESSION = 'REGULAR_EXPRESSION'
1981
- end
1982
-
1983
- class Cucumber::Messages::StepKeywordType
1984
- UNKNOWN = 'Unknown'
1985
- CONTEXT = 'Context'
1986
- ACTION = 'Action'
1987
- OUTCOME = 'Outcome'
1988
- CONJUNCTION = 'Conjunction'
1989
- end
1990
-
1991
- class Cucumber::Messages::TestStepResultStatus
1992
- UNKNOWN = 'UNKNOWN'
1993
- PASSED = 'PASSED'
1994
- SKIPPED = 'SKIPPED'
1995
- PENDING = 'PENDING'
1996
- UNDEFINED = 'UNDEFINED'
1997
- AMBIGUOUS = 'AMBIGUOUS'
1998
- FAILED = 'FAILED'
1999
- end
2000
-