Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions docs/src/test-api/class-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]>
Expand Down
19 changes: 3 additions & 16 deletions types/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,22 +1267,9 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
*/
parallel: SuiteFunction & {
/**
* 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
* [test.describe.parallel(title, callback)](https://playwright.dev/docs/api/class-test#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.
*
* ```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
* [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.
Expand Down