0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-22 21:53:17 +01:00
gitea/playwright.config.ts
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

30 lines
680 B
TypeScript

import {env} from 'node:process';
import {defineConfig, devices} from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e/',
testMatch: /.*\.test\.ts/,
forbidOnly: Boolean(env.CI),
reporter: 'list',
timeout: env.CI ? 30000 : 10000,
expect: {
timeout: env.CI ? 15000 : 5000,
},
use: {
baseURL: env.GITEA_TEST_SERVER_URL?.replace?.(/\/$/g, '') || 'http://localhost:3000',
locale: 'en-US',
trace: 'off',
screenshot: 'off',
video: 'off',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
permissions: ['clipboard-read', 'clipboard-write'],
},
},
],
});