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
TESTPLAN_PATH =

Returns test plan path env var name.

Returns:

  • (String)

    test plan path env var name

"ALLURE_TESTPLAN_PATH"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

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

Instance Attribute Details

#clean_results_directoryObject

Returns the value of attribute clean_results_directory.



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

def clean_results_directory
  @clean_results_directory
end

Returns the value of attribute link_issue_pattern.



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

def link_issue_pattern
  @link_issue_pattern
end

Returns the value of attribute link_tms_pattern.



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

def link_tms_pattern
  @link_tms_pattern
end

#logging_levelObject

Returns the value of attribute logging_level.



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

def logging_level
  @logging_level
end

#results_directoryObject

Returns the value of attribute results_directory.



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

def results_directory
  @results_directory
end

Instance Method Details

#test_idsArray

Allure id’s of executable tests

Returns:

  • (Array)


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

def test_ids
  @test_ids ||= tests&.map { |test| test[:id] }
end

#test_namesArray

Test names of executable tests

Returns:

  • (Array)


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

def test_names
  @test_names ||= tests&.map { |test| test[:selector] }
end