Package org.fhirfrog.frog.testscriptrender
TestScript definitions.
This package renders a TestScript resource for reading, not for round-tripping.
It is deliberately not a decompiler for fhir-frog-shorthand's TSH authoring DSL: today's
TSH grammar cannot represent assert.warningOnly, a coded assert.response, or
parameterized operation.params without lossy simplification, so targeting TSH text as
the pretty-print output would silently drop load-bearing detail. Instead this package walks a
TestScript straight into its own display-only model
(TestScriptDisplay), narrative-first and
technical-detail-second, matching the content model frog-runner's live UI already uses
for execution results - just applied here to the test definition rather than a run's
outcome.
Scope
Covers setup/test/teardown, operation, assert,
fixture and variable. Deliberately does not read the frog-action-narrative /
frog-request-payload / frog-response-payload extensions used by
fhir-frog-rendering's TestReport output - those only exist on an execution result, not
on a bare TestScript definition, so there is nothing here for them to read.
Components
TestScriptDisplay- the display-only model a TestScript is rendered intoTestScriptDisplayBuilder- builds that model from a HAPITestScriptTestScriptHtmlRenderer- renders the model as an HTML fragment
Usage
TestScript testScript = new TestScriptParser().parse(inputStream, "TestScript-example.json");
TestScriptDisplay display = new TestScriptDisplayBuilder().build(testScript);
String html = new TestScriptHtmlRenderer().render(display);
-
ClassDescriptionA display-only, human-readable rendering of a FHIR
TestScriptdefinition.A singleTestScript.fixtureentry.One phase of test execution:setup, a singletestentry, orteardown.Which part of the TestScript aTestScriptDisplay.PhaseDisplaycorresponds to.Whether/how a failingTestScriptDisplay.StepDisplaygates the phase's pass/fail outcome.A single step within a phase: oneoperationor oneassert.Whether aTestScriptDisplay.StepDisplayis an operation (a wire call) or an assert (a check on the last response).A singleTestScript.variableentry.Walks a HAPITestScriptmodel object and produces the display-onlyTestScriptDisplaytree thatTestScriptHtmlRenderer(or any other future renderer) turns into a browsable document.Renders aTestScriptDisplaytree as a single, self-contained HTML fragment: a narrative-first, technical-detail-secondary document, matching the content modelfrog-runner's live UI already uses for execution results (narrative line first, a monospace technical line underneath, nothing hidden behind extra clicks) - just applied here to the test *definition* rather than a run's outcome.Minimal, directory-in/HTML-files-out CLI over this module's renderer - not a general framework, just enough to let another build (e.g. an IG's own CI) turn a folder of TestScript resource files into browsable HTML fragments without a JVM dependency of its own.