class Cucumber::Messages::TestStep
Represents the TestStep message in Cucumber’s message protocol.
A ‘TestStep` is derived from either a `PickleStep` combined with a `StepDefinition`, or from a `Hook`.
When derived from a PickleStep:
* For `UNDEFINED` steps `stepDefinitionIds` and `stepMatchArgumentsLists` will be empty. * 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
Attributes
Pointer to the ‘Hook` (if derived from a Hook)
Pointer to the ‘PickleStep` (if derived from a `PickleStep`)
Pointer to all the matching ‘StepDefinition`s (if derived from a `PickleStep`).
Each element represents a matching step definition.
A list of list of StepMatchArgument (if derived from a ‘PickleStep`).
Each element represents the arguments for a matching step definition.
Public Class Methods
Source
# File lib/cucumber/messages/test_step.rb, line 65 def self.from_h(hash) return nil if hash.nil? new( hook_id: hash[:hookId], id: hash[:id], pickle_step_id: hash[:pickleStepId], step_definition_ids: hash[:stepDefinitionIds], step_match_arguments_lists: hash[:stepMatchArgumentsLists]&.map { |item| StepMatchArgumentsList.from_h(item) } ) end
Returns a new TestStep from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::TestStep.from_h(some_hash) # => #<Cucumber::Messages::TestStep:0x... ...>
Source
# File lib/cucumber/messages/test_step.rb, line 43 def initialize( hook_id: nil, id: '', pickle_step_id: nil, step_definition_ids: nil, step_match_arguments_lists: nil ) @hook_id = hook_id @id = id @pickle_step_id = pickle_step_id @step_definition_ids = step_definition_ids @step_match_arguments_lists = step_match_arguments_lists super() end
Calls superclass method