Class WebFailureArtifacts
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
contextProtoExecutionContexttraceSourcestringbackendNamestringsessionNamestringfailureWebFailureContextsequenceintscreenshotFunc<ValueTask<byte[]>>domFunc<ValueTask<string>>locationFunc<ValueTask<(string Url, string Title)>>
Returns
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)