From 3e17bd542ae0ee5b20665c0fabeeff2d3f7bf9b0 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 18 Nov 2025 07:41:00 -0800 Subject: [PATCH] docs: update web server wait docs --- docs/src/test-api/class-testconfig.md | 1 - docs/src/test-webserver-js.md | 6 ++++-- packages/playwright/types/test.d.ts | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index 018a4ecb1b479..0c83d42c07689 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -707,7 +707,6 @@ export default defineConfig({ - `wait` ?<[Object]> Consider command started only when given output has been produced. - `stdout` ?<[RegExp]> Regular expression to wait for in the `stdout` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. - `stderr` ?<[RegExp]> Regular expression to wait for in the `stderr` of the command output. Named capture groups are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. - - `time` ?<[int]> - `timeout` ?<[int]> How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. - `url` ?<[string]> The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Redirects (3xx status codes) are being followed and the new location is checked. Either `port` or `url` should be specified. diff --git a/docs/src/test-webserver-js.md b/docs/src/test-webserver-js.md index a8c0674b7093e..3022691851ab0 100644 --- a/docs/src/test-webserver-js.md +++ b/docs/src/test-webserver-js.md @@ -35,11 +35,13 @@ export default defineConfig({ | `gracefulShutdown` | How to shut down the process. If unspecified, the process group is forcefully `SIGKILL`ed. If set to `{ signal: 'SIGTERM', timeout: 500 }`, the process group is sent a `SIGTERM` signal, followed by `SIGKILL` if it doesn't exit within 500ms. You can also use `SIGINT` as the signal instead. A `0` timeout means no `SIGKILL` will be sent. Windows doesn't support `SIGTERM` and `SIGINT` signals, so this option is ignored on Windows. Note that shutting down a Docker container requires `SIGTERM`. | | `ignoreHTTPSErrors` | Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`. | | `name` | Specifies a custom name for the web server. This name will be prefixed to log messages. Defaults to `[WebServer]`. | -| `reuseExistingServer`| If `true`, it will re-use an existing server on the url when available. If no server is running on that url, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the url. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable. | +| `port` | **Deprecated**. User `url` instead. The port that your http server is expected to appear on. It does wait until it accepts connections. Either `port` or `url` should be specified. | +| `reuseExistingServer`| If `true`, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running tests locally. | | `stderr` | Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`. | | `stdout` | If `"pipe"`, it will pipe the stdout of the command to the process stdout. If `"ignore"`, it will ignore the stdout of the command. Default to `"ignore"`. | | `timeout` | How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. | -| `url`| URL of your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. | +| `url`| URL of your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Either `port` or `url` should be specified. | +| `wait` | Consider command started only when given output has been produced. Takes an object with optional `stdout` and/or `stderr` regular expressions. Named capture groups in the regex are stored in the environment, for example `/Listening on port (?\\d+)/` will store the port number in `process.env['MY_SERVER_PORT']`. | ## Adding a server timeout diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 30006e2aafc65..630d8ce04dc04 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -10211,8 +10211,6 @@ interface TestConfigWebServer { * `process.env['MY_SERVER_PORT']`. */ stderr?: RegExp; - - time?: number; }; /**