Class: Allure::TestResult

Inherits:
ExecutableItem show all
Defined in:
allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb

Overview

Allure model test result container

Instance Attribute Summary collapse

Attributes inherited from ExecutableItem

#attachments, #description, #description_html, #name, #parameters, #stage, #start, #status, #status_details, #steps, #stop

Instance Method Summary collapse

Methods inherited from JSONable

#==, #to_hash, #to_json

Constructor Details

#initialize(uuid: UUID.generate, history_id: UUID.generate, environment: nil, **options) ⇒ TestResult

Returns a new instance of TestResult.

Parameters:

  • uuid (String) (defaults to: UUID.generate)
  • history_id (String) (defaults to: UUID.generate)
  • environment (String) (defaults to: nil)
  • options (Hash)

Options Hash (**options):



22
23
24
25
26
27
28
29
30
31
32
# File 'allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb', line 22

def initialize(uuid: UUID.generate, history_id: UUID.generate, environment: nil, **options)
  super

  @name = options[:name]
  @uuid = uuid
  @history_id = history_id
  @full_name = options[:full_name] || "Unnamed"
  @labels = options[:labels] || []
  @links = options[:links] || []
  @parameters << Parameter.new("environment", environment) if environment
end

Instance Attribute Details

#full_nameObject

Returns the value of attribute full_name.



34
35
36
# File 'allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb', line 34

def full_name
  @full_name
end

#history_idString

History id

Returns:

  • (String)


44
45
46
# File 'allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb', line 44

def history_id
  Digest::MD5.hexdigest("#{@history_id}#{parameters_string}")
end

#labelsObject

Returns the value of attribute labels.



34
35
36
# File 'allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb', line 34

def labels
  @labels
end

Returns the value of attribute links.



34
35
36
# File 'allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb', line 34

def links
  @links
end

#uuidObject

Returns the value of attribute uuid.



34
35
36
# File 'allure-ruby-commons/lib/allure_ruby_commons/model/test_result.rb', line 34

def uuid
  @uuid
end