Skip to content

E2ESession

Namespace: E2E

public sealed class E2ESession : IAsyncDisposable

One test attempt: an engine session, the fixtures, and the replay cache. Call CancellationToken) after the test body. Disposing without CancellationToken) records the attempt as failed.

Inheritance: object

Implements: IAsyncDisposable

View source

public Agent Agent { get; }

Value: Agent

View source

public App App { get; }

Value: App

View source

public Browser Browser { get; }

Value: Browser

View source

public TestContext Context { get; }

Value: TestContext

View source

public int HandedOff { get; }

Value: int

View source

public int InputTokens { get; }

Value: int

View source

public int Missed { get; }

Value: int

View source

public int ModelCalls { get; }

Value: int

View source

public int OutputTokens { get; }

Value: int

View source

public int Replayed { get; }

Value: int

View source

public Screen Screen { get; }

Value: Screen

View source

public Task CaptureFailureEvidenceAsync(Exception error)

Looks at the app once more and keeps what the screen holds, the moment a failure is known: an adapter calls it when the test body fails, ahead of the test’s own teardown, so a teardown that navigates away cannot replace the evidence (upstream’s captureEvidence). It looks once per attempt. A failure that first lands in the teardown is looked at when the session is released. Only an attempt whose trace page is kept looks.

Parameters

Name Type Description
error Exception

Returns: Task

View source

public TestException? CloseSoftFailures()

Ends expect.soft collection and returns one ASSERTION_FAILED for every failure kept since the session started, or null. Call it when the test body settles and fail the test with the result. Later soft matchers throw as hard ones would.

Returns: TestException

View source

public void Complete(Exception? error = null, CancellationToken cancellationToken = default)

Writes verified acts and evicts the unverified ones this attempt recorded or replayed. A passed or skipped attempt confirms only what a later check verified. An act that missed the cache and never passed leaves its key alone. An entry a verified replay finished, or one that already holds the same flow, is not rewritten. A model outage leaves existing entries in place, unless a failure on the app implicated them too. A cancelled <code class=“paramref”>cancellationToken</code> writes nothing.

Parameters

Name Type Description
error Exception
cancellationToken CancellationToken

View source

public ValueTask DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

Returns: ValueTask — A task that represents the asynchronous dispose operation.

View source

public Report? Report()

The attempt’s report-1 document once the session is disposed and its trace page, when the mode keeps one, is written; null before that and when the page cannot be written. It tells this attempt alone, as a single-result run: its status is the session’s, not the verdict of the test around it. Artifact paths are relative to the results directory. Upstream’s session.report().

Returns: Report

View source

StartAsync(E2ESessionOptions, CancellationToken)

Section titled “StartAsync(E2ESessionOptions, CancellationToken)”
public static Task<E2ESession> StartAsync(E2ESessionOptions options, CancellationToken cancellationToken = default)

Parameters

Name Type Description
options E2ESessionOptions
cancellationToken CancellationToken

Returns: Task<E2ESession>

View source