cucumber-messages 27.2.0 → 31.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7df1a72a47d98cbc019ee52d52f81d32f6af01171359de6cdfbc70493ac9ea69
4
- data.tar.gz: af04b94178bbb35139f79d8ea9cd5ced4fe9e791b8c4d282988c5a14f7bed20c
3
+ metadata.gz: c823c6a44a707a4f904397895606f4a62b511fe5ea4580a1d71f8960e9f99911
4
+ data.tar.gz: 9db59188fb60f2a4a4599e8f130190e917f223d8d66e88617ef7ed3dfad794e7
5
5
  SHA512:
6
- metadata.gz: d7a247adaa729f4405dc675d304beed0cf9002a9b0437f0ef19946524169bccd5931ac4df1cdfd14f041bf15b59ecf0753d3fe304c0a17d71ad8a74af4eb4759
7
- data.tar.gz: 81918251fa112bfc2819b709bb6905dc108a1af42249cf147e4cef211ff44037febbb3a9238ce04ae1bed1ef7a0adc6aa5b039fe9a48422ccfccaa0bb0076604
6
+ metadata.gz: 62f152ab3b73cc83acdae8552b91dc0035002bd02359d9271fcb56edbeabf18233d1a12d33f97103bb8d5b39afce9bb3d7ef835007cab96848f30c9e749e286c
7
+ data.tar.gz: 138a0f93f315fc45c7c6460d0317526f99416f0f44eee01365ef119e772bdff84329a43f020f28eadc312f58b2dc18a0e15fc5e61863618ad1aba598de52e8c6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 27.2.0
1
+ 31.1.0
@@ -7,80 +7,93 @@ module Cucumber
7
7
  # Represents the Attachment message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # //// Attachments (parse errors, execution errors, screenshots, links...)
10
+ # Attachments (parse errors, execution errors, screenshots, links...)
11
11
  #
12
- # *
13
- # An attachment represents any kind of data associated with a line in a
14
- # [Source](#io.cucumber.messages.Source) file. It can be used for:
12
+ # An attachment represents any kind of data associated with a line in a
13
+ # [Source](#io.cucumber.messages.Source) file. It can be used for:
15
14
  #
16
- # * Syntax errors during parse time
17
- # * Screenshots captured and attached during execution
18
- # * Logs captured and attached during execution
15
+ # * Syntax errors during parse time
16
+ # * Screenshots captured and attached during execution
17
+ # * Logs captured and attached during execution
19
18
  #
20
- # It is not to be used for runtime errors raised/thrown during execution. This
21
- # is captured in `TestResult`.
19
+ # It is not to be used for runtime errors raised/thrown during execution. This
20
+ # is captured in `TestResult`.
22
21
  ##
23
22
  class Attachment < Message
24
23
  ##
25
- # *
26
- # The body of the attachment. If `contentEncoding` is `IDENTITY`, the attachment
27
- # is simply the string. If it's `BASE64`, the string should be Base64 decoded to
28
- # obtain the attachment.
24
+ # The body of the attachment. If `contentEncoding` is `IDENTITY`, the attachment
25
+ # is simply the string. If it's `BASE64`, the string should be Base64 decoded to
26
+ # obtain the attachment.
29
27
  ##
30
28
  attr_reader :body
31
29
 
32
30
  ##
33
- # *
34
- # Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
31
+ # Whether to interpret `body` "as-is" (IDENTITY) or if it needs to be Base64-decoded (BASE64).
35
32
  #
36
- # Content encoding is *not* determined by the media type, but rather by the type
37
- # of the object being attached:
33
+ # Content encoding is *not* determined by the media type, but rather by the type
34
+ # of the object being attached:
38
35
  #
39
- # - string: IDENTITY
40
- # - byte array: BASE64
41
- # - stream: BASE64
36
+ # - string: IDENTITY
37
+ # - byte array: BASE64
38
+ # - stream: BASE64
42
39
  ##
43
40
  attr_reader :content_encoding
44
41
 
45
42
  ##
46
- # *
47
- # Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
43
+ # Suggested file name of the attachment. (Provided by the user as an argument to `attach`)
48
44
  ##
49
45
  attr_reader :file_name
50
46
 
51
47
  ##
52
- # *
53
- # The media type of the data. This can be any valid
54
- # [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
55
- # as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
56
- # and `text/x.cucumber.stacktrace+plain`
48
+ # The media type of the data. This can be any valid
49
+ # [IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)
50
+ # as well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`
51
+ # and `text/x.cucumber.stacktrace+plain`
57
52
  ##
58
53
  attr_reader :media_type
59
54
 
60
55
  attr_reader :source
61
56
 
