Files
gitea/tests/e2e/user-settings.test.ts
silverwind d80640fa5d 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) <noreply@anthropic.com>
2026-04-03 17:20:44 +00:00

21 lines
850 B
TypeScript

import {test, expect} from '@playwright/test';
import {loginUser, apiCreateUser, apiDeleteUser, randomString} from './utils.ts';
test('update profile biography', async ({page, request}) => {
const username = `e2e-settings-${randomString(8)}`;
const bio = `e2e-bio-${randomString(8)}`;
await apiCreateUser(request, username);
try {
await loginUser(page, username);
await page.goto('/user/settings');
await page.getByLabel('Biography').fill(bio);
await page.getByRole('button', {name: 'Update Profile'}).click();
await expect(page.getByLabel('Biography')).toHaveValue(bio);
await page.getByLabel('Biography').fill('');
await page.getByRole('button', {name: 'Update Profile'}).click();
await expect(page.getByLabel('Biography')).toHaveValue('');
} finally {
await apiDeleteUser(request, username);
}
});