playwright/docs/src/test-retries.md

37 lines
764 B
Markdown
Raw Normal View History

2021-05-27 20:30:03 -07:00
---
id: test-retries
title: "Test retry"
---
Playwright Test will retry tests if they failed. Pass the maximum number of retries when running the tests, or set them in the [configuration file](./test-configuration.md).
```bash
2021-05-27 20:30:03 -07:00
npx playwright test --retries=3
```
```js
// playwright.config.js
module.exports = {
retries: 3,
};
```
```ts
// playwright.config.ts
import { PlaywrightTestConfig } from 'playwright/test';
const config: PlaywrightTestConfig = {
retries: 3,
};
export default config;
```
Failing tests will be retried multiple times until they pass, or until the maximum number of retries is reached. Playwright Test will report all tests that failed at least once.
2021-05-27 20:30:03 -07:00
```bash
2021-05-27 20:30:03 -07:00
Running 1 test using 1 worker
××±
1 flaky
1) my.test.js:1:1
```