AutoBE
    Preparing search index...

    Conditional validation predicate for TestValidator assertion.

    Generates TestValidator validation calls based on boolean conditions. Used for validating business logic conditions, state checks, and conditional assertions that depend on runtime data or business rules from API responses.

    Preferred over manual validation: Use this instead of IIfStatement with throw statements for conditional validation logic.

    E2E testing scenarios:

    • Validating business rule compliance using API response data
    • Checking conditional states (user roles, feature flags) from API calls
    • Verifying complex boolean logic conditions involving captured data
    • Ensuring data meets business constraints after API operations

    AI function calling usage: Use when test validation depends on evaluating business conditions rather than simple equality checks. Essential for testing complex business logic and rule-based systems with API integration.

    interface IConditionalPredicate {
        expression: IExpression;
        title: string & MinLength<1>;
        type: "conditionalPredicate";
    }
    Index

    Properties

    Properties

    expression: IExpression

    Boolean expression representing the condition to be validated.

    Should evaluate to true when the business condition is met. Can be simple comparisons or complex logical expressions combining multiple business rules and data checks involving captured API response data.

    Common patterns:

    • Comparison expressions using captured data (customer.tier === "premium")
    • Logical combinations (hasPermission && isActive) with API response data
    • Type checks using typia.is(capturedValue)
    • Complex business rule evaluations with captured entities

    AI condition construction: Build conditions that accurately represent business rules and constraints relevant to the test scenario, using data captured from API operations.

    title: string & MinLength<1>

    Descriptive title explaining the conditional logic being validated.

    🚨 CRITICAL: This MUST be a simple string value, NOT an expression! 🚨

    ❌ WRONG - DO NOT use expressions of any kind:

    • { type: "binaryExpression", operator: "+", left: "User", right: " should have access" }
    • { type: "stringLiteral", value: "some string" }
    • Any IExpression types - this is NOT an expression field!

    ✅ CORRECT - Use direct string values only:

    • "Premium customer should have access to exclusive features"
    • Simple, complete descriptive text as a raw string

    Should clearly describe the business condition or rule being tested and why it should be true. This helps understand the business context and debug failures when conditions aren't met.

    Examples:

    • "Premium customer should have access to exclusive features"
    • "Order total should exceed minimum purchase amount"
    • "Product should be available for selected category"
    • "User should have sufficient permissions for this operation"

    AI title strategy: Explain the business rule or condition being validated and its importance to the overall business workflow.

    type: "conditionalPredicate"

    Type discriminator.