AutoBE
    Preparing search index...

    Array repeat generator for dynamic test data creation.

    Generates arrays with specified length by repeating a generator function. Essential for creating realistic test data that simulates collections like product lists, user arrays, or transaction histories for use in API operations.

    Primary usage: Creating dynamic test data for API operation parameters that require arrays, or for generating test scenarios with specific data sizes.

    E2E testing importance: Enables testing with realistic data volumes and variations that reflect real-world usage patterns, particularly when combined with IApiOperateStatement for bulk operations.

    AI function calling strategy: Use when business scenarios require collections of specific size rather than fixed arrays, especially for API operations that handle multiple entities.

    interface IArrayRepeatExpression {
        count: IExpression;
        function: IArrowFunction;
        type: "arrayRepeatExpression";
    }
    Index

    Properties

    Properties

    Expression determining how many elements to generate.

    Must be an expression that evaluates to a number representing the desired array length. Can be a literal number for fixed length or a random generator for variable length. Should reflect realistic business constraints and use cases.

    ⚠️ CRITICAL AI RESTRICTION: This MUST be an AST expression, NOT a raw number! ⚠️

    ❌ WRONG: 5 (raw number) ✅ CORRECT: INumericLiteral with value: 5 (AST expression) ✅ CORRECT: IIntegerRandom for variable length (AST expression)

    Examples:

    • INumericLiteral(5) for exactly 5 elements
    • IIntegerRandom({ minimum: 3, maximum: 7 }) for variable length
    • IIdentifier("itemCount") for dynamic count from captured data

    Business considerations:

    • 1-10 for shopping cart items (realistic user behavior)
    • 5-20 for product reviews (typical engagement levels)
    • 10-100 for product catalogs (reasonable inventory sizes)
    • 3-8 for team member lists (typical business team sizes)

    The count should be appropriate for the business context and reflect realistic data volumes that would be encountered in actual API operations.

    AI constraint setting: Choose counts that make business sense for the specific use case, considering both realistic data volumes and system performance implications when used in API operations.

    function: IArrowFunction

    Arrow function for generating individual array elements.

    Called once for each array element to generate the element value. Should produce business-appropriate data for the array's purpose.

    The function typically uses random generators to create varied but realistic business entities. Can also reference captured data from previous API operations to create related test data.

    AI implementation requirement: Generate meaningful business data rather than arbitrary random values. Consider how the generated data will be used in subsequent API operations.

    type: "arrayRepeatExpression"

    Type discriminator.