From 50f22f13a44adb4cccf0b92b72c2b6d4187eb813 Mon Sep 17 00:00:00 2001 From: Adam Gastineau Date: Wed, 5 Feb 2025 06:10:32 -0800 Subject: [PATCH] docs: document config executing multiple times (#34576) --- docs/src/test-api/class-testproject.md | 4 ++++ packages/playwright/types/test.d.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/src/test-api/class-testproject.md b/docs/src/test-api/class-testproject.md index d9814708ef..17fecf6930 100644 --- a/docs/src/test-api/class-testproject.md +++ b/docs/src/test-api/class-testproject.md @@ -183,6 +183,10 @@ Metadata that will be put directly to the test report serialized as JSON. Project name is visible in the report and during test execution. +:::warning +Playwright executes the configuration file multiple times. Do not dynamically produce non-stable values in your configuration. +::: + ## property: TestProject.snapshotDir * since: v1.10 - type: ?<[string]> diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 95eb71d899..5fc76a9168 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -349,6 +349,10 @@ interface TestProject { /** * Project name is visible in the report and during test execution. + * + * **NOTE** Playwright executes the configuration file multiple times. Do not dynamically produce non-stable values in + * your configuration. + * */ name?: string;