0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-25 02:36:38 +02:00

9 Commits

Author SHA1 Message Date
silverwind
a7af563050
Apply suggestion from @silverwind
Signed-off-by: silverwind <me@silverwind.io>
2026-02-18 03:03:15 +01:00
silverwind
4517e8a5dc
Use clearCookies for logout to avoid fomantic JS dependency
The fomantic dropdown JS does not reliably initialize on CI headless
Chromium, making dropdown-based Sign Out impossible. Use clearCookies
to destroy the session and verify logout state instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
20f96f7c1b
Wait for logout response before verifying sign-out
The link-action handler does an async fetch POST then a form-based
redirect chain which can be slow on CI. Wait for the /user/logout
response to confirm session destruction, then navigate to verify.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
5354352bee
Use server-rendered title attribute for dropdown locator
Replace JS-dependent getByLabel (aria-label set by Fomantic init) with
getByTitle targeting the avatar's server-rendered title attribute, scoped
to the navigation bar. Extract reusable clickDropdownItem helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
40446b8795
Use semantic click for logout instead of dispatchEvent
The dropdown already gets aria-label from data-tooltip-content via
the ARIA dropdown patch, so we can open it with getByLabel and then
click Sign Out normally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
30b9a05082
Fix flaky logout test by waiting for navigation
The dispatchEvent('click') on Sign Out triggers a navigation. Wait
for it to complete before checking for the Sign In link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
f604702a77
Use env vars directly in e2e login helper, remove user parameter
Import env from node:process, remove the user argument from login()
and read E2E_USER and E2E_PASSWORD directly from the environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
625e46d033
Pass e2e credentials via environment variables
Remove login_user helper and LOGIN_PASSWORD constant, pass E2E_USER
and E2E_PASSWORD from the test script to playwright via env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00
silverwind
f76c0acf59
Rework e2e tests
Remove the Go test harness that compiled test binaries and bootstrapped
a full Gitea server with fixtures. Replace with a bash script that runs
Playwright directly against an already-running Gitea instance.

- Remove Go e2e test files (e2e_test.go, utils_e2e_test.go)
- Add tools/test-e2e.sh that detects server URL, creates e2e user, runs Playwright
- Simplify Makefile to single test-e2e target
- Rewrite playwright.config.ts with chromium-only, no file outputs
- Rewrite tests using semantic Playwright locators (getByLabel, getByRole, getByText)
- Add login/logout utilities in tests/e2e/utils.ts
- Add CI workflow for e2e tests (.github/workflows/pull-e2e-tests.yml)
- Install only chromium in playwright install step

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 03:03:15 +01:00