AutoBE
    Preparing search index...

    Array filter expression for selecting elements that meet criteria.

    Filters array elements based on a predicate function, keeping only elements that satisfy the specified condition. Essential for extracting subsets of business data from captured API responses or test collections based on business rules and conditions.

    E2E testing scenarios:

    • Filtering products by category or price range from API response arrays
    • Selecting active users from captured user lists for business operations
    • Finding orders with specific status from API response collections
    • Extracting eligible items for business rule validation

    Primary usage: Processing captured data from API operations to create focused datasets for subsequent operations or validations.

    AI function calling strategy: Use when business logic requires working with specific subsets of data captured from API responses, especially for conditional operations or validation scenarios.

    interface IArrayFilterExpression {
        array: IExpression;
        function: IArrowFunction;
        type: "arrayFilterExpression";
    }
    Index

    Properties

    Properties

    Array expression to be filtered.

    Must be an expression that evaluates to an array containing business entities or data that requires filtering based on specific criteria. Can reference variables from previous API calls, array literals, or other expressions that produce arrays.

    The array elements will be individually evaluated by the filter function to determine inclusion in the filtered result. Each element should be compatible with the filtering logic defined in the function parameter.

    Examples:

    • Reference to captured product array from API response
    • Array of user entities from previous API operations
    • Collection of business data requiring conditional processing
    • Variable references to previously constructed arrays

    Business context: Typically represents collections of entities that need subset selection based on business rules, such as active users, available products, or eligible transactions.

    function: IArrowFunction

    Arrow function defining the filter criteria.

    Called for each array element to determine if it should be included in the filtered result. Should return a boolean expression that evaluates business conditions relevant to the filtering purpose.

    The function parameter represents the current array element being evaluated and can be used to access properties for business logic conditions.

    type: "arrayFilterExpression"

    Type discriminator.