57
+ ##
58
+ # The identifier of the test case attempt if the attachment was created during the execution of a test step
59
+ ##
62
60
  attr_reader :test_case_started_id
63
61
 
62
+ ##
63
+ # The identifier of the test step if the attachment was created during the execution of a test step
64
+ ##
64
65
  attr_reader :test_step_id
65
66
 
66
67
  ##
67
- # *
68
- # A URL where the attachment can be retrieved. This field should not be set by Cucumber.
69
- # It should be set by a program that reads a message stream and does the following for
70
- # each Attachment message:
68
+ # A URL where the attachment can be retrieved. This field should not be set by Cucumber.
69
+ # It should be set by a program that reads a message stream and does the following for
70
+ # each Attachment message:
71
71
  #
72
- # - Writes the body (after base64 decoding if necessary) to a new file.
73
- # - Sets `body` and `contentEncoding` to `null`
74
- # - Writes out the new attachment message
72
+ # - Writes the body (after base64 decoding if necessary) to a new file.
73
+ # - Sets `body` and `contentEncoding` to `null`
74
+ # - Writes out the new attachment message
75
75
  #
76
- # This will result in a smaller message stream, which can improve performance and
77
- # reduce bandwidth of message consumers. It also makes it easier to process and download attachments
78
- # separately from reports.
76
+ # This will result in a smaller message stream, which can improve performance and
77
+ # reduce bandwidth of message consumers. It also makes it easier to process and download attachments
78
+ # separately from reports.
79
79
  ##
80
80
  attr_reader :url
81
81
 
82
+ ##
83
+ # Not used; implementers should instead populate `testRunHookStartedId` if an attachment was created during the execution of a test run hook
84
+ ##
82
85
  attr_reader :test_run_started_id
83
86
 
87
+ ##
88
+ # The identifier of the test run hook execution if the attachment was created during the execution of a test run hook
89
+ ##
90
+ attr_reader :test_run_hook_started_id
91
+
92
+ ##
93
+ # When the attachment was created
94
+ ##
95
+ attr_reader :timestamp
96
+
84
97
  def initialize(
85
98
  body: '',
86
99
  content_encoding: AttachmentContentEncoding::IDENTITY,
@@ -90,7 +103,9 @@ module Cucumber
90
103
  test_case_started_id: nil,
91
104
  test_step_id: nil,
92
105
  url: nil,
93
- test_run_started_id: nil
106
+ test_run_started_id: nil,
107
+ test_run_hook_started_id: nil,
108
+ timestamp: nil
94
109
  )
95
110
  @body = body
96
111
  @content_encoding = content_encoding
@@ -101,6 +116,8 @@ module Cucumber
101
116
  @test_step_id = test_step_id
102
117
  @url = url
103
118
  @test_run_started_id = test_run_started_id
119
+ @test_run_hook_started_id = test_run_hook_started_id
120
+ @timestamp = timestamp
104
121
  super()
105
122
  end
106
123
 
@@ -123,7 +140,9 @@ module Cucumber
123
140
  test_case_started_id: hash[:testCaseStartedId],
124
141
  test_step_id: hash[:testStepId],
125
142
  url: hash[:url],
126
- test_run_started_id: hash[:testRunStartedId]
143
+ test_run_started_id: hash[:testRunStartedId],
144
+ test_run_hook_started_id: hash[:testRunHookStartedId],
145
+ timestamp: Timestamp.from_h(hash[:timestamp])
127
146
  )
128
147
  end
129
148
  end
@@ -7,8 +7,7 @@ module Cucumber
7
7
  # Represents the Comment message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # A comment in a Gherkin document
10
+ # A comment in a Gherkin document
12
11
  ##
13
12
  class Comment < Message
14
13
  ##
@@ -8,16 +8,16 @@ module Cucumber
8
8
  ##
9
9
  #
10
10
  # The structure is pretty close of the Timestamp one. For clarity, a second type
11
- # of message is used.
11
+ # of message is used.
12
12
  ##
13
13
  class Duration < Message
14
14
  attr_reader :seconds
15
15
 
16
16
  ##
17
17
  # Non-negative fractions of a second at nanosecond resolution. Negative
18
- # second values with fractions must still have non-negative nanos values
19
- # that count forward in time. Must be from 0 to 999,999,999
20
- # inclusive.
18
+ # second values with fractions must still have non-negative nanos values
19
+ # that count forward in time. Must be from 0 to 999,999,999
20
+ # inclusive.
21
21
  ##
22
22
  attr_reader :nanos
23
23
 
@@ -6,14 +6,6 @@ module Cucumber
6
6
  ##
7
7
  # Represents the Envelope message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
