From e10199fd5a13206d35ace1b251ea45809c11e671 Mon Sep 17 00:00:00 2001 From: Debbie O'Brien Date: Thu, 2 Mar 2023 17:33:30 +0100 Subject: [PATCH] docs: retries update to add configuration (#21338) --- docs/src/test-retries-js.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/docs/src/test-retries-js.md b/docs/src/test-retries-js.md index 9be321c456..35e84eebe5 100644 --- a/docs/src/test-retries-js.md +++ b/docs/src/test-retries-js.md @@ -63,27 +63,16 @@ This scheme works perfectly for independent tests and guarantees that failing te ## 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 # Give failing tests 3 retry attempts npx playwright test --retries=3 ``` -```js tab=js-js -// playwright.config.js -// @ts-check +You can configure retries in the configuration file: -const { defineConfig } = require('@playwright/test'); - -module.exports = defineConfig({ - // Give failing tests 3 retry attempts - retries: 3, -}); -``` - -```js tab=js-ts -// playwright.config.ts +```js import { defineConfig } from '@playwright/test'; export default defineConfig({ @@ -272,7 +261,7 @@ test('runs first', async () => { await page.goto('https://playwright.dev/'); }); -test('runs second', async () => { +test('runs second', async () => { await page.getByText('Get Started').click(); }); ```