AutoBE
    Preparing search index...

    Interface AutoBeTestValidateEvent<Function>

    Event fired when the Test agent validates the generated test code using the embedded TypeScript compiler.

    This event occurs when the Test agent submits a generated test file to the TypeScript compiler for validation, ensuring that the test code compiles correctly and integrates properly with the API specifications and database schemas. The validation process serves as a quality gate that ensures test scenarios are syntactically correct and semantically valid.

    The validation results determine whether the test generation process can proceed to completion or whether correction feedback is needed to resolve compilation issues and improve test code quality through the iterative self-correction mechanism.

    Michael

    interface AutoBeTestValidateEvent<
        Function extends AutoBeTestFunction = AutoBeTestFunction,
    > {
        completed: number;
        created_at: string & Format<"date-time">;
        function: Function;
        id: string;
        result: IAutoBeTypeScriptCompileResult;
        step: number;
        total: number;
        type: "testValidate";
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    completed: number

    Number of items completed.

    Tracks how many items have been successfully processed so far in the current operation. This value increments as each item is completed, providing real-time progress indication.

    The ratio of completed to total gives the completion percentage: progress = (completed / total) * 100

    created_at: string & Format<"date-time">

    Timestamp when the event was created.

    ISO 8601 formatted date-time string indicating when this event was emitted by the system. This timestamp is crucial for event ordering, performance analysis, and debugging the agent workflow execution timeline.

    Format: "YYYY-MM-DDTHH:mm:ss.sssZ" (e.g., "2024-01-15T14:30:45.123Z")

    function: Function

    Function type indicating the specific test writing operation performed.

    This discriminated union represents different stages and types of test code generation that occur during the test writing process:

    • AutoBeTestPrepareFunction: Generates test data preparation functions that create mock DTO objects required by API endpoints
    • AutoBeTestGenerationFunction: Creates resource generation functions that produce test data and utilities needed by test scenarios
    • AutoBeTestAuthorizationFunction: Implements authentication and authorization functions for different actors (login, signup, token refresh)
    • AutoBeTestWriteFunction: Writes the actual E2E test scenario files with complete test implementations

    Each function type serves a specific purpose in building comprehensive test suites, from data preparation through authentication to actual scenario validation. The discriminated union pattern enables type-safe handling of different test writing stages while providing detailed progress tracking.

    id: string

    A unique identifier for the event.

    Compilation result indicating success, failure, or exception during validation.

    Contains the complete IAutoBeTypeScriptCompileResult from the validation process, which can be:

    Success results indicate that the test suite is ready for completion, while failure or exception results trigger the correction feedback loop to improve test code quality and resolve integration issues with the application architecture.

    step: number

    Iteration number of the requirements analysis this test validation was performed for.

    Indicates which version of the requirements analysis this test validation reflects. This step number ensures that the validation process is aligned with the current requirements and helps track the quality assurance process as test scenarios are validated and refined.

    The step value enables proper synchronization between validation activities and the underlying requirements, ensuring that test validation efforts remain relevant to the current project scope and validation objectives.

    total: number

    Total number of items to process.

    Represents the complete count of operations, files, endpoints, or other entities that need to be processed in the current workflow step. This value is typically determined at the beginning of an operation and remains constant throughout the process.

    Used together with the completed field to calculate progress percentage and estimate time to completion.

    type: "testValidate"

    Unique identifier for the event type.

    A literal string that discriminates between different event types in the AutoBE system. This field enables TypeScript's discriminated union feature, allowing type-safe event handling through switch statements or conditional checks.

    Examples: "analyzeWrite", "databaseSchema", "interfaceOperation", "testScenario"