AutoBE
    Preparing search index...

    Interface AutoBeTestWriteEvent<Function>

    Event fired when the Test agent writes and completes individual test scenario files.

    This event provides real-time visibility into the test file creation process as the Test agent systematically writes test scenarios for each API endpoint. Each write event represents the completion of a specific test file that implements use case scenarios, ensuring comprehensive coverage of API functionality and business logic validation.

    The write events enable stakeholders to monitor the test suite development and understand how comprehensive validation coverage is being built to ensure the generated application functions correctly under realistic operational conditions and properly implements business requirements.

    Michael

    interface AutoBeTestWriteEvent<
        Function extends AutoBeTestFunction = AutoBeTestFunction,
    > {
        completed: number;
        created_at: string & Format<"date-time">;
        function: Function;
        id: string;
        metric: AutoBeFunctionCallingMetric;
        step: number;
        tokenUsage: IComponent;
        total: number;
        type: "testWrite";
    }

    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)
    • AutoBeTestOperationFunction: 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.

    Function calling trial statistics for the operation.

    Records the complete trial history of function calling attempts, tracking total executions, successful completions, consent requests, validation failures, and invalid JSON responses. These metrics reveal the reliability and quality of AI agent autonomous operation with tool usage.

    Trial statistics are critical for identifying operations where agents struggle with tool interfaces, generate invalid outputs, or require multiple correction attempts through self-healing spiral loops. High failure rates indicate opportunities for system prompt optimization or tool interface improvements.

    step: number

    Iteration number of the requirements analysis this test writing reflects.

    Indicates which version of the requirements analysis this test file creation work is based on. This step number ensures that the test scenarios are aligned with the current requirements and helps track the development of validation coverage as business requirements and API specifications evolve.

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

    tokenUsage: IComponent

    Detailed token usage metrics for the operation.

    Contains comprehensive token consumption data including total usage, input token breakdown with cache hit rates, and output token categorization by generation type (reasoning, predictions). This component-level tracking enables precise cost analysis and identification of operations that benefit most from prompt caching or require optimization.

    Token usage directly translates to operational costs, making this metric essential for understanding the financial implications of different operation types and guiding resource allocation decisions.

    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: "testWrite"

    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"