- #
10
- # When removing a field, replace it with reserved, rather than deleting the line.
11
- # When adding a field, add it to the end and increment the number by one.
12
- # See https://developers.google.com/protocol-buffers/docs/proto#updating for details
13
- #
14
- # *
15
- # All the messages that are passed between different components/processes are Envelope
16
- # messages.
17
9
  ##
18
10
  class Envelope < Message
19
11
  attr_reader :attachment
@@ -30,6 +22,8 @@ module Cucumber
30
22
 
31
23
  attr_reader :pickle
32
24
 
25
+ attr_reader :suggestion
26
+
33
27
  attr_reader :source
34
28
 
35
29
  attr_reader :step_definition
@@ -62,6 +56,7 @@ module Cucumber
62
56
  parameter_type: nil,
63
57
  parse_error: nil,
64
58
  pickle: nil,
59
+ suggestion: nil,
65
60
  source: nil,
66
61
  step_definition: nil,
67
62
  test_case: nil,
@@ -82,6 +77,7 @@ module Cucumber
82
77
  @parameter_type = parameter_type
83
78
  @parse_error = parse_error
84
79
  @pickle = pickle
80
+ @suggestion = suggestion
85
81
  @source = source
86
82
  @step_definition = step_definition
87
83
  @test_case = test_case
@@ -115,6 +111,7 @@ module Cucumber
115
111
  parameter_type: ParameterType.from_h(hash[:parameterType]),
116
112
  parse_error: ParseError.from_h(hash[:parseError]),
117
113
  pickle: Pickle.from_h(hash[:pickle]),
114
+ suggestion: Suggestion.from_h(hash[:suggestion]),
118
115
  source: Source.from_h(hash[:source]),
119
116
  step_definition: StepDefinition.from_h(hash[:stepDefinition]),
120
117
  test_case: TestCase.from_h(hash[:testCase]),
@@ -7,8 +7,7 @@ module Cucumber
7
7
  # Represents the FeatureChild message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # A child node of a `Feature` node
10
+ # A child node of a `Feature` node
12
11
  ##
13
12
  class FeatureChild < Message
14
13
  attr_reader :rule
@@ -7,19 +7,17 @@ module Cucumber
7
7
  # Represents the GherkinDocument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # The [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of a Gherkin document.
12
- # Cucumber implementations should *not* depend on `GherkinDocument` or any of its
13
- # children for execution - use [Pickle](#io.cucumber.messages.Pickle) instead.
10
+ # The [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of a Gherkin document.
11
+ # Cucumber implementations should *not* depend on `GherkinDocument` or any of its
12
+ # children for execution - use [Pickle](#io.cucumber.messages.Pickle) instead.
14
13
  #
15
- # The only consumers of `GherkinDocument` should only be formatters that produce
16
- # "rich" output, resembling the original Gherkin document.
14
+ # The only consumers of `GherkinDocument` should only be formatters that produce
15
+ # "rich" output, resembling the original Gherkin document.
17
16
  ##
18
17
  class GherkinDocument < Message
19
18
  ##
20
- # *
21
- # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
22
- # of the source, typically a file path relative to the root directory
19
+ # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
20
+ # of the source, typically a file path relative to the root directory
23
21
  ##
24
22
  attr_reader :uri
25
23
 
@@ -8,7 +8,7 @@ module Cucumber
8
8
  ##
9
9
  #
10
10
  # Information about Git, provided by the Build/CI server as environment
11
- # variables.
11
+ # variables.
12
12
  ##
13
13
  class Git < Message
14
14
  attr_reader :remote
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cucumber
4
+ module Messages
5
+ module Helpers
6
+ module TestStepResultComparator
7
+ def test_step_result_rankings
8
+ {
9
+ TestStepResultStatus::UNKNOWN => 0,
10
+ TestStepResultStatus::PASSED => 1,
11
+ TestStepResultStatus::SKIPPED => 2,
12
+ TestStepResultStatus::PENDING => 3,
13
+ TestStepResultStatus::UNDEFINED => 4,
14
+ TestStepResultStatus::AMBIGUOUS => 5,
15
+ TestStepResultStatus::FAILED => 6
16
+ }
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -7,23 +7,11 @@ module Cucumber
7
7
  NANOSECONDS_PER_SECOND = 1_000_000_000
8
8
 
9
9
  def time_to_timestamp(time)
10
- { 'seconds' => time.to_i, 'nanos' => time.nsec }
10
+ Cucumber::Messages::Timestamp.new(seconds: time.to_i, nanos: time.nsec)
11
11
  end
12
12
 
13
13
  def timestamp_to_time(timestamp)
