docs: fix config.metadata docs

This commit is contained in:
Simon Knott 2024-12-30 14:34:30 +01:00
parent 4819747c85
commit 526c575683
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 23 additions and 4 deletions

View file

@ -234,7 +234,7 @@ export default defineConfig({
* since: v1.10 * since: v1.10
- type: ?<[Metadata]> - 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** **Usage**
@ -242,7 +242,16 @@ Metadata that will be put directly to the test report serialized as JSON.
import { defineConfig } from '@playwright/test'; import { defineConfig } from '@playwright/test';
export default defineConfig({ export default defineConfig({
metadata: 'acceptance tests', metadata: {
'revision.id': '9ba375c06344835d783fe60bf33f857f9bc208a4',
'revision.author': 'Alice Bobson',
'revision.email': 'alice@playwright.dev',
'revision.subject': 'fix: improve accounts page accessibility',
'revision.timestamp': 1735565401757, // also accepts Date object
'revision.link': 'https://github.com/microsoft/playwright/commit/9ba375c06344835d783fe60bf33f857f9bc208a4',
'ci.link': 'https://github.com/microsoft/playwright/actions/runs/12546864899',
'timestamp': 1735565580248,
},
}); });
``` ```

View file

@ -1220,7 +1220,8 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
maxFailures?: number; 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** * **Usage**
* *
@ -1229,7 +1230,16 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
* import { defineConfig } from '@playwright/test'; * import { defineConfig } from '@playwright/test';
* *
* export default defineConfig({ * export default defineConfig({
* metadata: 'acceptance tests', * metadata: {
* 'revision.id': '9ba375c06344835d783fe60bf33f857f9bc208a4',
* 'revision.author': 'Alice Bobson',
* 'revision.email': 'alice@playwright.dev',
* 'revision.subject': 'fix: improve accounts page accessibility',
* 'revision.timestamp': 1735565401757, // also accepts Date object
* 'revision.link': 'https://github.com/microsoft/playwright/commit/9ba375c06344835d783fe60bf33f857f9bc208a4',
* 'ci.link': 'https://github.com/microsoft/playwright/actions/runs/12546864899',
* 'timestamp': 1735565580248,
* },
* }); * });
* ``` * ```
* *