class Cucumber::Messages::Step
Represents the Step message in Cucumber’s message protocol.
A step
Attributes
Unique ID to be able to reference the Step from PickleStep
The actual keyword as it appeared in the source.
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’.
The location of the steps’ ‘keyword`
Public Class Methods
Source
# File lib/cucumber/messages/step.rb, line 65 def self.from_h(hash) return nil if hash.nil? new( location: Location.from_h(hash[:location]), keyword: hash[:keyword], keyword_type: hash[:keywordType], text: hash[:text], doc_string: DocString.from_h(hash[:docString]), data_table: DataTable.from_h(hash[:dataTable]), id: hash[:id] ) end
Returns a new Step from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::Step.from_h(some_hash) # => #<Cucumber::Messages::Step:0x... ...>
Source
# File lib/cucumber/messages/step.rb, line 39 def initialize( location: Location.new, keyword: '', keyword_type: nil, text: '', doc_string: nil, data_table: nil, id: '' ) @location = location @keyword = keyword @keyword_type = keyword_type @text = text @doc_string = doc_string @data_table = data_table @id = id super() end
Calls superclass method