AutoBE
    Preparing search index...

    Binary expression for operations between two operands.

    Represents all binary operations including comparison, arithmetic, and logical operations. Essential for implementing business logic conditions, calculations, and validations in test scenarios using captured data.

    🚨 CRITICAL: DO NOT confuse with property access or element access! 🚨

    This interface is ONLY for binary operators (===, !==, +, -, etc.). Do NOT use this for:

    ❌ WRONG - These are NOT binary expressions:

    • Array.isArray (use IPropertyAccessExpression instead)
    • user.name (use IPropertyAccessExpression instead)
    • items[0] (use IElementAccessExpression instead)
    • x.y (use IPropertyAccessExpression instead)
    • object.property (use IPropertyAccessExpression instead)
    • console.log (use IPropertyAccessExpression instead)
    • Math.max (use IPropertyAccessExpression instead)
    • array.length (use IPropertyAccessExpression instead)
    • string.includes (use IPropertyAccessExpression instead)

    ✅ CORRECT - Binary expressions only:

    • x === y (equality comparison)
    • a + b (arithmetic operation)
    • count > 0 (comparison operation)
    • isActive && isValid (logical operation)

    For property/method access, use the appropriate expression types:

    • Property access: Use IPropertyAccessExpression (e.g., user.name, Array.isArray, array.length)
    • Array/object indexing: Use IElementAccessExpression (e.g., items[0], obj["key"])
    • Method calls: Use ICallExpression with IPropertyAccessExpression for the function

    Common AI mistakes to avoid:

    • Using IBinaryExpression for dot notation (.) - this is property access, not a binary operator
    • Using IBinaryExpression for .length, .includes(), etc. - these are property/method access
    • Confusing property access with binary operations
    • Mixing structural navigation with computational operations

    E2E testing importance: Critical for implementing business rule validations, data comparisons, and conditional logic that reflects real-world application behavior using data captured from API responses.

    interface IBinaryExpression {
        left: IExpression;
        operator:
            | "-"
            | "+"
            | "==="
            | "!=="
            | "<"
            | "<="
            | ">"
            | ">="
            | "*"
            | "/"
            | "%"
            | "&&"
            | "||"
            | "instanceof";
        right: IExpression;
        type: "binaryExpression";
    }
    Index

    Properties

    Properties

    Left operand of the binary operation.

    Typically represents the primary value being compared or operated upon. In business contexts, often represents actual values from captured API responses or business entities from previous operations.

    Note: If you need to access object properties (like user.name, array.length), use IPropertyAccessExpression as the left operand, not IBinaryExpression.

    operator:
        | "-"
        | "+"
        | "==="
        | "!=="
        | "<"
        | "<="
        | ">"
        | ">="
        | "*"
        | "/"
        | "%"
        | "&&"
        | "||"
        | "instanceof"

    Binary operator defining the operation type.

    ⚠️ IMPORTANT: These are computational/logical operators ONLY! ⚠️

    🚨 CRITICAL JavaScript Requirements: 🚨

    ❌ NEVER use loose equality operators:

    • == (loose equality) - This is NOT supported and causes type coercion bugs
    • != (loose inequality) - This is NOT supported and causes type coercion bugs

    ✅ ALWAYS use strict equality operators:

    • === (strict equality) - Use this for all equality comparisons
    • !== (strict inequality) - Use this for all inequality comparisons

    Why strict equality is required:

    • Prevents unexpected type coercion (e.g., "0" == 0 is true, but "0" === 0 is false)
    • Ensures predictable behavior in business logic
    • Follows TypeScript and modern JavaScript best practices
    • Avoids subtle bugs in API response validation

    Do NOT include:

    • . (dot) - This is property access, use IPropertyAccessExpression
    • [] (brackets) - This is element access, use IElementAccessExpression
    • () (parentheses) - This is function call, use ICallExpression
    • .length, .includes, etc. - These are property/method access, use IPropertyAccessExpression
    • '.length ===': Capsule left expression into IPropertyAccessExpression
    • '[0] >=' Capsule left expression into IElementAccessExpression

    Comparison operators:

    • "===", "!==": Strict equality/inequality (REQUIRED - never use == or !=)
    • "<", "<=", ">", ">=": Numerical/string comparisons

    Arithmetic operators:

    • "+", "-", "*", "/", "%": Mathematical operations

    Logical operators:

    • "&&": Logical AND (both conditions must be true)
    • "||": Logical OR (either condition can be true)

    AI selection guide:

    • Use === for equality checks (NEVER ==)
    • Use !== for inequality checks (NEVER !=)
    • Use logical operators for combining business conditions
    • Use arithmetic for calculations on captured data
    • For property access, method calls, or array indexing, use the appropriate expression types instead

    Right operand of the binary operation.

    Represents the comparison value, second operand in calculations, or second condition in logical operations. In business contexts, often represents expected values, business rule thresholds, or additional captured data from API responses.

    Note: If you need to access object properties (like order.status, items.length), use IPropertyAccessExpression as the right operand, not IBinaryExpression.

    type: "binaryExpression"

    Type discriminator.