docs: retries update to add configuration (#21338)
This commit is contained in:
parent
bfc895787f
commit
e10199fd5a
|
|
@ -63,27 +63,16 @@ This scheme works perfectly for independent tests and guarantees that failing te
|
||||||
|
|
||||||
## Retries
|
## Retries
|
||||||
|
|
||||||
Playwright Test supports **test retries**. When enabled, failing tests will be retried multiple times until they pass, or until the maximum number of retries is reached. By default failing tests are not retried.
|
Playwright supports **test retries**. When enabled, failing tests will be retried multiple times until they pass, or until the maximum number of retries is reached. By default failing tests are not retried.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Give failing tests 3 retry attempts
|
# Give failing tests 3 retry attempts
|
||||||
npx playwright test --retries=3
|
npx playwright test --retries=3
|
||||||
```
|
```
|
||||||
|
|
||||||
```js tab=js-js
|
You can configure retries in the configuration file:
|
||||||
// playwright.config.js
|
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
const { defineConfig } = require('@playwright/test');
|
```js
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
// Give failing tests 3 retry attempts
|
|
||||||
retries: 3,
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
```js tab=js-ts
|
|
||||||
// playwright.config.ts
|
|
||||||
import { defineConfig } from '@playwright/test';
|
import { defineConfig } from '@playwright/test';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue