Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions nodejs/docs/api/class-fullconfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ fullConfig.configFile

---

### failOnFlakyTests {#full-config-fail-on-flaky-tests}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.52</font><x-search>fullConfig.failOnFlakyTests</x-search>

See [testConfig.failOnFlakyTests](/api/class-testconfig.mdx#test-config-fail-on-flaky-tests).

**Usage**

```js
fullConfig.failOnFlakyTests
```

**Type**
- [boolean]

---

### forbidOnly {#full-config-forbid-only}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.10</font><x-search>fullConfig.forbidOnly</x-search>
Expand Down
51 changes: 37 additions & 14 deletions nodejs/docs/api/class-testconfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,29 @@ export default defineConfig({

---

### failOnFlakyTests {#test-config-fail-on-flaky-tests}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.52</font><x-search>testConfig.failOnFlakyTests</x-search>

Whether to exit with an error if any tests are marked as flaky. Useful on CI.

Also available in the [command line](../test-cli.mdx) with the `--fail-on-flaky-tests` option.

**Usage**

```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';

export default defineConfig({
failOnFlakyTests: !!process.env.CI,
});
```

**Type**
- [boolean]

---

### forbidOnly {#test-config-forbid-only}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.10</font><x-search>testConfig.forbidOnly</x-search>
Expand Down Expand Up @@ -1035,38 +1058,38 @@ export default defineConfig({
- `env` [Object]&lt;[string], [string]&gt; *(optional)*

Environment variables to set for the command, `process.env` by default.
- `gracefulShutdown` [Object] *(optional)*
- `signal` "SIGINT" | "SIGTERM"


- `timeout` [number]


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` [boolean] *(optional)*

Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`.
- `name` [string] *(optional)*

Specifies a custom name for the web server. This name will be prefixed to log messages. Defaults to `[WebServer]`.
- `port` [number] *(optional)*

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` [boolean] *(optional)*

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.
- `stdout` "pipe" | "ignore" *(optional)*

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"`.
- `stderr` "pipe" | "ignore" *(optional)*

Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`.
- `stdout` "pipe" | "ignore" *(optional)*

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` [number] *(optional)*

How long to wait for the process to start up and be available in milliseconds. Defaults to 60000.
- `gracefulShutdown` [Object] *(optional)*
- `signal` "SIGINT" | "SIGTERM"


- `timeout` [number]


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`.
- `url` [string] *(optional)*

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.
- `name` [string] *(optional)*

Specifies a custom name for the web server. This name will be prefixed to log messages. Defaults to `[WebServer]`.

**Details**

Expand Down
13 changes: 7 additions & 6 deletions nodejs/docs/test-webserver.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ export default defineConfig({
| :- | :- |
| [testConfig.webServer](/api/class-testconfig.mdx#test-config-web-server) | Launch a development web server (or multiple) during the tests. |
| `command`| Shell command to start the local dev server of your app. |
| `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. |
| `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. |
| `ignoreHTTPSErrors` | Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`. |
| `cwd` | Current working directory of the spawned process, defaults to the directory of the configuration file. |
| `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"`. |
| `stderr` | Whether to pipe the stderr of the command to the process stderr or ignore it. Defaults to `"pipe"`. |
| `timeout` | How long to wait for the process to start up and be available in milliseconds. Defaults to 60000. |
| `env` | Environment variables to set for the command, `process.env` by default. |
| `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. |
| `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. |

## Adding a server timeout

Expand Down
Loading