From 0801a8c486d994b71aa3a525139241c5cfa246cf Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Sun, 26 Sep 2021 21:30:11 -0700 Subject: [PATCH] docs: cleanup test.describe.parallel.only doc (#9159) --- docs/src/test-api/class-test.md | 22 +--------------------- types/test.d.ts | 19 +++---------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md index cef099836e..90b70c6a4c 100644 --- a/docs/src/test-api/class-test.md +++ b/docs/src/test-api/class-test.md @@ -283,27 +283,7 @@ A callback that is run immediately when calling [`method: Test.describe.parallel ## method: Test.describe.parallel.only -Declares a focused group of tests that could be run in parallel. By default, tests in a single test file run one after another, but using [`method: Test.describe.parallel`] allows them to run in parallel. If there are some focused tests or suites, all of them will be run but nothing else. - -```js js-flavor=js -test.describe.parallel.only('group', () => { - test('runs in parallel 1', async ({ page }) => { - }); - test('runs in parallel 2', async ({ page }) => { - }); -}); -``` - -```js js-flavor=ts -test.describe.parallel.only('group', () => { - test('runs in parallel 1', async ({ page }) => { - }); - test('runs in parallel 2', async ({ page }) => { - }); -}); -``` - -Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of the parallel tests executes all relevant hooks. +Declares a focused group of tests that could be run in parallel. This is similar to [`method: Test.describe.parallel`], but focuses the group. If there are some focused tests or suites, all of them will be run but nothing else. ### param: Test.describe.parallel.only.title - `title` <[string]> diff --git a/types/test.d.ts b/types/test.d.ts index 708087b0d4..ae8fbc8bd2 100644 --- a/types/test.d.ts +++ b/types/test.d.ts @@ -1267,22 +1267,9 @@ export interface TestType { - * test('runs in parallel 1', async ({ page }) => { - * }); - * test('runs in parallel 2', async ({ page }) => { - * }); - * }); - * ``` - * - * Note that parallel tests are executed in separate processes and cannot share any state or global variables. Each of the - * parallel tests executes all relevant hooks. + * Declares a focused group of tests that could be run in parallel. This is similar to + * [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel), but + * focuses the group. If there are some focused tests or suites, all of them will be run but nothing else. * @param title Group title. * @param callback A callback that is run immediately when calling [test.describe.parallel.only(title, callback)](https://playwright.dev/docs/api/class-test#test-describe-parallel-only). * Any tests added in this callback will belong to the group.