Class: Inferno::Entities::TestSuite
- Inherits:
-
Object
- Object
- Inferno::Entities::TestSuite
- Extended by:
- Forwardable, DSL::FHIRClient::ClassMethods, DSL::HTTPClient::ClassMethods, DSL::Links, DSL::Runnable
- Includes:
- DSL::Assertions, DSL::FHIRResourceValidation, DSL::FHIRValidation, DSL::FhirpathEvaluation, DSL::Messages, DSL::Results
- 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::Links
Instance Attribute Summary collapse
-
#result_message ⇒ Object
Returns the value of attribute result_message.
-
#results ⇒ Object
Returns the value of attribute results.
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.
-
.group ⇒ void
Add a child group.
-
.groups(options = nil) ⇒ Array<Inferno::Entities::TestGroup>
Get this suite’s child groups, filtered by suite options, if provided.
-
.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.
-
.test_kit ⇒ Inferno::Entities::TestKit
Get the TestKit this suite belongs to.
-
.version(version = nil) ⇒ String?
Set/get the version of this test suite.
Methods included from DSL::Runnable
block, description, id, input_instructions, optional, optional?, required, required?, required_suite_options, resume_test_route, route, short_description, short_title, suite_endpoint, title
Methods included from DSL::Links
add_link, download_url, ig_url, links, report_issue_url, source_code_url
Methods included from DSL::FHIRClient::ClassMethods
Methods included from DSL::HTTPClient::ClassMethods
Methods included from DSL::Messages
Methods included from DSL::Assertions
#assert, #assert_resource_type, #assert_response_content_type, #assert_response_status, #assert_valid_bundle_entries, #assert_valid_http_uri, #assert_valid_json, #assert_valid_resource
Methods included from DSL::Results
#omit, #omit_if, #pass, #pass_if, #skip, #skip_if, #wait
Methods included from DSL::FhirpathEvaluation
Methods included from DSL::FHIRValidation
#find_validator, #resource_is_valid?
Instance Attribute Details
#result_message ⇒ Object
Returns the value of attribute result_message.
28 29 30 |
# File 'lib/inferno/entities/test_suite.rb', line 28 def @result_message end |
#results ⇒ Object
Returns the value of attribute results.
28 29 30 |
# File 'lib/inferno/entities/test_suite.rb', line 28 def results @results end |
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.
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/inferno/entities/test_suite.rb', line 118 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 |
.group ⇒ void
This method returns an undefined value.
Add a child group
67 68 69 70 |
# File 'lib/inferno/entities/test_suite.rb', line 67 def group(...) () define_child(...) end |
.groups(options = nil) ⇒ Array<Inferno::Entities::TestGroup>
Get this suite’s child groups, filtered by suite options, if provided.
59 60 61 |
# File 'lib/inferno/entities/test_suite.rb', line 59 def groups( = nil) children().select { |child| child < Inferno::Entities::TestGroup } 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.
169 170 171 |
# File 'lib/inferno/entities/test_suite.rb', line 169 def suite_option(identifier, **option_params) << DSL::SuiteOption.new(option_params.merge(id: identifier)) end |
.suite_options ⇒ Array<Inferno::DSL::SuiteOption>
Returns The options defined for this suite.
175 176 177 |
# File 'lib/inferno/entities/test_suite.rb', line 175 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.
185 186 187 188 189 |
# File 'lib/inferno/entities/test_suite.rb', line 185 def suite_summary(suite_summary = nil) return @suite_summary if suite_summary.nil? @suite_summary = format_markdown(suite_summary) end |
.test_kit ⇒ Inferno::Entities::TestKit
Get the TestKit this suite belongs to
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/inferno/entities/test_suite.rb', line 194 def test_kit return @test_kit if @test_kit module_name = name while module_name.present? && @test_kit.nil? module_name = module_name.deconstantize next unless const_defined?("#{module_name}::Metadata") @test_kit = const_get("#{module_name}::Metadata") end @test_kit end |
.version(version = nil) ⇒ String?
Set/get the version of this test suite. Defaults to the TestKit version.
93 94 95 96 97 |
# File 'lib/inferno/entities/test_suite.rb', line 93 def version(version = nil) @version = version if version.present? @version || test_kit&.version end |