Sha256: a877db6fb62b8ec8327d60b7c6e21bf73f5237662e11a7e526c6c4c5931d9f20

Contents?: true

Size: 1.63 KB

Versions: 2

Compression:

Stored size: 1.63 KB

Contents

require_relative 'metadata'
require_relative 'patient_group'

module <%= module_name %>
  class Suite < Inferno::TestSuite
    id :<%= test_suite_id %>
    title '<%= title_name %> Test Suite'
    description '<%= human_name %> test suite.'

    # These inputs will be available to all tests in this suite
    input :url,
          title: 'FHIR Server Base Url'

    input :credentials,
          title: 'OAuth Credentials',
          type: :oauth_credentials,
          optional: true

    # All FHIR requests in this suite will use this FHIR client
    fhir_client do
      url :url
      oauth_credentials :credentials
    end

    # All FHIR validation requests will use this FHIR validator
    fhir_resource_validator do
      # igs 'identifier#version' # Use this method for published IGs/versions
      # igs 'igs/filename.tgz'   # Use this otherwise

      exclude_message do |message|
        message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/)
      end
    end

    # Tests and TestGroups can be defined inline
    group do
      id :capability_statement
      title 'Capability Statement'
      description 'Verify that the server has a CapabilityStatement'

      test do
        id :capability_statement_read
        title 'Read CapabilityStatement'
        description 'Read CapabilityStatement from /metadata endpoint'

        run do
          fhir_get_capability_statement

          assert_response_status(200)
          assert_resource_type(:capability_statement)
        end
      end
    end

    # Tests and TestGroups can be written in separate files and then included
    # using their id
    group from: :patient_group
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inferno_core-0.5.4 lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt
inferno_core-0.5.3 lib/inferno/apps/cli/templates/lib/%library_name%/suite.rb.tt