14
- Time.at(timestamp['seconds'] + (timestamp['nanos'].to_f / NANOSECONDS_PER_SECOND))
15
- end
16
-
17
- def seconds_to_duration(seconds_float)
18
- seconds, second_modulus = seconds_float.divmod(1)
19
- nanos = second_modulus * NANOSECONDS_PER_SECOND
20
- { 'seconds' => seconds, 'nanos' => nanos.to_i }
21
- end
22
-
23
- def duration_to_seconds(duration)
24
- seconds_part = duration['seconds']
25
- nanos_part = duration['nanos'].to_f / NANOSECONDS_PER_SECOND
26
- seconds_part + nanos_part
14
+ Time.at(timestamp.seconds, timestamp.nanos, :nanosecond)
27
15
  end
28
16
  end
29
17
  end
@@ -7,8 +7,7 @@ module Cucumber
7
7
  # Represents the Location message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # Points to a line and a column in a text file
10
+ # Points to a line and a column in a text file
12
11
  ##
13
12
  class Location < Message
14
13
  attr_reader :line
@@ -7,14 +7,12 @@ module Cucumber
7
7
  # Represents the Meta message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # This message contains meta information about the environment. Consumers can use
12
- # this for various purposes.
10
+ # This message contains meta information about the environment. Consumers can use
11
+ # this for various purposes.
13
12
  ##
14
13
  class Meta < Message
15
14
  ##
16
- # *
17
- # The [SEMVER](https://semver.org/) version number of the protocol
15
+ # The [SEMVER](https://semver.org/) version number of the protocol
18
16
  ##
19
17
  attr_reader :protocol_version
20
18
 
@@ -7,24 +7,20 @@ module Cucumber
7
7
  # Represents the Pickle message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # //// Pickles
10
+ # A `Pickle` represents a template for a `TestCase`. It is typically derived
11
+ # from another format, such as [GherkinDocument](#io.cucumber.messages.GherkinDocument).
12
+ # In the future a `Pickle` may be derived from other formats such as Markdown or
13
+ # Excel files.
11
14
  #
12
- # *
13
- # A `Pickle` represents a template for a `TestCase`. It is typically derived
14
- # from another format, such as [GherkinDocument](#io.cucumber.messages.GherkinDocument).
15
- # In the future a `Pickle` may be derived from other formats such as Markdown or
16
- # Excel files.
15
+ # By making `Pickle` the main data structure Cucumber uses for execution, the
16
+ # implementation of Cucumber itself becomes simpler, as it doesn't have to deal
17
+ # with the complex structure of a [GherkinDocument](#io.cucumber.messages.GherkinDocument).
17
18
  #
18
- # By making `Pickle` the main data structure Cucumber uses for execution, the
19
- # implementation of Cucumber itself becomes simpler, as it doesn't have to deal
20
- # with the complex structure of a [GherkinDocument](#io.cucumber.messages.GherkinDocument).
21
- #
22
- # Each `PickleStep` of a `Pickle` is matched with a `StepDefinition` to create a `TestCase`
19
+ # Each `PickleStep` of a `Pickle` is matched with a `StepDefinition` to create a `TestCase`
23
20
  ##
24
21
  class Pickle < Message
25
22
  ##
26
- # *
27
- # A unique id for the pickle
23
+ # A unique id for the pickle
28
24
  ##
29
25
  attr_reader :id
30
26
 
@@ -33,6 +29,11 @@ module Cucumber
33
29
  ##
34
30
  attr_reader :uri
35
31
 
32
+ ##
33
+ # The location of this pickle in source file. A pickle constructed from `Examples` will point to the example row.
34
+ ##
35
+ attr_reader :location
36
+
36
37
  ##
37
38
  # The name of the pickle
38
39
  ##
@@ -49,23 +50,22 @@ module Cucumber
49
50
  attr_reader :steps
50
51
 
51
52
  ##
52
- # *
53
- # One or more tags. If this pickle is constructed from a Gherkin document,
54
- # It includes inherited tags from the `Feature` as well.
53
+ # One or more tags. If this pickle is constructed from a Gherkin document,
54
+ # It includes inherited tags from the `Feature` as well.
55
55
  ##
56
56
  attr_reader :tags
57
57
 
58
58
  ##
59
- # *
60
- # Points to the AST node locations of the pickle. The last one represents the unique
61
- # id of the pickle. A pickle constructed from `Examples` will have the first
62
- # id originating from the `Scenario` AST node, and the second from the `TableRow` AST node.
59
+ # Points to the AST node locations of the pickle. The last one represents the unique
60
+ # id of the pickle. A pickle constructed from `Examples` will have the first
61
+ # id originating from the `Scenario` AST node, and the second from the `TableRow` AST node.
63
62
  ##
64
63
  attr_reader :ast_node_ids
65
64
 
