Assert
Overview
The Assert Component provides a set of assertion functions for verifying the correctness of component outputs in a test workflow. It checks whether expected conditions are met and outputs success or failure messages accordingly.
Usage
This component is used to validate component outputs based on defined assertions such as equality checks, presence of values, and regular expression matching.
Input Ports
in
Receives an object containing assertions to verify.
Output Ports
out
Sends the assertion results, including success and error messages.
Properties
expression
object
Defines the assertion logic, including conditions and expected values.
Supported Assertions
equal
Checks if a field is equal to an expected value.
notEmpty
Ensures a field is not empty.
regex
Validates if a field matches a specified regular expression.
type
Checks if a field is of a specific type (e.g., number, string, array, object).
Processing Logic
Receives Assertions: Accepts an object defining assertions to be applied.
Validates Conditions: Runs checks based on assertion type (equality, regex, non-empty values, etc.).
Generates Results: Produces a success message for each passed assertion and an error message for failures.
Sends Output: Outputs results as a JSON object with success and error details.
Notes
Multiple Assertions: Supports multiple assertion checks within a single execution.
Flexible Validation: Works with various data types and assertion conditions.
Test Automation: Useful for validating component outputs in automated testing workflows.
This component is ideal for ensuring data correctness and validating expected behavior in test workflows.
Last updated