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
37 changes: 37 additions & 0 deletions nodejs/docs/api/class-testproject.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,43 @@ testProject.use
**Type**
- [TestOptions]

---

### workers {#test-project-workers}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.52</font><x-search>testProject.workers</x-search>

The maximum number of concurrent worker processes to use for parallelizing tests from this project. Can also be set as percentage of logical CPU cores, e.g. `'50%'.`

This could be useful, for example, when all tests from a project share a single resource like a test account, and therefore cannot be executed in parallel. Limiting workers to one for such a project will prevent simultaneous use of the shared resource.

Note that the global [testConfig.workers](/api/class-testconfig.mdx#test-config-workers) limit applies to the total number of worker processes. However, Playwright will limit the number of workers used for this project by the value of [testProject.workers](/api/class-testproject.mdx#test-project-workers).

By default, there is no limit per project. See [testConfig.workers](/api/class-testconfig.mdx#test-config-workers) for the default of the total worker limit.

**Usage**

```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';

export default defineConfig({
workers: 10, // total workers limit

projects: [
{
name: 'runs in parallel',
},
{
name: 'one at a time',
workers: 1, // workers limit for this project
},
],
});
```

**Type**
- [number] | [string]


[Accessibility]: /api/class-accessibility.mdx "Accessibility"
[Android]: /api/class-android.mdx "Android"
Expand Down
2 changes: 1 addition & 1 deletion nodejs/docs/test-projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Dependencies are a list of projects that need to run before the tests in another
In this example the chromium, firefox and webkit projects depend on the setup project.

```js title="playwright.config.ts"
import { defineConfig } from '@playwright/test';
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
projects: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/GitHubStarButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type StarButtonProps = {
repo: string
}

const STARS = '69k+'; // NOTE: this line is generated by src/generate.js. Do not change!
const STARS = '70k+'; // NOTE: this line is generated by src/generate.js. Do not change!

const StarButton: React.FC<StarButtonProps> = ({owner, repo}) => {
if (!repo)
Expand Down
Loading