Link Search Menu Expand Document

Test/Suite/Group Properties

Table of Contents

  1. Title
  2. Id
  3. Description
  4. Optional/Required
  5. Run

Title

The title which is displayed in the UI:

test do
  title 'US Core Patient Read Interaction'
end

title in the API docs

Id

A unique identifier for a test/group/suite. Inferno will automatically create ids if they are not specified. It is important to create ids yourself if you need to refer to a test/group elsewhere, such as to include one in another group.

test do
  id :us_core_patient_read
end

group do
  test from: :us_core_patient_read
end

id in the API docs

Description

A detailed description which is displayed in the UI. Markdown is supported. There are several ways to define long strings in ruby:

test do
  description 'This is a brief description'
  
  description 'This is a longer description. There are several ways to split ' \
              'it up over multiple lines, and this is one of the worst ways.'
              
  description <<~DESCRIPTION
    This is another long description. This is an ok way to represent a long
    string in ruby.
  DESCRIPTION
  
  description %(
    This is another long description. This is a pretty good way to represent a
    long string in ruby.
  )
end

description in the API docs

Optional/Required

Mark a test/group as optional/required. Tests/Groups are required by default. The results of optional tests do not affect the test result of their parent.

group do
  optional # Makes this group optional

  test do
    optional # Makes this test optional
  end
  
  test from: :some_optional_test do
    required # Make an optional test required
  end
end

optional in the API docs

required in the API docs

Run

(Tests only) run defines a block of code which is executed when the test is run. A test will typically make one or more assertions. If no assertions fail, then the test passes.

test do
  run do
    assert 1 == 0, 'One is not equal to zero'
  end
end

run in the API docs