Class: Cucumber::Messages::TestCaseStarted

Inherits:
Message show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Message::Utils

included

Methods included from Message::Serialization

#to_h, #to_json

Methods included from Message::Deserialization

included

Constructor Details

#initialize(attempt: 0, id: '', test_case_id: '', timestamp: Timestamp.new) ⇒ TestCaseStarted

Returns a new instance of TestCaseStarted.



1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1680

def initialize(
  attempt: 0,
  id: '',
  test_case_id: '',
  timestamp: Timestamp.new
)
  @attempt = attempt
  @id = id
  @test_case_id = test_case_id
  @timestamp = timestamp
end

Instance Attribute Details

#attemptObject (readonly)

*

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


1667
1668
1669
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1667

def attempt
  @attempt
end

#idObject (readonly)

*

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.


1674
1675
1676
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1674

def id
  @id
end

#test_case_idObject (readonly)

Returns the value of attribute test_case_id.



1676
1677
1678
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1676

def test_case_id
  @test_case_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



1678
1679
1680
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1678

def timestamp
  @timestamp
end

Class Method Details

.from_h(hash) ⇒ Object

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... ...>


1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 1025

def self.from_h(hash)
  return nil if hash.nil?

  self.new(
    attempt: hash[:attempt],
    id: hash[:id],
    test_case_id: hash[:testCaseId],
    timestamp: Timestamp.from_h(hash[:timestamp]),
  )
end