Class WebFailureArtifacts

Namespace
ProtoTest.Web
Assembly
ProtoTest.Web.dll

Captures the failure artifacts both backends produce (screenshot, DOM and location) with one naming rule, one set of descriptions and one location format. Each capture is isolated so a failing artifact never replaces the original web error. A hand-written backend calls this from CaptureFailureAsync(WebFailureContext, CancellationToken) so its artifacts match the documented web-{session}-{element}-{n}-… naming.

public static class WebFailureArtifacts
Inheritance
WebFailureArtifacts
Inherited Members

Methods

CaptureAsync(ProtoExecutionContext, string, string, string, WebFailureContext, int, Func<ValueTask<byte[]?>>, Func<ValueTask<string?>>, Func<ValueTask<(string? Url, string? Title)>>)

Captures the failure artifacts, one attachment per capture that produced a value.

public static ValueTask<IReadOnlyList<ProtoTestAttachment>> CaptureAsync(ProtoExecutionContext context, string traceSource, string backendName, string sessionName, WebFailureContext failure, int sequence, Func<ValueTask<byte[]?>> screenshot, Func<ValueTask<string?>> dom, Func<ValueTask<(string? Url, string? Title)>> location)

Parameters

context ProtoExecutionContext
traceSource string
backendName string
sessionName string
failure WebFailureContext
sequence int
screenshot Func<ValueTask<byte[]>>
dom Func<ValueTask<string>>
location Func<ValueTask<(string Url, string Title)>>

Returns

ValueTask<IReadOnlyList<ProtoTestAttachment>>

TraceArtifactFailure(ProtoExecutionContext, string, string, string, Exception, string?)

Records a diagnostics capture that could not be attached, so one failed artifact never fails the test and every backend reports the failure the same way.

public static void TraceArtifactFailure(ProtoExecutionContext context, string traceSource, string label, string artifact, Exception exception, string? parentId = null)

Parameters

context ProtoExecutionContext
traceSource string
label string
artifact string
exception Exception
parentId string