Docs · API reference · Motus

ReporterCollection Class#

The reporters registered on a browser context, and the fan-out that delivers each lifecycle event to all of them.

public sealed class ReporterCollection

Inheritance System.Object → ReporterCollection

Remarks#

A reporter that throws is ignored rather than allowed to propagate. Reporting is an observer of the run and must not be able to fail it, and one misbehaving reporter must not stop the others from being told. The consequence is worth knowing while writing one: a reporter that throws fails silently, so handle and surface your own errors.

Methods#

FireOnAccessibilityViolationAsync(AccessibilityViolation, TestInfo) Method#

Tells the reporters that also implement IAccessibilityReporter about an accessibility violation; the rest are skipped.

public System.Threading.Tasks.Task FireOnAccessibilityViolationAsync(Motus.Abstractions.AccessibilityViolation violation, Motus.Abstractions.TestInfo test);

Parameters#

violation AccessibilityViolation

The violation found.

test TestInfo

The test during which it was found.

Returns#

System.Threading.Tasks.Task

FireOnPerformanceMetricsCollectedAsync(PerformanceMetrics, PerformanceBudgetResult, TestInfo) Method#

Tells the reporters that also implement IPerformanceReporter about a set of collected metrics; the rest are skipped.

public System.Threading.Tasks.Task FireOnPerformanceMetricsCollectedAsync(Motus.Abstractions.PerformanceMetrics metrics, Motus.Abstractions.PerformanceBudgetResult? budgetResult, Motus.Abstractions.TestInfo test);

Parameters#

metrics PerformanceMetrics

The metrics collected from the page.

budgetResult PerformanceBudgetResult

How they measured against the active budget, if one was in effect.

test TestInfo

The test during which they were collected.

Returns#

System.Threading.Tasks.Task

FireOnTestEndAsync(TestInfo, TestResult) Method#

Tells every reporter that a single test has finished, and how it went.

public System.Threading.Tasks.Task FireOnTestEndAsync(Motus.Abstractions.TestInfo test, Motus.Abstractions.TestResult result);

Parameters#

test TestInfo

The test that ran.

result TestResult

Its outcome.

Returns#

System.Threading.Tasks.Task

FireOnTestRunEndAsync(TestRunSummary) Method#

Tells every reporter that the run has finished, and how it went overall.

public System.Threading.Tasks.Task FireOnTestRunEndAsync(Motus.Abstractions.TestRunSummary summary);

Parameters#

summary TestRunSummary

The totals for the run.

Returns#

System.Threading.Tasks.Task

FireOnTestRunStartAsync(TestSuiteInfo) Method#

Tells every reporter that a test run is beginning.

public System.Threading.Tasks.Task FireOnTestRunStartAsync(Motus.Abstractions.TestSuiteInfo suite);

Parameters#

suite TestSuiteInfo

The suite about to run.

Returns#

System.Threading.Tasks.Task

FireOnTestStartAsync(TestInfo) Method#

Tells every reporter that a single test is beginning.

public System.Threading.Tasks.Task FireOnTestStartAsync(Motus.Abstractions.TestInfo test);

Parameters#

test TestInfo

The test about to run.

Returns#

System.Threading.Tasks.Task