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/docs/src/test-configuration-js.md b/docs/src/test-configuration-js.md index 4c0c9e90e2..822bd4ea0d 100644 --- a/docs/src/test-configuration-js.md +++ b/docs/src/test-configuration-js.md @@ -68,10 +68,6 @@ export default defineConfig({ | [`property: TestConfig.webServer`] | To launch a server during the tests, use the `webServer` option | | [`property: TestConfig.workers`] | The maximum number of concurrent worker processes to use for parallelizing tests. Can also be set as percentage of logical CPU cores, e.g. `'50%'.`. See [Parallelism](./test-parallel) and [Sharding](./test-sharding) for more details. | -:::warning -Playwright executes the configuration file multiple times. Do not dynamically produce non-stable values in your configuration (for example, using the current datetime in [`property: TestProject.name`]). -::: - ## Filtering Tests Filter tests by glob patterns or regular expressions. diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index b1d38068e8..106db979b8 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;