Files
gitea/playwright.config.ts
T
silverwind 5d84bbd525 test: run e2e tests in WebKit on macOS (#40140)
WebKit was removed from the e2e tests in
https://github.com/go-gitea/gitea/pull/37315 because Linux WebKit kept
crashing. `make test-e2e` on macOS now also runs WebKit, which does not
show these crashes there. CI stays on Linux, because macOS runners would
need about an extra GB of cache storage.

1. The bot account test clicks the user type dropdown, Safari only moves
Tab focus between text fields
1. On macOS, Playwright runs with a single libuv thread, concurrent
`getaddrinfo` lookups of `localhost` there sporadically stall for 5s

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-10-31 22:44:39 +00:00

53 lines
1.2 KiB
TypeScript

import {env, platform} from 'node:process';
import {defineConfig, devices} from '@playwright/test';
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/,
forbidOnly: Boolean(env.CI),
reporter: 'list',
timeout: 2 * timeout,
expect: {
timeout,
},
use: {
baseURL: env.GITEA_TEST_E2E_URL?.replace?.(/\/$/, ''),
locale: 'en-US',
actionTimeout: timeout,
navigationTimeout: 2 * timeout,
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
permissions: ['clipboard-read', 'clipboard-write'],
},
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
launchOptions: {
firefoxUserPrefs: {
'dom.events.testing.asyncClipboard': true, // disable paste prompt
},
},
},
},
...(platform === 'darwin' ? [{ // webkit on linux is unstable
name: 'webkit',
use: {
...devices['Desktop Safari'],
permissions: ['clipboard-read'],
},
}] : []),
],
});