E2ESession
Namespace: E2E
public sealed class E2ESession : IAsyncDisposableOne 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
Properties
Section titled “Properties”public Agent Agent { get; }Value: Agent
public App App { get; }Value: App
Browser
Section titled “Browser”public Browser Browser { get; }Value: Browser
Context
Section titled “Context”public TestContext Context { get; }Value: TestContext
HandedOff
Section titled “HandedOff”public int HandedOff { get; }Value: int
InputTokens
Section titled “InputTokens”public int InputTokens { get; }Value: int
Missed
Section titled “Missed”public int Missed { get; }Value: int
ModelCalls
Section titled “ModelCalls”public int ModelCalls { get; }Value: int
OutputTokens
Section titled “OutputTokens”public int OutputTokens { get; }Value: int
Replayed
Section titled “Replayed”public int Replayed { get; }Value: int
Screen
Section titled “Screen”public Screen Screen { get; }Value: Screen
Methods
Section titled “Methods”CaptureFailureEvidenceAsync(Exception)
Section titled “CaptureFailureEvidenceAsync(Exception)”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
CloseSoftFailures()
Section titled “CloseSoftFailures()”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
Complete(Exception?, CancellationToken)
Section titled “Complete(Exception?, CancellationToken)”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 |
DisposeAsync()
Section titled “DisposeAsync()”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.
Report()
Section titled “Report()”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
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>