Skip to content

docs: fix config.metadata docs #34170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/src/test-api/class-testconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,24 @@ export default defineConfig({
* since: v1.10
- type: ?<[Metadata]>

Metadata that will be put directly to the test report serialized as JSON.
Metadata that's made available to the test reporter. The example shows all field supported by Playwright built-in reporters. Custom reporters might support different fields.

**Usage**

```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';

export default defineConfig({
metadata: 'acceptance tests',
metadata: {
'revision.id': '9ba375c06344835d783fe60bf33f857f9bc208a4',
'revision.author': 'Alice Bobson',
'revision.email': '[email protected]',
'revision.subject': 'fix: improve accounts page accessibility',
'revision.timestamp': 1735565401757, // also accepts Date object
'revision.link': 'https://github.com/microsoft/playwright/commit/9ba375c',
'ci.link': 'https://github.com/microsoft/playwright/actions/runs/12546864899',
'timestamp': 1735565580248,
},
});
```

Expand Down
14 changes: 12 additions & 2 deletions packages/playwright/types/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,8 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
maxFailures?: number;

/**
* Metadata that will be put directly to the test report serialized as JSON.
* Metadata that's made available to the test reporter. The example shows all field supported by Playwright built-in
* reporters. Custom reporters might support different fields.
*
* **Usage**
*
Expand All @@ -1229,7 +1230,16 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
* import { defineConfig } from '@playwright/test';
*
* export default defineConfig({
* metadata: 'acceptance tests',
* metadata: {
* 'revision.id': '9ba375c06344835d783fe60bf33f857f9bc208a4',
* 'revision.author': 'Alice Bobson',
* 'revision.email': '[email protected]',
* 'revision.subject': 'fix: improve accounts page accessibility',
* 'revision.timestamp': 1735565401757, // also accepts Date object
* 'revision.link': 'https://github.com/microsoft/playwright/commit/9ba375c',
* 'ci.link': 'https://github.com/microsoft/playwright/actions/runs/12546864899',
* 'timestamp': 1735565580248,
* },
* });
* ```
*
Expand Down
Loading