From 65ea2f0dca36fc957560c5c392ed36962f1ab653 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 10:11:22 +0000 Subject: [PATCH] feat(roll): roll to ToT Playwright (10-03-25) --- nodejs/docs/api/class-testproject.mdx | 37 +++++++++++++++++++++++ nodejs/docs/test-projects.mdx | 2 +- src/components/GitHubStarButton/index.tsx | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/nodejs/docs/api/class-testproject.mdx b/nodejs/docs/api/class-testproject.mdx index 009b1e59069..d2775b2a2b8 100644 --- a/nodejs/docs/api/class-testproject.mdx +++ b/nodejs/docs/api/class-testproject.mdx @@ -727,6 +727,43 @@ testProject.use **Type** - [TestOptions] +--- + +### workers {#test-project-workers} + +Added in: v1.52testProject.workers + +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" diff --git a/nodejs/docs/test-projects.mdx b/nodejs/docs/test-projects.mdx index 493e3254f67..701dea180d7 100644 --- a/nodejs/docs/test-projects.mdx +++ b/nodejs/docs/test-projects.mdx @@ -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: [ diff --git a/src/components/GitHubStarButton/index.tsx b/src/components/GitHubStarButton/index.tsx index ec33ac35846..213ca6c0cce 100644 --- a/src/components/GitHubStarButton/index.tsx +++ b/src/components/GitHubStarButton/index.tsx @@ -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 = ({owner, repo}) => { if (!repo)