class Cucumber::Messages::TestCaseStarted

Represents the TestCaseStarted message in Cucumber’s message protocol.

Attributes

attempt[R]

*

The first attempt should have value 0, and for each retry the value
should increase by 1.
id[R]

*

Because a `TestCase` can be run multiple times (in case of a retry),
we use this field to group messages relating to the same attempt.
test_case_id[R]
timestamp[R]
worker_id[R]

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.

Public Class Methods

from_h(hash) click to toggle source

Returns a new TestCaseStarted from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.

Cucumber::Messages::TestCaseStarted.from_h(some_hash) # => #<Cucumber::Messages::TestCaseStarted:0x... ...>
# File lib/cucumber/messages/test_case_started.rb, line 56
def self.from_h(hash)
  return nil if hash.nil?

  new(
    attempt: hash[:attempt],
    id: hash[:id],
    test_case_id: hash[:testCaseId],
    worker_id: hash[:workerId],
    timestamp: Timestamp.from_h(hash[:timestamp])
  )
end
new( attempt: 0, id: '', test_case_id: '', worker_id: nil, timestamp: Timestamp.new ) click to toggle source
Calls superclass method
# File lib/cucumber/messages/test_case_started.rb, line 34
def initialize(
  attempt: 0,
  id: '',
  test_case_id: '',
  worker_id: nil,
  timestamp: Timestamp.new
)
  @attempt = attempt
  @id = id
  @test_case_id = test_case_id
  @worker_id = worker_id
  @timestamp = timestamp
  super()
end