Reporter API
The Reporter API allows you to create custom test result processors and output formatters. This interface is experimental and may change in future versions.
Note: For usage examples and configuration guidance, see the Reporters guide.
Using custom reporter
Create a custom reporter by implementing the Reporter interface:
Use the custom reporter in your configuration:
Interface overview
The Reporter interface provides lifecycle hooks for test execution. Each hook is called at specific points during the test run.
Important: For the most up-to-date interface definition and complete type signatures, please refer to the source code.
Hook categories
- File-level hooks:
onTestFileStart,onTestFileReady,onTestFileResult - Suite-level hooks:
onTestSuiteStart,onTestSuiteResult - Case-level hooks:
onTestCaseStart,onTestCaseResult - Run-level hooks:
onTestRunStart,onTestRunEnd,onUserConsoleLog,onExit
Basic interface structure
Metadata result fields are available on reporter results. JSON-serializable runtime metadata written through context.task.meta is available on the TestResult passed to onTestCaseResult. Metadata written by hooks through ctx.meta is available on the corresponding suite result in onTestSuiteResult, and file-level hook metadata is available on TestFileResult.meta in onTestFileResult.