66
65
  def initialize(
67
66
  id: '',
68
67
  uri: '',
68
+ location: nil,
69
69
  name: '',
70
70
  language: '',
71
71
  steps: [],
@@ -74,6 +74,7 @@ module Cucumber
74
74
  )
75
75
  @id = id
76
76
  @uri = uri
77
+ @location = location
77
78
  @name = name
78
79
  @language = language
79
80
  @steps = steps
@@ -95,6 +96,7 @@ module Cucumber
95
96
  new(
96
97
  id: hash[:id],
97
98
  uri: hash[:uri],
99
+ location: Location.from_h(hash[:location]),
98
100
  name: hash[:name],
99
101
  language: hash[:language],
100
102
  steps: hash[:steps]&.map { |item| PickleStep.from_h(item) },
@@ -7,15 +7,14 @@ module Cucumber
7
7
  # Represents the PickleStep message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # An executable step
10
+ # An executable step
12
11
  ##
13
12
  class PickleStep < Message
14
13
  attr_reader :argument
15
14
 
16
15
  ##
17
16
  # References the IDs of the source of the step. For Gherkin, this can be
18
- # the ID of a Step, and possibly also the ID of a TableRow
17
+ # the ID of a Step, and possibly also the ID of a TableRow
19
18
  ##
20
19
  attr_reader :ast_node_ids
21
20
 
@@ -7,8 +7,7 @@ module Cucumber
7
7
  # Represents the PickleTag message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # A tag
10
+ # A tag
12
11
  ##
13
12
  class PickleTag < Message
14
13
  attr_reader :name
@@ -7,8 +7,7 @@ module Cucumber
7
7
  # Represents the RuleChild message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # A child node of a `Rule` node
10
+ # A child node of a `Rule` node
12
11
  ##
13
12
  class RuleChild < Message
14
13
  attr_reader :background
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Snippet message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ ##
10
+ class Snippet < Message
11
+ ##
12
+ # The programming language of the code.
13
+ #
14
+ # This must be formatted as an all lowercase identifier such that syntax highlighters like [Prism](https://prismjs.com/#supported-languages) or [Highlight.js](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) can recognize it.
15
+ # For example: `cpp`, `cs`, `go`, `java`, `javascript`, `php`, `python`, `ruby`, `scala`.
16
+ ##
17
+ attr_reader :language
18
+
19
+ ##
20
+ # A snippet of code
21
+ ##
22
+ attr_reader :code
23
+
24
+ def initialize(
25
+ language: '',
26
+ code: ''
27
+ )
28
+ @language = language
29
+ @code = code
30
+ super()
31
+ end
32
+
33
+ ##
34
+ # Returns a new Snippet from the given hash.
35
+ # If the hash keys are camelCased, they are properly assigned to the
36
+ # corresponding snake_cased attributes.
37
+ #
38
+ # Cucumber::Messages::Snippet.from_h(some_hash) # => #<Cucumber::Messages::Snippet:0x... ...>
39
+ ##
40
+ def self.from_h(hash)
41
+ return nil if hash.nil?
42
+
43
+ new(
44
+ language: hash[:language],
45
+ code: hash[:code]
46
+ )
47
+ end
48
+ end
49
+ end
50
+ end
@@ -7,16 +7,12 @@ module Cucumber
7
7
  # Represents the Source message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # //// Source
11
- #
12
- # *
13
- # A source file, typically a Gherkin document or Java/Ruby/JavaScript source code
10
+ # A source file, typically a Gherkin document or Java/Ruby/JavaScript source code
14
11
  ##
15
12
  class Source < Message
16
13
  ##
17
- # *
18
- # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
19
- # of the source, typically a file path relative to the root directory
14
+ # The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)
15
+ # of the source, typically a file path relative to the root directory
20
16
  ##
21
17
  attr_reader :uri
22
18
 
@@ -27,7 +23,7 @@ module Cucumber
27
23
 
28
24
  ##
29
25
  # The media type of the file. Can be used to specify custom types, such as
30
- # text/x.cucumber.gherkin+plain
26
+ # text/x.cucumber.gherkin+plain
31
27
  ##
32
28
  attr_reader :media_type
33
29
 
@@ -7,9 +7,8 @@ module Cucumber
7
7
  # Represents the SourceReference message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # Points to a [Source](#io.cucumber.messages.Source) identified by `uri` and a
12
- # [Location](#io.cucumber.messages.Location) within that file.
10
+ # Points to a [Source](#io.cucumber.messages.Source) identified by `uri` and a
11
+ # [Location](#io.cucumber.messages.Location) within that file.
13
12
  ##
14
13
  class SourceReference < Message
15
14
  attr_reader :uri
@@ -7,19 +7,17 @@ module Cucumber
7
7
  # Represents the StepMatchArgument message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # Represents a single argument extracted from a step match and passed to a step definition.
12
- # This is used for the following purposes:
13
- # - Construct an argument to pass to a step definition (possibly through a parameter type transform)
14
- # - Highlight the matched parameter in rich formatters such as the HTML formatter
10
+ # Represents a single argument extracted from a step match and passed to a step definition.
11
+ # This is used for the following purposes:
12
+ # - Construct an argument to pass to a step definition (possibly through a parameter type transform)
13
+ # - Highlight the matched parameter in rich formatters such as the HTML formatter
15
14
  #
16
- # This message closely matches the `Argument` class in the `cucumber-expressions` library.
15
+ # This message closely matches the `Argument` class in the `cucumber-expressions` library.
17
16
  ##
18
17
  class StepMatchArgument < Message
19
18
  ##
20
- # *
21
- # Represents the outermost capture group of an argument. This message closely matches the
22
- # `Group` class in the `cucumber-expressions` library.
19
+ # Represents the outermost capture group of an argument. This message closely matches the
20
+ # `Group` class in the `cucumber-expressions` library.
23
21
  ##
24
22
  attr_reader :group
25
23
 
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The code was auto-generated by {this script}[https://github.com/cucumber/messages/blob/main/codegen/codegen.rb]
4
+ module Cucumber
5
+ module Messages
6
+ ##
7
+ # Represents the Suggestion message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
+ ##
9
+ #
10
+ # A suggested fragment of code to implement an undefined step
11
+ ##
12
+ class Suggestion < Message
13
+ ##
14
+ # A unique id for this suggestion
15
+ ##
16
+ attr_reader :id
17
+
18
+ ##
19
+ # The ID of the `PickleStep` this `Suggestion` was created for.
20
+ ##
21
+ attr_reader :pickle_step_id
22
+
23
+ ##
24
+ # A collection of code snippets that could implement the undefined step
25
+ ##
26
+ attr_reader :snippets
27
+
28
+ def initialize(
29
+ id: '',
30
+ pickle_step_id: '',
31
+ snippets: []
32
+ )
33
+ @id = id
34
+ @pickle_step_id = pickle_step_id
35
+ @snippets = snippets
36
+ super()
37
+ end
38
+
39
+ ##
40
+ # Returns a new Suggestion from the given hash.
41
+ # If the hash keys are camelCased, they are properly assigned to the
42
+ # corresponding snake_cased attributes.
43
+ #
44
+ # Cucumber::Messages::Suggestion.from_h(some_hash) # => #<Cucumber::Messages::Suggestion:0x... ...>
45
+ ##
46
+ def self.from_h(hash)
47
+ return nil if hash.nil?
48
+
49
+ new(
50
+ id: hash[:id],
51
+ pickle_step_id: hash[:pickleStepId],
52
+ snippets: hash[:snippets]&.map { |item| Snippet.from_h(item) }
53
+ )
54
+ end
55
+ end
56
+ end
57
+ end
@@ -7,8 +7,7 @@ module Cucumber
7
7
  # Represents the Tag message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # A tag
10
+ # A tag
12
11
  ##
13
12
  class Tag < Message
14
13
  ##
@@ -7,10 +7,7 @@ module Cucumber
7
7
  # Represents the TestCase message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # //// TestCases
11
- #
12
- # *
13
- # A `TestCase` contains a sequence of `TestStep`s.
10
+ # A `TestCase` contains a sequence of `TestStep`s.
14
11
  ##
15
12
  class TestCase < Message
16
13
  attr_reader :id
@@ -9,16 +9,14 @@ module Cucumber
9
9
  ##
10
10
  class TestCaseStarted < Message
11
11
  ##
12
- # *
13
- # The first attempt should have value 0, and for each retry the value
14
- # should increase by 1.
12
+ # The first attempt should have value 0, and for each retry the value
13
+ # should increase by 1.
15
14
  ##
16
15
  attr_reader :attempt
17
16
 
18
17
  ##
19
- # *
20
- # Because a `TestCase` can be run multiple times (in case of a retry),
21
- # we use this field to group messages relating to the same attempt.
18
+ # Because a `TestCase` can be run multiple times (in case of a retry),
19
+ # we use this field to group messages relating to the same attempt.
22
20
  ##
23
21
  attr_reader :id
24
22
 
@@ -23,17 +23,24 @@ module Cucumber
23
23
  ##
24
24
  attr_reader :hook_id
25
25
 
26
+ ##
27
+ # An identifier for the worker process running this hook, if parallel workers are in use. 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.
28
+ ##
29
+ attr_reader :worker_id
30
+
26
31
  attr_reader :timestamp
27
32
 
28
33
  def initialize(
29
34
  id: '',
30
35
  test_run_started_id: '',
31
36
  hook_id: '',
37
+ worker_id: nil,
32
38
  timestamp: Timestamp.new
33
39
  )
34
40
  @id = id
35
41
  @test_run_started_id = test_run_started_id
36
42
  @hook_id = hook_id
43
+ @worker_id = worker_id
37
44
  @timestamp = timestamp
38
45
  super()
39
46
  end
@@ -52,6 +59,7 @@ module Cucumber
52
59
  id: hash[:id],
53
60
  test_run_started_id: hash[:testRunStartedId],
54
61
  hook_id: hash[:hookId],
62
+ worker_id: hash[:workerId],
55
63
  timestamp: Timestamp.from_h(hash[:timestamp])
56
64
  )
57
65
  end
@@ -7,9 +7,11 @@ module Cucumber
7
7
  # Represents the TestStep message in Cucumber's {message protocol}[https://github.com/cucumber/messages].
8
8
  ##
9
9
  #
10
- # *
11
- # A `TestStep` is derived from either a `PickleStep`
12
- # combined with a `StepDefinition`, or from a `Hook`.
10
+ # A `TestStep` is derived from either a `PickleStep` combined with a `StepDefinition`, or from a `Hook`.
11
+ #
12
+ # When derived from a PickleStep:
13
+ # * For `UNDEFINED` steps `stepDefinitionIds` and `stepMatchArgumentsLists` will be empty.
14
+ # * For `AMBIGUOUS` steps, there will be multiple entries in `stepDefinitionIds` and `stepMatchArgumentsLists`. The first entry in the stepMatchArgumentsLists holds the list of arguments for the first matching step definition, the second entry for the second, etc
13
15
  ##
14
16
  class TestStep < Message
15
17
  ##
@@ -25,14 +27,16 @@ module Cucumber
25
27
  attr_reader :pickle_step_id
26
28
 
27
29
  ##
28
- # Pointer to all the matching `StepDefinition`s (if derived from a `PickleStep`)
29
- # Each element represents a matching step definition. A size of 0 means `UNDEFINED`,
30
- # and a size of 2+ means `AMBIGUOUS`
30
+ # Pointer to all the matching `StepDefinition`s (if derived from a `PickleStep`).
31
+ #
32
+ # Each element represents a matching step definition.
31
33
  ##
32
34
  attr_reader :step_definition_ids
33
35
 
34
36
  ##
35
37
  # A list of list of StepMatchArgument (if derived from a `PickleStep`).
38
+ #
39
+ # Each element represents the arguments for a matching step definition.
36
40
  ##
37
41
  attr_reader :step_match_arguments_lists
38
42
 
@@ -11,7 +11,7 @@ module Cucumber
11
11
  attr_reader :duration
12
12
 
13
13
  ##
14
- # An arbitrary bit of information that explains this result. This can be a stack trace of anything else.
14
+ # An arbitrary bit of information that explains this result. If there was an exception, this should include a stringified representation of it including type, message and stack trace (the exact format will vary by platform).
15
15
  ##
16
16
  attr_reader :message
17
17
 
@@ -10,16 +10,16 @@ module Cucumber
10
10
  class Timestamp < Message
11
11
  ##
12
12
  # Represents seconds of UTC time since Unix epoch
13
- # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
14
- # 9999-12-31T23:59:59Z inclusive.
13
+ # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
14
+ # 9999-12-31T23:59:59Z inclusive.
15
15
  ##
16
16
  attr_reader :seconds
17
17
 
18
18
  ##
19
19
  # Non-negative fractions of a second at nanosecond resolution. Negative
20
- # second values with fractions must still have non-negative nanos values
21
- # that count forward in time. Must be from 0 to 999,999,999
22
- # inclusive.
20
+ # second values with fractions must still have non-negative nanos values
21
+ # that count forward in time. Must be from 0 to 999,999,999
22
+ # inclusive.
23
23
  ##
24
24
  attr_reader :nanos
25
25
 
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cucumber/messages/helpers/id_generator'
3
4
  require 'cucumber/messages/helpers/ndjson_to_message_enumerator'
5
+ require 'cucumber/messages/helpers/test_step_result_comparator'
4
6
  require 'cucumber/messages/helpers/time_conversion'
5
- require 'cucumber/messages/helpers/id_generator'
7
+
6
8
  require 'cucumber/messages/message'
7
9
 
8
10
  Dir["#{File.dirname(__FILE__)}/messages/*.rb"].each { |file| require file }
metadata CHANGED
@@ -1,29 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-messages
3
3
  version: !ruby/object:Gem::Version
4
- version: 27.2.0
4
+ version: 31.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-01-31 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: cucumber-compatibility-kit
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '15.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '15.0'
27
12
  - !ruby/object:Gem::Dependency
28
13
  name: rake
29
14
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +43,28 @@ dependencies:
58
43
  requirements:
59
44
  - - "~>"
60
45
  - !ruby/object:Gem::Version
61
- version: 1.71.0
46
+ version: 1.80.0
62
47
  type: :development
63
48
  prerelease: false
64
49
  version_requirements: !ruby/object:Gem::Requirement
65
50
  requirements:
66
51
  - - "~>"
67
52
  - !ruby/object:Gem::Version
68
- version: 1.71.0
53
+ version: 1.80.0
69
54
  - !ruby/object:Gem::Dependency
70
55
  name: rubocop-performance
71
56
  requirement: !ruby/object:Gem::Requirement
72
57
  requirements:
73
58
  - - "~>"
74
59
  - !ruby/object:Gem::Version
75
- version: 1.23.0
60
+ version: 1.24.0
76
61
  type: :development
77
62
  prerelease: false
78
63
  version_requirements: !ruby/object:Gem::Requirement
79
64
  requirements:
80
65
  - - "~>"
81
66
  - !ruby/object:Gem::Version
82
- version: 1.23.0
67
+ version: 1.24.0
83
68
  - !ruby/object:Gem::Dependency
84
69
  name: rubocop-rake
85
70
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +85,14 @@ dependencies:
100
85
  requirements:
101
86
  - - "~>"
102
87
  - !ruby/object:Gem::Version
103
- version: 3.4.0
88
+ version: 3.7.0
104
89
  type: :development
105
90
  prerelease: false
106
91
  version_requirements: !ruby/object:Gem::Requirement
107
92
  requirements:
108
93
  - - "~>"
109
94
  - !ruby/object:Gem::Version
110
- version: 3.4.0
95
+ version: 3.7.0
111
96
  description: JSON schema-based messages for Cucumber's inter-process communication
112
97
  email: cukes@googlegroups.com
113
98
  executables: []
@@ -138,6 +123,7 @@ files:
138
123
  - lib/cucumber/messages/helpers/id_generator/incrementing.rb
139
124
  - lib/cucumber/messages/helpers/id_generator/uuid.rb
140
125
  - lib/cucumber/messages/helpers/ndjson_to_message_enumerator.rb
126
+ - lib/cucumber/messages/helpers/test_step_result_comparator.rb
141
127
  - lib/cucumber/messages/helpers/time_conversion.rb
142
128
  - lib/cucumber/messages/hook.rb
143
129
  - lib/cucumber/messages/hook_type.rb
@@ -161,6 +147,7 @@ files:
161
147
  - lib/cucumber/messages/rule.rb
162
148
  - lib/cucumber/messages/rule_child.rb
163
149
  - lib/cucumber/messages/scenario.rb
150
+ - lib/cucumber/messages/snippet.rb
164
151
  - lib/cucumber/messages/source.rb
165
152
  - lib/cucumber/messages/source_media_type.rb
166
153
  - lib/cucumber/messages/source_reference.rb
@@ -171,6 +158,7 @@ files:
171
158
  - lib/cucumber/messages/step_keyword_type.rb
172
159
  - lib/cucumber/messages/step_match_argument.rb
173
160
  - lib/cucumber/messages/step_match_arguments_list.rb
161
+ - lib/cucumber/messages/suggestion.rb
174
162
  - lib/cucumber/messages/table_cell.rb
175
163
  - lib/cucumber/messages/table_row.rb
176
164
  - lib/cucumber/messages/tag.rb
@@ -197,7 +185,6 @@ metadata:
197
185
  documentation_uri: https://www.rubydoc.info/github/cucumber/messages
198
186
  mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
199
187
  source_code_uri: https://github.com/cucumber/messages
200
- post_install_message:
201
188
  rdoc_options:
202
189
  - "--charset=UTF-8"
203
190
  require_paths:
@@ -206,15 +193,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
193
  requirements:
207
194
  - - ">="
208
195
  - !ruby/object:Gem::Version
209
- version: '3.0'
196
+ version: '3.2'
210
197
  required_rubygems_version: !ruby/object:Gem::Requirement
211
198
  requirements:
212
199
  - - ">="
213
200
  - !ruby/object:Gem::Version
214
- version: 3.2.3
201
+ version: 3.2.8
215
202
  requirements: []
216
- rubygems_version: 3.5.22
217
- signing_key:
203
+ rubygems_version: 3.6.9
218
204
  specification_version: 4
219
- summary: cucumber-messages-27.2.0
205
+ summary: cucumber-messages-31.1.0
220
206
  test_files: []