โน๏ธ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://playwright.dev/docs/test-reporters |
| Last Crawled | 2026-04-11 15:54:22 (21 hours ago) |
| First Indexed | 2021-06-09 04:11:25 (4 years ago) |
| HTTP Status Code | 200 |
| Meta Title | Reporters | Playwright |
| Meta Description | Introduction |
| Meta Canonical | null |
| Boilerpipe Text | Introduction
โ
Playwright Test comes with a few built-in reporters for different needs and ability to provide custom reporters. The easiest way to try out built-in reporters is to pass
--reporter
command line option
.
npx playwright
test
--reporter
=
line
For more control, you can specify reporters programmatically in the
configuration file
.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
'line'
,
}
)
;
Multiple reporters
โ
You can use multiple reporters at the same time. For example you can use
'list'
for nice terminal output and
'json'
to get a comprehensive json file with the test results.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'list'
]
,
[
'json'
,
{
outputFile
:
'test-results.json'
}
]
]
,
}
)
;
Reporters on CI
โ
You can use different reporters locally and on CI. For example, using concise
'dot'
reporter avoids too much output. This is the default on CI.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
// Concise 'dot' for CI, default 'list' when running locally
reporter
:
process
.
env
.
CI
?
'dot'
:
'list'
,
}
)
;
Built-in reporters
โ
All built-in reporters show detailed information about failures, and mostly differ in verbosity for successful runs.
List reporter
โ
List reporter is default (except on CI where the
dot
reporter is default). It prints a line for each test being run.
npx playwright
test
--reporter
=
list
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
'list'
,
}
)
;
Here is an example output in the middle of a test run. Failures will be listed at the end.
npx playwright
test
--reporter
=
list
Running
124
tests using
6
workers
1
โ should access error
in
env
(
438ms
)
2
โ handle long
test
names
(
515ms
)
3
x
1
)
render expected
(
691ms
)
4
โ should
timeout
(
932ms
)
5
should repeat each:
6
โ should respect enclosing .gitignore
(
569ms
)
7
should teardown
env
after timeout:
8
should respect excluded tests:
9
โ should handle
env
beforeEach error
(
638ms
)
10
should respect enclosing .gitignore:
You can opt into the step rendering via passing the following config option:
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'list'
,
{
printSteps
:
true
}
]
]
,
}
)
;
List report supports the following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_LIST_PRINT_STEPS
printSteps
Whether to print each step on its own line.
false
PLAYWRIGHT_FORCE_TTY
Whether to produce output suitable for a live terminal. Supports
true
,
1
,
false
,
0
,
[WIDTH]
, and
[WIDTH]x[HEIGHT]
.
[WIDTH]
and
[WIDTH]x[HEIGHT]
specifies the TTY dimensions.
true
when terminal is in TTY mode,
false
otherwise.
FORCE_COLOR
Whether to produce colored output.
true
when terminal is in TTY mode,
false
otherwise.
Line reporter
โ
Line reporter is more concise than the list reporter. It uses a single line to report last finished test, and prints failures when they occur. Line reporter is useful for large test suites where it shows the progress but does not spam the output by listing all the tests.
npx playwright
test
--reporter
=
line
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
'line'
,
}
)
;
Here is an example output in the middle of a test run. Failures are reported inline.
npx playwright
test
--reporter
=
line
Running
124
tests using
6
workers
1
)
dot-reporter.spec.ts:20:1 โบ render expected
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
==
=
Error: expect
(
received
)
.toBe
(
expected
)
// Object.is equality
Expected:
1
Received:
0
[
23
/124
]
gitignore.spec.ts - should respect nested .gitignore
Line report supports the following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_FORCE_TTY
Whether to produce output suitable for a live terminal. Supports
true
,
1
,
false
,
0
,
[WIDTH]
, and
[WIDTH]x[HEIGHT]
.
[WIDTH]
and
[WIDTH]x[HEIGHT]
specifies the TTY dimensions.
true
when terminal is in TTY mode,
false
otherwise.
FORCE_COLOR
Whether to produce colored output.
true
when terminal is in TTY mode,
false
otherwise.
Dot reporter
โ
Dot reporter is very concise - it only produces a single character per successful test run. It is the default on CI and useful where you don't want a lot of output.
npx playwright
test
--reporter
=
dot
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
'dot'
,
}
)
;
Here is an example output in the middle of a test run. Failures will be listed at the end.
npx playwright
test
--reporter
=
dot
Running
124
tests using
6
workers
ยทยทยทยทยทยทFยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
One character is displayed for each test that has run, indicating its status:
Character
Description
ยท
Passed
F
Failed
ร
Failed or timed out - and will be retried
ยฑ
Passed on retry (flaky)
T
Timed out
ยฐ
Skipped
Dot report supports the following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_FORCE_TTY
Whether to produce output suitable for a live terminal. Supports
true
,
1
,
false
,
0
,
[WIDTH]
, and
[WIDTH]x[HEIGHT]
.
[WIDTH]
and
[WIDTH]x[HEIGHT]
specifies the TTY dimensions.
true
when terminal is in TTY mode,
false
otherwise.
FORCE_COLOR
Whether to produce colored output.
true
when terminal is in TTY mode,
false
otherwise.
HTML reporter
โ
HTML reporter produces a self-contained folder that contains report for the test run that can be served as a web page.
npx playwright
test
--reporter
=
html
By default, HTML report is opened automatically if some of the tests failed. You can control this behavior via the
open
property in the Playwright config or the
PLAYWRIGHT_HTML_OPEN
environmental variable. The possible values for that property are
always
,
never
and
on-failure
(default).
You can also configure
host
and
port
that are used to serve the HTML report.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'html'
,
{
open
:
'never'
}
]
]
,
}
)
;
By default, report is written into the
playwright-report
folder in the current working directory. One can override that location using the
PLAYWRIGHT_HTML_OUTPUT_DIR
environment variable or a reporter configuration.
In configuration file, pass options directly:
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'html'
,
{
outputFolder
:
'my-report'
}
]
]
,
}
)
;
If you are uploading attachments from a data folder to another location, you can use
attachmentsBaseURL
option to let html report know where to look for them.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'html'
,
{
attachmentsBaseURL
:
'https://external-storage.com/'
}
]
]
,
}
)
;
A quick way of opening the last test run report is:
npx playwright show-report
Or if there is a custom folder name:
npx playwright show-report my-report
HTML report supports the following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_HTML_TITLE
title
A title to display in the generated report.
No title is displayed by default
PLAYWRIGHT_HTML_OUTPUT_DIR
outputFolder
Directory to save the report to.
playwright-report
PLAYWRIGHT_HTML_OPEN
open
When to open the html report in the browser, one of
'always'
,
'never'
or
'on-failure'
'on-failure'
PLAYWRIGHT_HTML_HOST
host
When report opens in the browser, it will be served bound to this hostname.
localhost
PLAYWRIGHT_HTML_PORT
port
When report opens in the browser, it will be served on this port.
9323
or any available port when
9323
is not available.
PLAYWRIGHT_HTML_ATTACHMENTS_BASE_URL
attachmentsBaseURL
A separate location where attachments from the
data
subdirectory are uploaded. Only needed when you upload report and
data
separately to different locations.
data/
PLAYWRIGHT_HTML_NO_COPY_PROMPT
noCopyPrompt
If true, disable rendering of the Copy prompt for errors. Supports
true
,
1
,
false
, and
0
.
false
PLAYWRIGHT_HTML_NO_SNIPPETS
noSnippets
If true, disable rendering code snippets in the action log. If there is a top level error, that report section with code snippet will still render. Supports
true
,
1
,
false
, and
0
.
false
PLAYWRIGHT_HTML_DO_NOT_INLINE_ASSETS
doNotInlineAssets
If true, JavaScript, CSS and report data are written as separate files alongside
index.html
instead of being embedded inline. Use this when serving the report under a strict
Content Security Policy
that disallows inline scripts and styles. Supports
true
,
1
,
false
, and
0
.
false
Blob reporter
โ
Blob reports contain all the details about the test run and can be used later to produce any other report. Their primary function is to facilitate the merging of reports from
sharded tests
.
npx playwright
test
--reporter
=
blob
By default, the report is written into the
blob-report
directory in the package.json directory or current working directory (if no package.json is found).
The report file name looks like
report-<hash>.zip
or
report-<hash>-<shard_number>.zip
when
sharding
is used. The hash is an optional value computed from
--grep
,
--grepInverted
,
--project
,
testConfig.tag
and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or passed as
'PLAYWRIGHT_BLOB_OUTPUT_FILE'
environment variable.
Shards
Environments
When using blob report to merge multiple shards, you don't have to pass any options.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
'blob'
,
}
)
;
Blob report supports following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_BLOB_OUTPUT_DIR
outputDir
Directory to save the output. Existing content is deleted before writing the new report.
blob-report
PLAYWRIGHT_BLOB_OUTPUT_NAME
fileName
Report file name.
report-<project>-<hash>-<shard_number>.zip
PLAYWRIGHT_BLOB_OUTPUT_FILE
outputFile
Full path to the output file. If defined,
outputDir
and
fileName
will be ignored.
undefined
JSON reporter
โ
JSON reporter produces an object with all information about the test run.
Most likely you want to write the JSON to a file. When running with
--reporter=json
, use
PLAYWRIGHT_JSON_OUTPUT_NAME
environment variable:
Bash
PowerShell
Batch
PLAYWRIGHT_JSON_OUTPUT_NAME
=
results.json npx playwright
test
--reporter
=
json
In configuration file, pass options directly:
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'json'
,
{
outputFile
:
'results.json'
}
]
]
,
}
)
;
JSON report supports following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_JSON_OUTPUT_DIR
Directory to save the output file. Ignored if output file is specified.
cwd
or config directory.
PLAYWRIGHT_JSON_OUTPUT_NAME
outputFile
Base file name for the output, relative to the output dir.
JSON report is printed to the stdout.
PLAYWRIGHT_JSON_OUTPUT_FILE
outputFile
Full path to the output file. If defined,
PLAYWRIGHT_JSON_OUTPUT_DIR
and
PLAYWRIGHT_JSON_OUTPUT_NAME
will be ignored.
JSON report is printed to the stdout.
JUnit reporter
โ
JUnit reporter produces a JUnit-style xml report.
Most likely you want to write the report to an xml file. When running with
--reporter=junit
, use
PLAYWRIGHT_JUNIT_OUTPUT_NAME
environment variable:
Bash
PowerShell
Batch
PLAYWRIGHT_JUNIT_OUTPUT_NAME
=
results.xml npx playwright
test
--reporter
=
junit
In configuration file, pass options directly:
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
[
[
'junit'
,
{
outputFile
:
'results.xml'
}
]
]
,
}
)
;
JUnit report supports following configuration options and environment variables:
Environment Variable Name
Reporter Config Option
Description
Default
PLAYWRIGHT_JUNIT_OUTPUT_DIR
Directory to save the output file. Ignored if output file is not specified.
cwd
or config directory.
PLAYWRIGHT_JUNIT_OUTPUT_NAME
outputFile
Base file name for the output, relative to the output dir.
JUnit report is printed to the stdout.
PLAYWRIGHT_JUNIT_OUTPUT_FILE
outputFile
Full path to the output file. If defined,
PLAYWRIGHT_JUNIT_OUTPUT_DIR
and
PLAYWRIGHT_JUNIT_OUTPUT_NAME
will be ignored.
JUnit report is printed to the stdout.
PLAYWRIGHT_JUNIT_STRIP_ANSI
stripANSIControlSequences
Whether to remove ANSI control sequences from the text before writing it in the report.
By default output text is added as is.
PLAYWRIGHT_JUNIT_INCLUDE_PROJECT_IN_TEST_NAME
includeProjectInTestName
Whether to include Playwright project name in every test case as a name prefix.
By default not included.
PLAYWRIGHT_JUNIT_SUITE_ID
Value of the
id
attribute on the root
<testsuites/>
report entry.
Empty string.
PLAYWRIGHT_JUNIT_SUITE_NAME
Value of the
name
attribute on the root
<testsuites/>
report entry.
Empty string.
GitHub Actions annotations
โ
You can use the built in
github
reporter to get automatic failure annotations when running in GitHub actions.
Note that all other reporters work on GitHub Actions as well, but do not provide annotations. Also, it is not recommended to use this annotation type if running your tests with a matrix strategy as the stack trace failures will multiply and obscure the GitHub file view.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
// default 'list' when running locally
reporter
:
process
.
env
.
CI
?
'github'
:
'list'
,
}
)
;
Custom reporters
โ
You can create a custom reporter by implementing a class with some of the reporter methods. Learn more about the
Reporter
API.
my-awesome-reporter.ts
import
type
{
FullConfig
,
FullResult
,
Reporter
,
Suite
,
TestCase
,
TestResult
}
from
'@playwright/test/reporter'
;
class
MyReporter
implements
Reporter
{
onBegin
(
config
:
FullConfig
,
suite
:
Suite
)
{
console
.
log
(
`
Starting the run with
${
suite
.
allTests
(
)
.
length
}
tests
`
)
;
}
onTestBegin
(
test
:
TestCase
,
result
:
TestResult
)
{
console
.
log
(
`
Starting test
${
test
.
title
}
`
)
;
}
onTestEnd
(
test
:
TestCase
,
result
:
TestResult
)
{
console
.
log
(
`
Finished test
${
test
.
title
}
:
${
result
.
status
}
`
)
;
}
onEnd
(
result
:
FullResult
)
{
console
.
log
(
`
Finished the run:
${
result
.
status
}
`
)
;
}
}
export
default
MyReporter
;
Now use this reporter with
testConfig.reporter
.
playwright.config.ts
import
{
defineConfig
}
from
'@playwright/test'
;
export
default
defineConfig
(
{
reporter
:
'./my-awesome-reporter.ts'
,
}
)
;
Or just pass the reporter file path as
--reporter
command line option:
npx playwright
test
--reporter
=
"./myreporter/my-awesome-reporter.ts"
Here's a short list of open source reporter implementations that you can take a look at when writing your own reporter:
Allure Reporter
Github Actions Reporter
Mail Reporter
ReportPortal
Monocart |
| Markdown | [Skip to main content](https://playwright.dev/docs/test-reporters#__docusaurus_skipToContent_fallback)
[**Playwright**](https://playwright.dev/)
[Docs](https://playwright.dev/docs/intro)[API](https://playwright.dev/docs/api/class-playwright)
[Node.js](https://playwright.dev/docs/test-reporters)
- [Node.js](https://playwright.dev/docs/test-reporters)
- [Python](https://playwright.dev/python/docs/test-runners)
- [Java](https://playwright.dev/java/docs/test-runners)
- [.NET](https://playwright.dev/dotnet/docs/test-runners)
[Community](https://playwright.dev/community/welcome)
Search
- [Getting Started](https://playwright.dev/docs/intro)
- [Installation](https://playwright.dev/docs/intro)
- [Writing tests](https://playwright.dev/docs/writing-tests)
- [Generating tests](https://playwright.dev/docs/codegen-intro)
- [Running and debugging tests](https://playwright.dev/docs/running-tests)
- [Trace viewer](https://playwright.dev/docs/trace-viewer-intro)
- [Setting up CI](https://playwright.dev/docs/ci-intro)
- [VS Code](https://playwright.dev/docs/getting-started-vscode)
- [Coding agents](https://playwright.dev/docs/getting-started-cli)
- [Playwright MCP](https://playwright.dev/docs/getting-started-mcp)
- [Release notes](https://playwright.dev/docs/release-notes)
- [Canary releases](https://playwright.dev/docs/canary-releases)
- [Playwright Test](https://playwright.dev/docs/test-agents)
- [Agents](https://playwright.dev/docs/test-agents)
- [Annotations](https://playwright.dev/docs/test-annotations)
- [Command line](https://playwright.dev/docs/test-cli)
- [Configuration](https://playwright.dev/docs/test-configuration)
- [Configuration (use)](https://playwright.dev/docs/test-use-options)
- [Emulation](https://playwright.dev/docs/emulation)
- [Fixtures](https://playwright.dev/docs/test-fixtures)
- [Global setup and teardown](https://playwright.dev/docs/test-global-setup-teardown)
- [Parallelism](https://playwright.dev/docs/test-parallel)
- [Parameterize tests](https://playwright.dev/docs/test-parameterize)
- [Projects](https://playwright.dev/docs/test-projects)
- [Reporters](https://playwright.dev/docs/test-reporters)
- [Retries](https://playwright.dev/docs/test-retries)
- [Sharding](https://playwright.dev/docs/test-sharding)
- [Timeouts](https://playwright.dev/docs/test-timeouts)
- [TypeScript](https://playwright.dev/docs/test-typescript)
- [UI Mode](https://playwright.dev/docs/test-ui-mode)
- [Web server](https://playwright.dev/docs/test-webserver)
- [Guides](https://playwright.dev/docs/library)
- [Library](https://playwright.dev/docs/library)
- [Accessibility testing](https://playwright.dev/docs/accessibility-testing)
- [Actions](https://playwright.dev/docs/input)
- [Assertions](https://playwright.dev/docs/test-assertions)
- [API testing](https://playwright.dev/docs/api-testing)
- [Authentication](https://playwright.dev/docs/auth)
- [Auto-waiting](https://playwright.dev/docs/actionability)
- [Best Practices](https://playwright.dev/docs/best-practices)
- [Browsers](https://playwright.dev/docs/browsers)
- [Chrome extensions](https://playwright.dev/docs/chrome-extensions)
- [Clock](https://playwright.dev/docs/clock)
- [Components (experimental)](https://playwright.dev/docs/test-components)
- [Debugging Tests](https://playwright.dev/docs/debug)
- [Dialogs](https://playwright.dev/docs/dialogs)
- [Downloads](https://playwright.dev/docs/downloads)
- [Evaluating JavaScript](https://playwright.dev/docs/evaluating)
- [Events](https://playwright.dev/docs/events)
- [Extensibility](https://playwright.dev/docs/extensibility)
- [Frames](https://playwright.dev/docs/frames)
- [Handles](https://playwright.dev/docs/handles)
- [Isolation](https://playwright.dev/docs/browser-contexts)
- [Locators](https://playwright.dev/docs/locators)
- [Mock APIs](https://playwright.dev/docs/mock)
- [Mock browser APIs](https://playwright.dev/docs/mock-browser-apis)
- [Navigations](https://playwright.dev/docs/navigations)
- [Network](https://playwright.dev/docs/network)
- [Other locators](https://playwright.dev/docs/other-locators)
- [Pages](https://playwright.dev/docs/pages)
- [Page object models](https://playwright.dev/docs/pom)
- [Screenshots](https://playwright.dev/docs/screenshots)
- [Service Workers](https://playwright.dev/docs/service-workers)
- [Snapshot testing](https://playwright.dev/docs/aria-snapshots)
- [Test generator](https://playwright.dev/docs/codegen)
- [Touch events (legacy)](https://playwright.dev/docs/touch-events)
- [Trace viewer](https://playwright.dev/docs/trace-viewer)
- [Videos](https://playwright.dev/docs/videos)
- [Visual comparisons](https://playwright.dev/docs/test-snapshots)
- [WebView2](https://playwright.dev/docs/webview2)
- [Migration](https://playwright.dev/docs/protractor)
- [Integrations](https://playwright.dev/docs/docker)
- [Supported languages](https://playwright.dev/docs/languages)
- Playwright Test
- Reporters
On this page
# Reporters
## Introduction[โ](https://playwright.dev/docs/test-reporters#introduction "Direct link to Introduction")
Playwright Test comes with a few built-in reporters for different needs and ability to provide custom reporters. The easiest way to try out built-in reporters is to pass `--reporter` [command line option](https://playwright.dev/docs/test-cli).
```
npx playwright test --reporter=line
```
For more control, you can specify reporters programmatically in the [configuration file](https://playwright.dev/docs/test-configuration).
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'line',
});
```
### Multiple reporters[โ](https://playwright.dev/docs/test-reporters#multiple-reporters "Direct link to Multiple reporters")
You can use multiple reporters at the same time. For example you can use `'list'` for nice terminal output and `'json'` to get a comprehensive json file with the test results.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['list'],
['json', { outputFile: 'test-results.json' }]
],
});
```
### Reporters on CI[โ](https://playwright.dev/docs/test-reporters#reporters-on-ci "Direct link to Reporters on CI")
You can use different reporters locally and on CI. For example, using concise `'dot'` reporter avoids too much output. This is the default on CI.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
// Concise 'dot' for CI, default 'list' when running locally
reporter: process.env.CI ? 'dot' : 'list',
});
```
## Built-in reporters[โ](https://playwright.dev/docs/test-reporters#built-in-reporters "Direct link to Built-in reporters")
All built-in reporters show detailed information about failures, and mostly differ in verbosity for successful runs.
### List reporter[โ](https://playwright.dev/docs/test-reporters#list-reporter "Direct link to List reporter")
List reporter is default (except on CI where the `dot` reporter is default). It prints a line for each test being run.
```
npx playwright test --reporter=list
```
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'list',
});
```
Here is an example output in the middle of a test run. Failures will be listed at the end.
```
npx playwright test --reporter=list
Running 124 tests using 6 workers
1 โ should access error in env (438ms)
2 โ handle long test names (515ms)
3 x 1) render expected (691ms)
4 โ should timeout (932ms)
5 should repeat each:
6 โ should respect enclosing .gitignore (569ms)
7 should teardown env after timeout:
8 should respect excluded tests:
9 โ should handle env beforeEach error (638ms)
10 should respect enclosing .gitignore:
```
You can opt into the step rendering via passing the following config option:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['list', { printSteps: true }]],
});
```
List report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_LIST_PRINT_STEPS` | `printSteps` | Whether to print each step on its own line. | `false` |
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise. |
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise. |
### Line reporter[โ](https://playwright.dev/docs/test-reporters#line-reporter "Direct link to Line reporter")
Line reporter is more concise than the list reporter. It uses a single line to report last finished test, and prints failures when they occur. Line reporter is useful for large test suites where it shows the progress but does not spam the output by listing all the tests.
```
npx playwright test --reporter=line
```
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'line',
});
```
Here is an example output in the middle of a test run. Failures are reported inline.
```
npx playwright test --reporter=line
Running 124 tests using 6 workers
1) dot-reporter.spec.ts:20:1 โบ render expected ===================================================
Error: expect(received).toBe(expected) // Object.is equality
Expected: 1
Received: 0
[23/124] gitignore.spec.ts - should respect nested .gitignore
```
Line report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise. |
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise. |
### Dot reporter[โ](https://playwright.dev/docs/test-reporters#dot-reporter "Direct link to Dot reporter")
Dot reporter is very concise - it only produces a single character per successful test run. It is the default on CI and useful where you don't want a lot of output.
```
npx playwright test --reporter=dot
```
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'dot',
});
```
Here is an example output in the middle of a test run. Failures will be listed at the end.
```
npx playwright test --reporter=dot
Running 124 tests using 6 workers
ยทยทยทยทยทยทFยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
```
One character is displayed for each test that has run, indicating its status:
| Character | Description |
|---|---|
| `ยท` | Passed |
| `F` | Failed |
| `ร` | Failed or timed out - and will be retried |
| `ยฑ` | Passed on retry (flaky) |
| `T` | Timed out |
| `ยฐ` | Skipped |
Dot report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise. |
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise. |
### HTML reporter[โ](https://playwright.dev/docs/test-reporters#html-reporter "Direct link to HTML reporter")
HTML reporter produces a self-contained folder that contains report for the test run that can be served as a web page.
```
npx playwright test --reporter=html
```
By default, HTML report is opened automatically if some of the tests failed. You can control this behavior via the `open` property in the Playwright config or the `PLAYWRIGHT_HTML_OPEN` environmental variable. The possible values for that property are `always`, `never` and `on-failure` (default).
You can also configure `host` and `port` that are used to serve the HTML report.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { open: 'never' }]],
});
```
By default, report is written into the `playwright-report` folder in the current working directory. One can override that location using the `PLAYWRIGHT_HTML_OUTPUT_DIR` environment variable or a reporter configuration.
In configuration file, pass options directly:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { outputFolder: 'my-report' }]],
});
```
If you are uploading attachments from a data folder to another location, you can use `attachmentsBaseURL` option to let html report know where to look for them.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { attachmentsBaseURL: 'https://external-storage.com/' }]],
});
```
A quick way of opening the last test run report is:
```
npx playwright show-report
```
Or if there is a custom folder name:
```
npx playwright show-report my-report
```
HTML report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_HTML_TITLE` | `title` | A title to display in the generated report. | No title is displayed by default |
| `PLAYWRIGHT_HTML_OUTPUT_DIR` | `outputFolder` | Directory to save the report to. | `playwright-report` |
| `PLAYWRIGHT_HTML_OPEN` | `open` | When to open the html report in the browser, one of `'always'`, `'never'` or `'on-failure'` | `'on-failure'` |
| `PLAYWRIGHT_HTML_HOST` | `host` | When report opens in the browser, it will be served bound to this hostname. | `localhost` |
| `PLAYWRIGHT_HTML_PORT` | `port` | When report opens in the browser, it will be served on this port. | `9323` or any available port when `9323` is not available. |
| `PLAYWRIGHT_HTML_ATTACHMENTS_BASE_URL` | `attachmentsBaseURL` | A separate location where attachments from the `data` subdirectory are uploaded. Only needed when you upload report and `data` separately to different locations. | `data/` |
| `PLAYWRIGHT_HTML_NO_COPY_PROMPT` | `noCopyPrompt` | If true, disable rendering of the Copy prompt for errors. Supports `true`, `1`, `false`, and `0`. | `false` |
| `PLAYWRIGHT_HTML_NO_SNIPPETS` | `noSnippets` | If true, disable rendering code snippets in the action log. If there is a top level error, that report section with code snippet will still render. Supports `true`, `1`, `false`, and `0`. | `false` |
| `PLAYWRIGHT_HTML_DO_NOT_INLINE_ASSETS` | `doNotInlineAssets` | If true, JavaScript, CSS and report data are written as separate files alongside `index.html` instead of being embedded inline. Use this when serving the report under a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) that disallows inline scripts and styles. Supports `true`, `1`, `false`, and `0`. | `false` |
### Blob reporter[โ](https://playwright.dev/docs/test-reporters#blob-reporter "Direct link to Blob reporter")
Blob reports contain all the details about the test run and can be used later to produce any other report. Their primary function is to facilitate the merging of reports from [sharded tests](https://playwright.dev/docs/test-sharding).
```
npx playwright test --reporter=blob
```
By default, the report is written into the `blob-report` directory in the package.json directory or current working directory (if no package.json is found).
The report file name looks like `report-<hash>.zip` or `report-<hash>-<shard_number>.zip` when [sharding](https://playwright.dev/docs/test-sharding) is used. The hash is an optional value computed from `--grep`, `--grepInverted`, `--project`, [testConfig.tag](https://playwright.dev/docs/api/class-testconfig#test-config-tag) and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or passed as `'PLAYWRIGHT_BLOB_OUTPUT_FILE'` environment variable.
- Shards
- Environments
When using blob report to merge multiple shards, you don't have to pass any options.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'blob',
});
```
When running tests in different environments, you might want to use [testConfig.tag](https://playwright.dev/docs/api/class-testconfig#test-config-tag) to add a global tag corresponding to the environment. This tag will bring clarity to the merged report, and it will be used to produce a unique blob report name.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'blob',
tag: process.env.CI_ENVIRONMENT_NAME, // for example "@APIv2" or "@linux"
});
```
Blob report supports following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_BLOB_OUTPUT_DIR` | `outputDir` | Directory to save the output. Existing content is deleted before writing the new report. | `blob-report` |
| `PLAYWRIGHT_BLOB_OUTPUT_NAME` | `fileName` | Report file name. | `report-<project>-<hash>-<shard_number>.zip` |
| `PLAYWRIGHT_BLOB_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `outputDir` and `fileName` will be ignored. | `undefined` |
### JSON reporter[โ](https://playwright.dev/docs/test-reporters#json-reporter "Direct link to JSON reporter")
JSON reporter produces an object with all information about the test run.
Most likely you want to write the JSON to a file. When running with `--reporter=json`, use `PLAYWRIGHT_JSON_OUTPUT_NAME` environment variable:
- Bash
- PowerShell
- Batch
```
PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test --reporter=json
```
```
$env:PLAYWRIGHT_JSON_OUTPUT_NAME="results.json"
npx playwright test --reporter=json
```
```
set PLAYWRIGHT_JSON_OUTPUT_NAME=results.json
npx playwright test --reporter=json
```
In configuration file, pass options directly:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['json', { outputFile: 'results.json' }]],
});
```
JSON report supports following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_JSON_OUTPUT_DIR` | | Directory to save the output file. Ignored if output file is specified. | `cwd` or config directory. |
| `PLAYWRIGHT_JSON_OUTPUT_NAME` | `outputFile` | Base file name for the output, relative to the output dir. | JSON report is printed to the stdout. |
| `PLAYWRIGHT_JSON_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `PLAYWRIGHT_JSON_OUTPUT_DIR` and `PLAYWRIGHT_JSON_OUTPUT_NAME` will be ignored. | JSON report is printed to the stdout. |
### JUnit reporter[โ](https://playwright.dev/docs/test-reporters#junit-reporter "Direct link to JUnit reporter")
JUnit reporter produces a JUnit-style xml report.
Most likely you want to write the report to an xml file. When running with `--reporter=junit`, use `PLAYWRIGHT_JUNIT_OUTPUT_NAME` environment variable:
- Bash
- PowerShell
- Batch
```
PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test --reporter=junit
```
```
$env:PLAYWRIGHT_JUNIT_OUTPUT_NAME="results.xml"
npx playwright test --reporter=junit
```
```
set PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml
npx playwright test --reporter=junit
```
In configuration file, pass options directly:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['junit', { outputFile: 'results.xml' }]],
});
```
JUnit report supports following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_JUNIT_OUTPUT_DIR` | | Directory to save the output file. Ignored if output file is not specified. | `cwd` or config directory. |
| `PLAYWRIGHT_JUNIT_OUTPUT_NAME` | `outputFile` | Base file name for the output, relative to the output dir. | JUnit report is printed to the stdout. |
| `PLAYWRIGHT_JUNIT_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `PLAYWRIGHT_JUNIT_OUTPUT_DIR` and `PLAYWRIGHT_JUNIT_OUTPUT_NAME` will be ignored. | JUnit report is printed to the stdout. |
| `PLAYWRIGHT_JUNIT_STRIP_ANSI` | `stripANSIControlSequences` | Whether to remove ANSI control sequences from the text before writing it in the report. | By default output text is added as is. |
| `PLAYWRIGHT_JUNIT_INCLUDE_PROJECT_IN_TEST_NAME` | `includeProjectInTestName` | Whether to include Playwright project name in every test case as a name prefix. | By default not included. |
| `PLAYWRIGHT_JUNIT_SUITE_ID` | | Value of the `id` attribute on the root `<testsuites/>` report entry. | Empty string. |
| `PLAYWRIGHT_JUNIT_SUITE_NAME` | | Value of the `name` attribute on the root `<testsuites/>` report entry. | Empty string. |
### GitHub Actions annotations[โ](https://playwright.dev/docs/test-reporters#github-actions-annotations "Direct link to GitHub Actions annotations")
You can use the built in `github` reporter to get automatic failure annotations when running in GitHub actions.
Note that all other reporters work on GitHub Actions as well, but do not provide annotations. Also, it is not recommended to use this annotation type if running your tests with a matrix strategy as the stack trace failures will multiply and obscure the GitHub file view.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
// default 'list' when running locally
reporter: process.env.CI ? 'github' : 'list',
});
```
## Custom reporters[โ](https://playwright.dev/docs/test-reporters#custom-reporters "Direct link to Custom reporters")
You can create a custom reporter by implementing a class with some of the reporter methods. Learn more about the [Reporter](https://playwright.dev/docs/api/class-reporter "Reporter") API.
my-awesome-reporter.ts
```
import type {
FullConfig, FullResult, Reporter, Suite, TestCase, TestResult
} from '@playwright/test/reporter';
class MyReporter implements Reporter {
onBegin(config: FullConfig, suite: Suite) {
console.log(`Starting the run with ${suite.allTests().length} tests`);
}
onTestBegin(test: TestCase, result: TestResult) {
console.log(`Starting test ${test.title}`);
}
onTestEnd(test: TestCase, result: TestResult) {
console.log(`Finished test ${test.title}: ${result.status}`);
}
onEnd(result: FullResult) {
console.log(`Finished the run: ${result.status}`);
}
}
export default MyReporter;
```
Now use this reporter with [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter).
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: './my-awesome-reporter.ts',
});
```
Or just pass the reporter file path as `--reporter` command line option:
```
npx playwright test --reporter="./myreporter/my-awesome-reporter.ts"
```
Here's a short list of open source reporter implementations that you can take a look at when writing your own reporter:
- [Allure Reporter](https://github.com/allure-framework/allure-js/tree/main/packages/allure-playwright)
- [Github Actions Reporter](https://github.com/estruyf/playwright-github-actions-reporter)
- [Mail Reporter](https://github.com/estruyf/playwright-mail-reporter)
- [ReportPortal](https://github.com/reportportal/agent-js-playwright)
- [Monocart](https://github.com/cenfun/monocart-reporter)
[PreviousProjects](https://playwright.dev/docs/test-projects)
[NextRetries](https://playwright.dev/docs/test-retries)
- [Introduction](https://playwright.dev/docs/test-reporters#introduction)
- [Multiple reporters](https://playwright.dev/docs/test-reporters#multiple-reporters)
- [Reporters on CI](https://playwright.dev/docs/test-reporters#reporters-on-ci)
- [Built-in reporters](https://playwright.dev/docs/test-reporters#built-in-reporters)
- [List reporter](https://playwright.dev/docs/test-reporters#list-reporter)
- [Line reporter](https://playwright.dev/docs/test-reporters#line-reporter)
- [Dot reporter](https://playwright.dev/docs/test-reporters#dot-reporter)
- [HTML reporter](https://playwright.dev/docs/test-reporters#html-reporter)
- [Blob reporter](https://playwright.dev/docs/test-reporters#blob-reporter)
- [JSON reporter](https://playwright.dev/docs/test-reporters#json-reporter)
- [JUnit reporter](https://playwright.dev/docs/test-reporters#junit-reporter)
- [GitHub Actions annotations](https://playwright.dev/docs/test-reporters#github-actions-annotations)
- [Custom reporters](https://playwright.dev/docs/test-reporters#custom-reporters)
Learn
- [Getting started](https://playwright.dev/docs/intro)
- [Playwright Training](https://learn.microsoft.com/en-us/training/modules/build-with-playwright/)
- [Learn Videos](https://playwright.dev/community/learn-videos)
- [Feature Videos](https://playwright.dev/community/feature-videos)
Community
- [Stack Overflow](https://stackoverflow.com/questions/tagged/playwright)
- [Discord](https://aka.ms/playwright/discord)
- [Twitter](https://twitter.com/playwrightweb)
- [LinkedIn](https://www.linkedin.com/company/playwrightweb)
More
- [GitHub](https://github.com/microsoft/playwright)
- [YouTube](https://www.youtube.com/channel/UC46Zj8pDH5tDosqm1gd7WTg)
- [Blog](https://dev.to/playwright)
- [Ambassadors](https://playwright.dev/community/ambassadors)
- [Microsoft Privacy Statement](https://go.microsoft.com/fwlink/?LinkId=521839)
Copyright ยฉ 2026 Microsoft |
| Readable Markdown | ## Introduction[โ](https://playwright.dev/docs/test-reporters#introduction "Direct link to Introduction")
Playwright Test comes with a few built-in reporters for different needs and ability to provide custom reporters. The easiest way to try out built-in reporters is to pass `--reporter` [command line option](https://playwright.dev/docs/test-cli).
```
npx playwright test --reporter=line
```
For more control, you can specify reporters programmatically in the [configuration file](https://playwright.dev/docs/test-configuration).
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'line',
});
```
### Multiple reporters[โ](https://playwright.dev/docs/test-reporters#multiple-reporters "Direct link to Multiple reporters")
You can use multiple reporters at the same time. For example you can use `'list'` for nice terminal output and `'json'` to get a comprehensive json file with the test results.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['list'],
['json', { outputFile: 'test-results.json' }]
],
});
```
### Reporters on CI[โ](https://playwright.dev/docs/test-reporters#reporters-on-ci "Direct link to Reporters on CI")
You can use different reporters locally and on CI. For example, using concise `'dot'` reporter avoids too much output. This is the default on CI.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
// Concise 'dot' for CI, default 'list' when running locally
reporter: process.env.CI ? 'dot' : 'list',
});
```
## Built-in reporters[โ](https://playwright.dev/docs/test-reporters#built-in-reporters "Direct link to Built-in reporters")
All built-in reporters show detailed information about failures, and mostly differ in verbosity for successful runs.
### List reporter[โ](https://playwright.dev/docs/test-reporters#list-reporter "Direct link to List reporter")
List reporter is default (except on CI where the `dot` reporter is default). It prints a line for each test being run.
```
npx playwright test --reporter=list
```
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'list',
});
```
Here is an example output in the middle of a test run. Failures will be listed at the end.
```
npx playwright test --reporter=list
Running 124 tests using 6 workers
1 โ should access error in env (438ms)
2 โ handle long test names (515ms)
3 x 1) render expected (691ms)
4 โ should timeout (932ms)
5 should repeat each:
6 โ should respect enclosing .gitignore (569ms)
7 should teardown env after timeout:
8 should respect excluded tests:
9 โ should handle env beforeEach error (638ms)
10 should respect enclosing .gitignore:
```
You can opt into the step rendering via passing the following config option:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['list', { printSteps: true }]],
});
```
List report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_LIST_PRINT_STEPS` | `printSteps` | Whether to print each step on its own line. | `false` |
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise. |
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise. |
### Line reporter[โ](https://playwright.dev/docs/test-reporters#line-reporter "Direct link to Line reporter")
Line reporter is more concise than the list reporter. It uses a single line to report last finished test, and prints failures when they occur. Line reporter is useful for large test suites where it shows the progress but does not spam the output by listing all the tests.
```
npx playwright test --reporter=line
```
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'line',
});
```
Here is an example output in the middle of a test run. Failures are reported inline.
```
npx playwright test --reporter=line
Running 124 tests using 6 workers
1) dot-reporter.spec.ts:20:1 โบ render expected ===================================================
Error: expect(received).toBe(expected) // Object.is equality
Expected: 1
Received: 0
[23/124] gitignore.spec.ts - should respect nested .gitignore
```
Line report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise. |
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise. |
### Dot reporter[โ](https://playwright.dev/docs/test-reporters#dot-reporter "Direct link to Dot reporter")
Dot reporter is very concise - it only produces a single character per successful test run. It is the default on CI and useful where you don't want a lot of output.
```
npx playwright test --reporter=dot
```
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'dot',
});
```
Here is an example output in the middle of a test run. Failures will be listed at the end.
```
npx playwright test --reporter=dot
Running 124 tests using 6 workers
ยทยทยทยทยทยทFยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
```
One character is displayed for each test that has run, indicating its status:
| Character | Description |
|---|---|
| `ยท` | Passed |
| `F` | Failed |
| `ร` | Failed or timed out - and will be retried |
| `ยฑ` | Passed on retry (flaky) |
| `T` | Timed out |
| `ยฐ` | Skipped |
Dot report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_FORCE_TTY` | | Whether to produce output suitable for a live terminal. Supports `true`, `1`, `false`, `0`, `[WIDTH]`, and `[WIDTH]x[HEIGHT]`. `[WIDTH]` and `[WIDTH]x[HEIGHT]` specifies the TTY dimensions. | `true` when terminal is in TTY mode, `false` otherwise. |
| `FORCE_COLOR` | | Whether to produce colored output. | `true` when terminal is in TTY mode, `false` otherwise. |
### HTML reporter[โ](https://playwright.dev/docs/test-reporters#html-reporter "Direct link to HTML reporter")
HTML reporter produces a self-contained folder that contains report for the test run that can be served as a web page.
```
npx playwright test --reporter=html
```
By default, HTML report is opened automatically if some of the tests failed. You can control this behavior via the `open` property in the Playwright config or the `PLAYWRIGHT_HTML_OPEN` environmental variable. The possible values for that property are `always`, `never` and `on-failure` (default).
You can also configure `host` and `port` that are used to serve the HTML report.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { open: 'never' }]],
});
```
By default, report is written into the `playwright-report` folder in the current working directory. One can override that location using the `PLAYWRIGHT_HTML_OUTPUT_DIR` environment variable or a reporter configuration.
In configuration file, pass options directly:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { outputFolder: 'my-report' }]],
});
```
If you are uploading attachments from a data folder to another location, you can use `attachmentsBaseURL` option to let html report know where to look for them.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { attachmentsBaseURL: 'https://external-storage.com/' }]],
});
```
A quick way of opening the last test run report is:
```
npx playwright show-report
```
Or if there is a custom folder name:
```
npx playwright show-report my-report
```
HTML report supports the following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_HTML_TITLE` | `title` | A title to display in the generated report. | No title is displayed by default |
| `PLAYWRIGHT_HTML_OUTPUT_DIR` | `outputFolder` | Directory to save the report to. | `playwright-report` |
| `PLAYWRIGHT_HTML_OPEN` | `open` | When to open the html report in the browser, one of `'always'`, `'never'` or `'on-failure'` | `'on-failure'` |
| `PLAYWRIGHT_HTML_HOST` | `host` | When report opens in the browser, it will be served bound to this hostname. | `localhost` |
| `PLAYWRIGHT_HTML_PORT` | `port` | When report opens in the browser, it will be served on this port. | `9323` or any available port when `9323` is not available. |
| `PLAYWRIGHT_HTML_ATTACHMENTS_BASE_URL` | `attachmentsBaseURL` | A separate location where attachments from the `data` subdirectory are uploaded. Only needed when you upload report and `data` separately to different locations. | `data/` |
| `PLAYWRIGHT_HTML_NO_COPY_PROMPT` | `noCopyPrompt` | If true, disable rendering of the Copy prompt for errors. Supports `true`, `1`, `false`, and `0`. | `false` |
| `PLAYWRIGHT_HTML_NO_SNIPPETS` | `noSnippets` | If true, disable rendering code snippets in the action log. If there is a top level error, that report section with code snippet will still render. Supports `true`, `1`, `false`, and `0`. | `false` |
| `PLAYWRIGHT_HTML_DO_NOT_INLINE_ASSETS` | `doNotInlineAssets` | If true, JavaScript, CSS and report data are written as separate files alongside `index.html` instead of being embedded inline. Use this when serving the report under a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) that disallows inline scripts and styles. Supports `true`, `1`, `false`, and `0`. | `false` |
### Blob reporter[โ](https://playwright.dev/docs/test-reporters#blob-reporter "Direct link to Blob reporter")
Blob reports contain all the details about the test run and can be used later to produce any other report. Their primary function is to facilitate the merging of reports from [sharded tests](https://playwright.dev/docs/test-sharding).
```
npx playwright test --reporter=blob
```
By default, the report is written into the `blob-report` directory in the package.json directory or current working directory (if no package.json is found).
The report file name looks like `report-<hash>.zip` or `report-<hash>-<shard_number>.zip` when [sharding](https://playwright.dev/docs/test-sharding) is used. The hash is an optional value computed from `--grep`, `--grepInverted`, `--project`, [testConfig.tag](https://playwright.dev/docs/api/class-testconfig#test-config-tag) and file filters passed as command line arguments. The hash guarantees that running Playwright with different command line options will produce different but stable between runs report names. The output file name can be overridden in the configuration file or passed as `'PLAYWRIGHT_BLOB_OUTPUT_FILE'` environment variable.
- Shards
- Environments
When using blob report to merge multiple shards, you don't have to pass any options.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: 'blob',
});
```
Blob report supports following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_BLOB_OUTPUT_DIR` | `outputDir` | Directory to save the output. Existing content is deleted before writing the new report. | `blob-report` |
| `PLAYWRIGHT_BLOB_OUTPUT_NAME` | `fileName` | Report file name. | `report-<project>-<hash>-<shard_number>.zip` |
| `PLAYWRIGHT_BLOB_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `outputDir` and `fileName` will be ignored. | `undefined` |
### JSON reporter[โ](https://playwright.dev/docs/test-reporters#json-reporter "Direct link to JSON reporter")
JSON reporter produces an object with all information about the test run.
Most likely you want to write the JSON to a file. When running with `--reporter=json`, use `PLAYWRIGHT_JSON_OUTPUT_NAME` environment variable:
- Bash
- PowerShell
- Batch
```
PLAYWRIGHT_JSON_OUTPUT_NAME=results.json npx playwright test --reporter=json
```
In configuration file, pass options directly:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['json', { outputFile: 'results.json' }]],
});
```
JSON report supports following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_JSON_OUTPUT_DIR` | | Directory to save the output file. Ignored if output file is specified. | `cwd` or config directory. |
| `PLAYWRIGHT_JSON_OUTPUT_NAME` | `outputFile` | Base file name for the output, relative to the output dir. | JSON report is printed to the stdout. |
| `PLAYWRIGHT_JSON_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `PLAYWRIGHT_JSON_OUTPUT_DIR` and `PLAYWRIGHT_JSON_OUTPUT_NAME` will be ignored. | JSON report is printed to the stdout. |
### JUnit reporter[โ](https://playwright.dev/docs/test-reporters#junit-reporter "Direct link to JUnit reporter")
JUnit reporter produces a JUnit-style xml report.
Most likely you want to write the report to an xml file. When running with `--reporter=junit`, use `PLAYWRIGHT_JUNIT_OUTPUT_NAME` environment variable:
- Bash
- PowerShell
- Batch
```
PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml npx playwright test --reporter=junit
```
In configuration file, pass options directly:
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['junit', { outputFile: 'results.xml' }]],
});
```
JUnit report supports following configuration options and environment variables:
| Environment Variable Name | Reporter Config Option | Description | Default |
|---|---|---|---|
| `PLAYWRIGHT_JUNIT_OUTPUT_DIR` | | Directory to save the output file. Ignored if output file is not specified. | `cwd` or config directory. |
| `PLAYWRIGHT_JUNIT_OUTPUT_NAME` | `outputFile` | Base file name for the output, relative to the output dir. | JUnit report is printed to the stdout. |
| `PLAYWRIGHT_JUNIT_OUTPUT_FILE` | `outputFile` | Full path to the output file. If defined, `PLAYWRIGHT_JUNIT_OUTPUT_DIR` and `PLAYWRIGHT_JUNIT_OUTPUT_NAME` will be ignored. | JUnit report is printed to the stdout. |
| `PLAYWRIGHT_JUNIT_STRIP_ANSI` | `stripANSIControlSequences` | Whether to remove ANSI control sequences from the text before writing it in the report. | By default output text is added as is. |
| `PLAYWRIGHT_JUNIT_INCLUDE_PROJECT_IN_TEST_NAME` | `includeProjectInTestName` | Whether to include Playwright project name in every test case as a name prefix. | By default not included. |
| `PLAYWRIGHT_JUNIT_SUITE_ID` | | Value of the `id` attribute on the root `<testsuites/>` report entry. | Empty string. |
| `PLAYWRIGHT_JUNIT_SUITE_NAME` | | Value of the `name` attribute on the root `<testsuites/>` report entry. | Empty string. |
### GitHub Actions annotations[โ](https://playwright.dev/docs/test-reporters#github-actions-annotations "Direct link to GitHub Actions annotations")
You can use the built in `github` reporter to get automatic failure annotations when running in GitHub actions.
Note that all other reporters work on GitHub Actions as well, but do not provide annotations. Also, it is not recommended to use this annotation type if running your tests with a matrix strategy as the stack trace failures will multiply and obscure the GitHub file view.
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
// default 'list' when running locally
reporter: process.env.CI ? 'github' : 'list',
});
```
## Custom reporters[โ](https://playwright.dev/docs/test-reporters#custom-reporters "Direct link to Custom reporters")
You can create a custom reporter by implementing a class with some of the reporter methods. Learn more about the [Reporter](https://playwright.dev/docs/api/class-reporter "Reporter") API.
my-awesome-reporter.ts
```
import type {
FullConfig, FullResult, Reporter, Suite, TestCase, TestResult
} from '@playwright/test/reporter';
class MyReporter implements Reporter {
onBegin(config: FullConfig, suite: Suite) {
console.log(`Starting the run with ${suite.allTests().length} tests`);
}
onTestBegin(test: TestCase, result: TestResult) {
console.log(`Starting test ${test.title}`);
}
onTestEnd(test: TestCase, result: TestResult) {
console.log(`Finished test ${test.title}: ${result.status}`);
}
onEnd(result: FullResult) {
console.log(`Finished the run: ${result.status}`);
}
}
export default MyReporter;
```
Now use this reporter with [testConfig.reporter](https://playwright.dev/docs/api/class-testconfig#test-config-reporter).
playwright.config.ts
```
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: './my-awesome-reporter.ts',
});
```
Or just pass the reporter file path as `--reporter` command line option:
```
npx playwright test --reporter="./myreporter/my-awesome-reporter.ts"
```
Here's a short list of open source reporter implementations that you can take a look at when writing your own reporter:
- [Allure Reporter](https://github.com/allure-framework/allure-js/tree/main/packages/allure-playwright)
- [Github Actions Reporter](https://github.com/estruyf/playwright-github-actions-reporter)
- [Mail Reporter](https://github.com/estruyf/playwright-mail-reporter)
- [ReportPortal](https://github.com/reportportal/agent-js-playwright)
- [Monocart](https://github.com/cenfun/monocart-reporter) |
| Shard | 172 (laksa) |
| Root Hash | 8477144470764827772 |
| Unparsed URL | dev,playwright!/docs/test-reporters s443 |