Skip to main content

Overview

Assertions are the final step in your test pipeline. After all blocks execute, assertions check if the data in the DataBus matches your expectations.

Simple Assertions (Equality)

The simplest form checks for exact equality:
Rules:
  • String values must match exactly
  • Numbers must match exactly
  • Booleans must match exactly
  • Null values must match exactly

Operator Assertions

For more complex validation, use operator objects with 20+ powerful operators.

Equality Operators

Numeric Comparisons

  • gt: Greater than
  • gte: Greater than or equal
  • lt: Less than
  • lte: Less than or equal

String/Array Operations

For text: Checks if the string contains the substring or meets length requirements For arrays: Checks if the array contains the value or meets length requirements

Pattern Matching

Uses JavaScript regex syntax.

Type Checks

Boolean Checks

Empty Checks

Works with strings, arrays, and objects.

Complete Example

Multiple Operators

You can combine multiple operators on the same field - all must pass:
Example explanations:
  • user.age: Must be between 18 and 100
  • response.message: Must contain “success” AND start with capital letter
  • user.email: Must be valid email format AND not empty AND at least 5 characters
All operators in a group are evaluated with AND logic - every operator must pass for the assertion to succeed.

Common Patterns

Check for success status range (200-299) and non-empty response body.

Assertion Failures

When an assertion fails, you get detailed error messages:

Best Practices

Test successful response:
Test error handling:
Bad - too specific:
Good - allows for variance:
Structure checks: Required fields exist and are not emptyContent checks: Data values are valid (format, length, etc.)
Bad - too many assertions make tests fragile:
Good - test what matters:
If any specific detail changes, overly specific tests will break unnecessarily.

Operator Reference

Equality Operators

Numeric Operators

String/Array Operators

Pattern Operators

Type Operators

Boolean Operators

Empty Operators

Next Steps

Browse Blocks

See what data each block produces

View Examples

See assertions in real tests