Class: Inferno::Entities::TestSuite
- Inherits:
-
Object
- Object
- Inferno::Entities::TestSuite
- Extended by:
- Forwardable, DSL::FHIRClient::ClassMethods, DSL::HTTPClient::ClassMethods, DSL::Runnable
- Includes:
- DSL::FHIRResourceValidation, DSL::FHIRValidation
- Defined in:
- lib/inferno/entities/test_suite.rb
Overview
A TestSuite represents a packaged group of tests, usually for a single Implementation Guide
Constant Summary
Constants included from DSL::Runnable
DSL::Runnable::VARIABLES_NOT_TO_COPY
Instance Attribute Summary
Attributes included from DSL::Runnable
#parent, #suite_option_requirements
Class Method Summary collapse
-
.check_configuration(&block) ⇒ void
Provide a block which will verify any configuration needed for this test suite to operate properly.
- .configuration_messages(new_messages = nil, force_recheck: false) ⇒ Object
- .default_group ⇒ Object
-
.group ⇒ void
Add a child group.
- .group_metadata ⇒ Object
-
.groups(options = nil) ⇒ Array<Inferno::Entities::TestGroup>
Get this suite’s child groups, filtered by suite options, if provided.
-
.links(links = nil) ⇒ Array<Hash>?
Set/get a list of links which are displayed in the footer of the UI.
- .presets ⇒ Object
- .reference_hash ⇒ Object
- .repository ⇒ Object
-
.suite_option(identifier, **option_params) ⇒ void
Define an option for this suite.
-
.suite_options ⇒ Array<Inferno::DSL::SuiteOption>
The options defined for this suite.
-
.suite_summary(suite_summary = nil) ⇒ String?
Set/get a description which for this test suite which will be displayed in the UI.
-
.version(version = nil) ⇒ String?
Set/get the version of this test suite.
Methods included from DSL::Runnable
add_self_to_repository, all_children, child_metadata, children, configure_child_class, copy_instance_variables, create_child_class, default_id, define_child, description, extended, handle_child_definition_block, id, input_instructions, inspect, optional, optional?, process_args, repository, required, required?, required_suite_options, resume_test_route, route, short_description, short_title, suite, suite_endpoint, test_count, title, user_runnable?
Methods included from Utils::MarkdownFormatter
Methods included from DSL::FHIRClient::ClassMethods
fhir_client, fhir_client_definitions
Methods included from DSL::HTTPClient::ClassMethods
http_client, http_client_definitions
Methods included from DSL::FHIRResourceValidation
Methods included from DSL::FHIRValidation
#find_validator, included, #resource_is_valid?
Class Method Details
.check_configuration(&block) ⇒ void
This method returns an undefined value.
Provide a block which will verify any configuration needed for this test suite to operate properly.
100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/inferno/entities/test_suite.rb', line 100 def check_configuration(&block) @check_configuration_block = lambda do block.call&.each do || case [:type] when 'warning' Application[:logger].warn([:message]) when 'error' Application[:logger].error([:message]) end end end end |
.configuration_messages(new_messages = nil, force_recheck: false) ⇒ Object
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/inferno/entities/test_suite.rb', line 82 def ( = nil, force_recheck: false) return @configuration_messages = unless .nil? @configuration_messages = if force_recheck @check_configuration_block ? @check_configuration_block.call : [] else @configuration_messages || (@check_configuration_block ? @check_configuration_block.call : []) end end |
.default_group ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/inferno/entities/test_suite.rb', line 24 def default_group return @default_group if @default_group @default_group = Class.new(TestGroup) all_children << @default_group @default_group end |
.group ⇒ void
This method returns an undefined value.
Add a child group
50 51 52 53 |
# File 'lib/inferno/entities/test_suite.rb', line 50 def group(...) () define_child(...) end |
.group_metadata ⇒ Object
56 57 58 59 60 61 |
# File 'lib/inferno/entities/test_suite.rb', line 56 def { class: TestGroup, repo: Inferno::Repositories::TestGroups.new } end |
.groups(options = nil) ⇒ Array<Inferno::Entities::TestGroup>
Get this suite’s child groups, filtered by suite options, if provided.
42 43 44 |
# File 'lib/inferno/entities/test_suite.rb', line 42 def groups( = nil) children().select { |child| child < Inferno::Entities::TestGroup } end |
.links(links = nil) ⇒ Array<Hash>?
Set/get a list of links which are displayed in the footer of the UI.
179 180 181 182 183 |
# File 'lib/inferno/entities/test_suite.rb', line 179 def links(links = nil) return @links if links.nil? @links = links end |
.presets ⇒ Object
114 115 116 |
# File 'lib/inferno/entities/test_suite.rb', line 114 def presets @presets ||= Repositories::Presets.new.presets_for_suite(id) end |
.reference_hash ⇒ Object
64 65 66 67 68 |
# File 'lib/inferno/entities/test_suite.rb', line 64 def reference_hash { test_suite_id: id } end |
.repository ⇒ Object
33 34 35 |
# File 'lib/inferno/entities/test_suite.rb', line 33 def repository Inferno::Repositories::TestSuites.new end |
.suite_option(identifier, **option_params) ⇒ void
This method returns an undefined value.
Define an option for this suite. Options are used to define suite-wide configuration which is selected by a user at the start of a test session. These options can be used to change what tests/groups are run or behavior within particular tests.
151 152 153 |
# File 'lib/inferno/entities/test_suite.rb', line 151 def suite_option(identifier, **option_params) << DSL::SuiteOption.new(option_params.merge(id: identifier)) end |
.suite_options ⇒ Array<Inferno::DSL::SuiteOption>
157 158 159 |
# File 'lib/inferno/entities/test_suite.rb', line 157 def @suite_options ||= [] end |
.suite_summary(suite_summary = nil) ⇒ String?
Set/get a description which for this test suite which will be displayed in the UI.
191 192 193 194 195 |
# File 'lib/inferno/entities/test_suite.rb', line 191 def suite_summary(suite_summary = nil) return @suite_summary if suite_summary.nil? @suite_summary = format_markdown(suite_summary) end |
.version(version = nil) ⇒ String?
Set/get the version of this test suite.
75 76 77 78 79 |
# File 'lib/inferno/entities/test_suite.rb', line 75 def version(version = nil) return @version if version.nil? @version = version end |