Class: Publisher::Helpers::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/allure_report_publisher/lib/helpers/summary.rb

Overview

Test summary table generator

Constant Summary collapse

BEHAVIORS =
"behaviors".freeze
PACKAGES =
"packages".freeze
SUITES =
"suites".freeze
TOTAL =
"total".freeze
MARKDOWN =
"markdown".freeze
ASCII =
"ascii".freeze

Instance Method Summary collapse

Constructor Details

#initialize(report_path, summary_type, table_type = ASCII, flaky_warning_status: false) ⇒ Summary

Summary table generator

Parameters:

  • report_path (String)
  • summary_type (String)
  • markdown (String)
  • flaky_warning_status (Boolean) (defaults to: false)


21
22
23
24
25
26
# File 'lib/allure_report_publisher/lib/helpers/summary.rb', line 21

def initialize(report_path, summary_type, table_type = ASCII, flaky_warning_status: false)
  @report_path = report_path
  @summary_type = summary_type || TOTAL
  @table_type = table_type
  @flaky_warning_status = flaky_warning_status
end

Instance Method Details

#statusString

Test run status emoji

Returns:

  • (String)


50
51
52
# File 'lib/allure_report_publisher/lib/helpers/summary.rb', line 50

def status
  short_summary.last
end

#tableString

Summary table

Returns:

  • (String)


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/allure_report_publisher/lib/helpers/summary.rb', line 31

def table
  summary = if summary_type == TOTAL
              terminal_table { |table| table << short_summary }
            else
              terminal_table do |table|
                expanded_summary.each { |row| table << row }
                table << :separator
                table << short_summary
              end
            end

  return summary.to_s if markdown?

  "```markdown\n#{summary}\n```"
end