class Report::Custom

Overview

A custom report format allowing to insert arbitrary content for a test.

The reports must be an array of objects with the keys #name, #category, #status and #content. #status may only have the values failure or success.

Example:

[
  {
    "name": "meinTest",
    "category": "Kategorie",
    "status": "failure",
    "content": "<b>text</b>"
  },
  {
    "name": "meinTest2",
    "category": "Kategorie",
    "status": "success",
    "content": "<b>text</b>"
  }
]

WARNING Using custom reports is discouraged outside of development phases as they are hard to translate or re-theme.

Included Modules

Extended Modules

Defined in:

report/custom.cr

Constructors

Class Method Summary

Instance Method Summary

Macros inherited from module CLI::Macros

footer(text) footer, header(text) header, option(long_flag, description, &block)
option(short_flag, long_flag, description, &block)
option

Instance methods inherited from class Report

category : String category, id : Int32 id, name : String name, render(io : IO) : Nil render, status : Status status

Class methods inherited from class Report

create_sequential_id : Int32 create_sequential_id

Macros inherited from class Report

patterns(*filenames) patterns

Constructor Detail

def self.new(category : String, name : String, status : Status, content : String) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Class Method Detail

def self.from_path(path : Path) : Enumerable(Report) #

[View source]
def self.is_candidate?(filename : String) : Bool #

[View source]

Instance Method Detail

def category : String #
Description copied from class Report

The category this report is grouped in.

The string should be below ~20 characters to prevent the sidebar from overflowing.


[View source]
def content : String #

[View source]
def name : String #
Description copied from class Report

The name displayed for this report.

The string should be below ~20 characters to prevent the sidebar from overflowing.


[View source]
def render(io : IO) : Nil #

A custom report format allowing to insert arbitrary content for a test.

The reports must be an array of objects with the keys #name, #category, #status and #content. #status may only have the values failure or success.

Example:

[
  {
    "name": "meinTest",
    "category": "Kategorie",
    "status": "failure",
    "content": "<b>text</b>"
  },
  {
    "name": "meinTest2",
    "category": "Kategorie",
    "status": "success",
    "content": "<b>text</b>"
  }
]

WARNING Using custom reports is discouraged outside of development phases as they are hard to translate or re-theme.


[View source]
def status : Status #
Description copied from class Report

The status of this report.

This will control the successful-test-count in the report header, filtering options and an indicator next to the test in the sidebar.


[View source]