docs: improve test.describe.configure() (#18705)

This commit is contained in:
Dmitry Gozman 2022-11-10 12:29:38 -08:00 committed by GitHub
parent 7c80b77c57
commit 6d456d30dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -343,17 +343,17 @@ test('runs first', async ({ page }) => {});
test('runs second', async ({ page }) => {});
```
Configuring retries and timeout:
Configuring retries and timeout for each test:
```js tab=js-js
// All tests in the file will be retried twice and have a timeout of 20 seconds.
// Each test in the file will be retried twice and have a timeout of 20 seconds.
test.describe.configure({ retries: 2, timeout: 20_000 });
test('runs first', async ({ page }) => {});
test('runs second', async ({ page }) => {});
```
```js tab=js-ts
// All tests in the file will be retried twice and have a timeout of 20 seconds.
// Each test in the file will be retried twice and have a timeout of 20 seconds.
test.describe.configure({ retries: 2, timeout: 20_000 });
test('runs first', async ({ page }) => {});
test('runs second', async ({ page }) => {});
@ -363,14 +363,20 @@ test('runs second', async ({ page }) => {});
* since: v1.10
- `mode` <[TestMode]<"parallel"|"serial">>
Execution mode. Learn more about the execution modes [here](../test-parallel.md).
### option: Test.describe.configure.retries
* since: v1.28
- `retries` <[int]>
The number of retries for each test.
### option: Test.describe.configure.timeout
* since: v1.28
- `timeout` <[int]>
Timeout for each test in milliseconds. Overrides [`property: TestProject.timeout`] and [`property: TestConfig.timeout`].
## method: Test.describe.fixme
* since: v1.25

View File

@ -2123,10 +2123,10 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* test('runs second', async ({ page }) => {});
* ```
*
* Configuring retries and timeout:
* Configuring retries and timeout for each test:
*
* ```js
* // All tests in the file will be retried twice and have a timeout of 20 seconds.
* // Each test in the file will be retried twice and have a timeout of 20 seconds.
* test.describe.configure({ retries: 2, timeout: 20_000 });
* test('runs first', async ({ page }) => {});
* test('runs second', async ({ page }) => {});