Class: Allure::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/allure_ruby_commons/config.rb

Overview

Allure configuration class

Constant Summary collapse

LOGLEVELS =

Returns valid log levels.

Returns:

  • (Array<String>)

    valid log levels

%w[DEBUG INFO WARN ERROR FATAL UNKNOWN].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



25
26
27
28
# File 'lib/allure_ruby_commons/config.rb', line 25

def initialize
  @results_directory = "reports/allure-results"
  @logging_level = LOGLEVELS.index(ENV.fetch("ALLURE_LOG_LEVEL", "INFO")) || Logger::INFO
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def categories
  @categories
end

#clean_results_directoryObject

Returns the value of attribute clean_results_directory.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def clean_results_directory
  @clean_results_directory
end

#environmentString

Allure environment

Returns:

  • (String)


33
34
35
36
37
# File 'lib/allure_ruby_commons/config.rb', line 33

def environment
  return(@environment) if defined?(@environment)

  @environment ||= ENV["ALLURE_ENVIRONMENT"]
end

#environment_propertiesObject

Returns the value of attribute environment_properties.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def environment_properties
  @environment_properties
end

#failure_exceptionClass

Exception class that corresponds to test failure

Returns:

  • (Class)


49
50
51
# File 'lib/allure_ruby_commons/config.rb', line 49

def failure_exception
  @failure_exception ||= RSpec::Expectations::ExpectationNotMetError
end

Returns the value of attribute link_issue_pattern.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def link_issue_pattern
  @link_issue_pattern
end

Returns the value of attribute link_tms_pattern.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def link_tms_pattern
  @link_tms_pattern
end

#loggerLogger

Logger instance

Returns:

  • (Logger)


42
43
44
# File 'lib/allure_ruby_commons/config.rb', line 42

def logger
  @logger ||= Logger.new($stdout, level: logging_level)
end

#logging_levelObject

Returns the value of attribute logging_level.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def logging_level
  @logging_level
end

#results_directoryObject

Returns the value of attribute results_directory.



17
18
19
# File 'lib/allure_ruby_commons/config.rb', line 17

def results_directory
  @results_directory
end