Overview
SemanticTest supports three different input formats for passing data to blocks. This flexibility lets you write cleaner, more readable tests.1. String Format (Simple)
Pass a single value from the DataBus:- The value from
response.body
is wrapped in an object - Becomes:
{ body: "the actual value" }
- The block receives it as
inputs.body
- Single value input
- Quick and simple syntax
- Most common format
2. From/As Format (Mapping)
Map a DataBus slot to a specific parameter name:- Value from
parsed.message
is mapped to parametertext
- The block receives it as
inputs.text
- Block expects a specific parameter name
- You need to rename the data
- More explicit about what data goes where
3. Object Format (Full Control)
Pass multiple values with deep variable resolution:- All
${}
variables are resolved from the DataBus - The entire object is passed to the block
- Nested objects are fully resolved
- Multiple parameters needed
- Complex nested data structures
- Mix of static and dynamic values
Comparison
- String Format
- From/As Format
- Object Format
Variable Resolution
All formats support${}
syntax for reading from the DataBus:
Best Practices
Use String Format for Simple Cases
Use String Format for Simple Cases
Use From/As When Names Matter
Use From/As When Names Matter
Use Object Format for Complex Blocks
Use Object Format for Complex Blocks
Don't Mix Formats
Don't Mix Formats