class Allure::TestResult

Allure model test result container

Attributes

full_name[RW]
history_id[RW]
labels[RW]
parameters[RW]
uuid[RW]

Public Class Methods

new(uuid: UUID.generate, history_id: UUID.generate, environment: nil, **options) click to toggle source

@param [String] uuid @param [String] history_id @param [String] environment @param [Hash] options @option options [String] :name @option options [String] :full_name @option options [String] :description @option options [String] :description_html @option options [String] :status ('broken') @option options [String] :stage ('scheduled') @option options [Allure::StatusDetails] :status_details @option options [Array<Allure::ExecutableItem>] :steps ([]) @option options [Array<Allure::Label>] :labels ([]) @option options [Array<Allure::Link>] :links ([]) @option options [Array<Allure::Attachment>] :attachments ([]) @option options [Array<Allure::Parameter>] :parameters ([])

Calls superclass method Allure::ExecutableItem::new
# File 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 = Digest::MD5.hexdigest("#{history_id}#{environment}")
  @full_name = options[:full_name] || "Unnamed"
  @labels = options[:labels] || []
  @links = options[:links] || []
  @parameters = updated_parameters(options[:parameters] || [], environment)
end

Private Instance Methods

updated_parameters(parameters, environment) click to toggle source

Test name prefixed with allure environment

@param [Array] parameters @param [String] environment @return [Array]

# File lib/allure_ruby_commons/model/test_result.rb, line 48
def updated_parameters(parameters, environment)
  return parameters unless environment

  parameters << Parameter.new("environment", environment)
end