From d80640fa5d6858bd5ccd1d77123b54770bf16994 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 3 Apr 2026 19:20:44 +0200 Subject: [PATCH] Add e2e reaction test, improve accessibility, enable parallel testing (#37081) Add a new e2e test for toggling issue reactions via the reaction picker dropdown. Add `aria-label` attributes to improve reaction accessibility: - Add `aria-label="Reaction"` to the reaction picker dropdown - Add `role="group"` with `aria-label="Reactions"` to the reactions container, giving it a semantic identity for screen readers - Include the reaction key in each reaction button's `aria-label` (e.g. `+1: user1, user2`) so screen readers announce which reaction a button represents E2e test improvements: - Simplify `randomString` to use `Math.random` instead of `node:crypto` - Replace `generatePassword` with a static password, remove unused `clickDropdownItem` - Enable `fullyParallel: true` and `workers: '50%'` in Playwright config - Run both chromium and firefox in all environments (not just CI) - Parallelize `login` and `apiCreateRepo` setup where possible - Use dedicated test user in `user-settings` test for concurrency safety Co-authored-by: Claude (Opus 4.6) --- Makefile | 2 +- options/locale/locale_en-US.json | 1 + playwright.config.ts | 6 ++-- .../repo/issue/view_content/add_reaction.tmpl | 2 +- .../repo/issue/view_content/reactions.tmpl | 4 +-- tests/e2e/codeeditor.test.ts | 7 ++--- tests/e2e/events.test.ts | 13 ++++---- tests/e2e/milestone.test.ts | 7 ++--- tests/e2e/org.test.ts | 4 +-- tests/e2e/reactions.test.ts | 30 +++++++++++++++++++ tests/e2e/readme.test.ts | 4 +-- tests/e2e/register.test.ts | 4 +-- tests/e2e/repo.test.ts | 4 +-- tests/e2e/user-settings.test.ts | 28 ++++++++++------- tests/e2e/utils.ts | 28 ++++++++--------- 15 files changed, 89 insertions(+), 55 deletions(-) create mode 100644 tests/e2e/reactions.test.ts diff --git a/Makefile b/Makefile index 8b0adf1906..8c73dc350d 100644 --- a/Makefile +++ b/Makefile @@ -525,7 +525,7 @@ test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test .PHONY: playwright playwright: deps-frontend @# on GitHub Actions VMs, playwright's system deps are pre-installed - @pnpm exec playwright install $(if $(GITHUB_ACTIONS),,--with-deps) chromium $(if $(CI),firefox) $(PLAYWRIGHT_FLAGS) + @pnpm exec playwright install $(if $(GITHUB_ACTIONS),,--with-deps) chromium firefox $(PLAYWRIGHT_FLAGS) .PHONY: test-e2e test-e2e: playwright $(EXECUTABLE_E2E) diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index e796064ce3..f4cdc37717 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -1043,6 +1043,7 @@ "repo.forks": "Forks", "repo.stars": "Stars", "repo.reactions_more": "and %d more", + "repo.reactions": "Reactions", "repo.unit_disabled": "The site administrator has disabled this repository section.", "repo.language_other": "Other", "repo.adopt_search": "Enter username to search for unadopted repositories… (leave blank to find all)", diff --git a/playwright.config.ts b/playwright.config.ts index 9904e76f94..9dc8a7c1b5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -5,6 +5,8 @@ const timeoutFactor = Number(env.GITEA_TEST_E2E_TIMEOUT_FACTOR) || 1; const timeout = 5000 * timeoutFactor; export default defineConfig({ + workers: '50%', + fullyParallel: true, testDir: './tests/e2e/', outputDir: './tests/e2e-output/', testMatch: /.*\.test\.ts/, @@ -28,11 +30,11 @@ export default defineConfig({ permissions: ['clipboard-read', 'clipboard-write'], }, }, - ...env.CI ? [{ + { name: 'firefox', use: { ...devices['Desktop Firefox'], }, - }] : [], + }, ], }); diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl index 2f5764d964..9b8d0344c9 100644 --- a/templates/repo/issue/view_content/add_reaction.tmpl +++ b/templates/repo/issue/view_content/add_reaction.tmpl @@ -1,5 +1,5 @@ {{if ctx.RootData.IsSigned}} -