MCPcopy
hub / github.com/microsoft/playwright / Reporter

Interface Reporter

packages/playwright/types/testReporter.d.ts:147–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 * [reporter.onBegin(config, suite)](https://playwright.dev/docs/api/class-reporter#reporter-on-begin).
146 */
147export interface Reporter {
148 /**
149 * Called after all tests have been run, or testing has been interrupted. Note that this method may return a [Promise]
150 * and Playwright Test will await it. Reporter is allowed to override the status and hence affect the exit code of the
151 * test runner.
152 * @param result Result of the full test run, `status` can be one of:
153 * - `'passed'` - Everything went as expected.
154 * - `'failed'` - Any test has failed.
155 * - `'timedout'` - The
156 * [testConfig.globalTimeout](https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout) has
157 * been reached.
158 * - `'interrupted'` - Interrupted by the user.
159 */
160 onEnd?(result: FullResult): Promise<{ status?: FullResult['status'] } | undefined | void> | void;
161 /**
162 * Called once before running tests. All tests have been already discovered and put into a hierarchy of
163 * [Suite](https://playwright.dev/docs/api/class-suite)s.
164 * @param config Resolved configuration.
165 * @param suite The root suite that contains all projects, files and test cases.
166 */
167 onBegin?(config: FullConfig, suite: Suite): void;
168
169 /**
170 * Called on some global error, for example unhandled exception in the worker process.
171 * @param error The error.
172 * @param workerInfo Contains information about the worker that produced this error. `undefined` for errors that are not associated with
173 * a specific worker.
174 */
175 onError?(error: TestError, workerInfo?: WorkerInfo): void;
176
177 /**
178 * Called immediately before test runner exists. At this point all the reporters have received the
179 * [reporter.onEnd(result)](https://playwright.dev/docs/api/class-reporter#reporter-on-end) signal, so all the reports
180 * should be build. You can run the code that uploads the reports in this hook.
181 */
182 onExit?(): Promise<void>;
183
184 /**
185 * Called when something has been written to the standard error in the worker process.
186 * @param chunk Output chunk.
187 * @param test Test that was running. Note that output may happen when no test is running, in which case this will be [void].
188 * @param result Result of the test run, this object gets populated while the test runs.
189 */
190 onStdErr?(chunk: string|Buffer, test: void|TestCase, result: void|TestResult): void;
191
192 /**
193 * Called when something has been written to the standard output in the worker process.
194 * @param chunk Output chunk.
195 * @param test Test that was running. Note that output may happen when no test is running, in which case this will be [void].
196 * @param result Result of the test run, this object gets populated while the test runs.
197 */
198 onStdOut?(chunk: string|Buffer, test: void|TestCase, result: void|TestResult): void;
199
200 /**
201 * Called when a test step started in the worker process.
202 * @param test Test that the step belongs to.
203 * @param result Result of the test run, this object gets populated while the test runs.
204 * @param step Test step instance that has started.

Callers 10

viFunction · 0.65
kiFunction · 0.65
FeFunction · 0.65
invokeGuardedCallbackDevFunction · 0.65
emitErrorFunction · 0.65
processIfFunction · 0.65
launchProcessFunction · 0.65

Implementers 8

ReporterV2Wrapperpackages/playwright/src/reporters/repo
InternalReporterpackages/playwright/src/reporters/inte
Multiplexerpackages/playwright/src/reporters/mult
ExpectationReportertests/bidi/expectationReporter.ts
CsvReportertests/bidi/csvReporter.ts
TestReportertests/playwright-test/reporter.spec.ts
MyReportertests/installation/fixture-scripts/pla
MarkdownReportertests/config/ghaMarkdownReporter.ts

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…