fhir-crucible / testscript-engine

Ruby FHIR TestScript execution engine
Apache License 2.0
5 stars 2 forks source link

Dynamic variable #71

Closed jhlee-mitre closed 1 year ago

jhlee-mitre commented 1 year ago

Summary

Dynamic variable

New behavior

Users can set up dynamic variable as a placeholder for user-defined execution time values for TestScript.variable. Technically dynamic variable will replace value in defaultValue at the beginning of test execution. There are two ways to set up dynamic variable:

Config.yml

variable : [ARRAY]

Use format

- name1=value1
- name2=value2

Command line argument

bundle exec testscript_engine execution --variable [ARRAY]

Use format name1=value1 name2=value2

Use quotations if there are spaces.

Testing guidance

Sample TestScript testscript_dynamic_variable is included. Use the examples below from command line argument.

bundle exec testscript_engine execute --testscript_path "/spec/examples/testscript_unittest" --variable PatientResourceId1=var1changed PatientResourceId2=var2changed --testscript_name testscript_dynamic_variable

Expected result


STARTING TO TEST
         GETTING: http://server.fire.ly/Patient/var1changed
         (✓) Executed Operation: [unlabeled]
         (✗) Response: Expected Response equals ["okay"], but found [].
         GETTING: http://server.fire.ly/Patient/var2changed
         (✓) Executed Operation: [unlabeled]
         (✗) Response: Expected Response equals ["okay"], but found [].
      FINISHED TEST.