diff --git a/docs/TESTING.md b/docs/TESTING.md index 136aae8d1c..e258d78cfc 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -39,7 +39,8 @@ See `test/e2e/AGENTS.md` for the full E2E testing guide (setup, writing tests, c Quick commands: -- `yarn test:e2e:setup` — first-time setup +- `yarn test:e2e:setup` — first-time setup (builds packages and apps, then installs browsers for the workspace Playwright version) +- `yarn test:e2e:setup:pinned` — optional; installs Chromium, Firefox, and WebKit for Playwright **1.40.1** (required to run the `firefox-pinned` and `webkit-pinned` projects; run after the usual setup when you need those projects locally) - `yarn test:e2e` — run all E2E tests - `yarn test:e2e -g "pattern"` — filter by name - `yarn test:e2e --ui` — Playwright UI mode @@ -53,6 +54,8 @@ translation proxy. Run them with: - `yarn test:e2e --project=firefox-pinned` - `yarn test:e2e --project=webkit-pinned` +If those projects fail because browsers are missing, run `yarn test:e2e:setup:pinned` once so the Playwright 1.40.1 browser binaries are installed alongside the default setup. + ## Run unit tests in BrowserStack - `BS_USERNAME= BS_ACCESS_KEY= yarn test:unit:bs` diff --git a/package.json b/package.json index 29aa8ae74d..7589a45e3b 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "test:script": "node --test --experimental-test-module-mocks './scripts/**/*.spec.*'", "test:unit:watch": "yarn test:unit --no-single-run", "test:unit:bs": "node --env-file-if-exists=.env ./scripts/test/bs-wrapper.ts karma start test/unit/karma.bs.conf.js", - "test:e2e:setup": "yarn build && yarn build:apps && yarn playwright install --with-deps && yarn dlx -p playwright@1.40.1 playwright install chromium firefox webkit", + "test:e2e:setup": "yarn build && yarn build:apps && yarn playwright install --with-deps", + "test:e2e:setup:pinned": "volta run --node 20 yarn dlx -p playwright@1.40.1 playwright install chromium firefox webkit", "test:e2e": "playwright test --config test/e2e/playwright.config.ts", "test:compat:tsc": "node scripts/check-typescript-compatibility.ts", "test:compat:ssr": "scripts/cli check_server_side_rendering_compatibility", diff --git a/test/e2e/AGENTS.md b/test/e2e/AGENTS.md index f35da9f330..7b8e555dd6 100644 --- a/test/e2e/AGENTS.md +++ b/test/e2e/AGENTS.md @@ -5,9 +5,14 @@ E2E tests use Playwright to test the SDK in real browser environments. ## Running E2E Tests ```bash -# First time setup (builds packages, apps, installs or updates Playwright browsers) +# First-time setup: builds packages and apps; installs or updates Playwright browsers +# for the workspace Playwright version. yarn test:e2e:setup +# Optional: install Chromium, Firefox, and WebKit for Playwright 1.40.1. Required +# locally if you run the firefox-pinned / webkit-pinned projects (see docs/TESTING.md). +yarn test:e2e:setup:pinned + # Run E2E tests locally yarn test:e2e