Docs · API reference · Motus.Testing

FailureTracing Class#

Manages automatic trace capture around test execution. When failure.trace is enabled in motus.config.json or via the MOTUS_FAILURES_TRACE environment variable, tracing is started before the test and saved to disk only when the test fails.

public sealed class FailureTracing

Inheritance System.Object → FailureTracing

Methods#

StartIfEnabledAsync(IBrowserContext) Method#

Starts tracing on the context if failure tracing is enabled in config. Call this during test setup, after creating the context and page.

public System.Threading.Tasks.Task StartIfEnabledAsync(Motus.Abstractions.IBrowserContext context);

Parameters#

context IBrowserContext

Returns#

System.Threading.Tasks.Task

StopAsync(IBrowserContext, bool) Method#

Stops tracing. If testFailed is true, the trace is saved to disk; otherwise it is discarded. Call this during test teardown, before closing the context.

public System.Threading.Tasks.Task StopAsync(Motus.Abstractions.IBrowserContext context, bool testFailed);

Parameters#

context IBrowserContext

testFailed System.Boolean

Returns#

System.Threading.Tasks.Task