From 526c575683d8c639fe24bc1f986fb5941a2c2e53 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 30 Dec 2024 14:34:30 +0100 Subject: [PATCH] docs: fix config.metadata docs --- docs/src/test-api/class-testconfig.md | 13 +++++++++++-- packages/playwright/types/test.d.ts | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index 37b9ca5f27..0151c706b8 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -234,7 +234,7 @@ 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** @@ -242,7 +242,16 @@ Metadata that will be put directly to the test report serialized as JSON. import { defineConfig } from '@playwright/test'; 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, + }, }); ``` diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 7c9cae5415..5c0feb0f7f 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -1220,7 +1220,8 @@ interface TestConfig { 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** * @@ -1229,7 +1230,16 @@ interface TestConfig { * import { defineConfig } from '@playwright/test'; * * 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, + * }, * }); * ``` *