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

Port
Description

in

Receives an object containing assertions to verify.

Output Ports

Port
Description

out

Sends the assertion results, including success and error messages.

Properties

Property
Type
Description

expression

object

Defines the assertion logic, including conditions and expected values.

Supported Assertions

Assertion Type
Description

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

  1. Receives Assertions: Accepts an object defining assertions to be applied.

  2. Validates Conditions: Runs checks based on assertion type (equality, regex, non-empty values, etc.).

  3. Generates Results: Produces a success message for each passed assertion and an error message for failures.

  4. 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