Fixtures in a TestScript define a set of resource instances that will be used as part of the setup, test, and teardown sections during TestScript execution. In Touchstone, those fixtures can be defined statically within the TestScript or they can be defined dynamically and the resource instance for the fixture is provided to the testscript as part of the test setup. More information about Fixtures can be found in the FHIR Testing Implementation Guide.

Dynamic Fixtures

Static fixtures are those that the testscript author uploads to Touchstone. The tester cannot change the content of such fixtures. In testscripts, they are defined using the fixture element:

../_images/static_fixture_a1.png

Dynamic Fixtures, on the other hand, are not uploaded by the testscript author. The tester has to specify the content of such fixtures before launching test executions. In testscripts, they are defined using a FHIR extension:

../_images/dynamic_fixture_a1.png
  • id – This is similar to static fixture id. It identifies the fixture and can be referenced in testscript variables and operations.

  • resourceType – Used to convey the FHIR resource type to the tester on Test Script Execution and Conformance screens. The resourceType specified in the fixtures contents is not validated against the extension resourceType when tester saves or executes the test setup. Testscript author can define a request assertion for resource to ensure tester has submitted the right resource type.

  • contentType – Used to validate the contents of the fixture for proper JSON/XML format when tester saves or executes the test setup. Valid values are JSON and XML. Basic JSON/XML validation is performed. If the content is invalid JSON/XML, then tester is prevented from saving the test setup.

  • description – Used to inform tester about the purpose of the fixture.

  • hint – Used to inform tester about the purpose of the fixture.

You can learn more about this extension by visiting AEGIS Touchstone Testing Implementation Guide.

The dynamic fixture can be referenced in testscript variables and operations just like static fixtures:

../_images/dynamic_fixture_var_ref_a1.png ../_images/dynamic_fixture_oper_ref_a1.png

The next sections cover how the tester can specify the content of dynamic fixtures.


Test Setup

When a test setup is created that involves a dynamic fixture, the tester is prompted to provide the fixture contents. The fixture’s hint (defined in the testscript) is displayed within the input box (blue arrow below). The fixture’s description is displayed when user hovers over the input box (red arrow below).

../_images/df_test_setup_a1.png

Tester can enter the contents of the fixture and expand the input box using the drag handle (blue arrow below):

../_images/df_test_setup_fixture_entered_a1.png

The dynamic fixtures used by a testscript execution are listed below the static fixtures on TestScript Execution screen:

../_images/df_script_exec_listing_a1.png

They can be used in variables and operations just like static fixtures:

../_images/df_script_exec_var_fixture_a1.png ../_images/df_script_exec_req_body_a1.png

Note

Testscript authors should define a request assertion for the fixture’s resource-type after testscript operations that utilize a dynamic fixture. Touchstone does not validate the resource-type of a dynamic fixture when tester saves the test setup.

<action>
   <assert>
      <description value="Confirm that the submitted resource type is Patient."/>
      <direction value="request"/>
      <resource value="Patient"/>
      <warningOnly value="false"/>
   </assert>
</action>

Conformance Testing

On the Conformance Current page, the tester is prompted for input the same way as on the Test Setup screen:

../_images/df_conf_screen_a1.png