2024-06-28 18:15:51 +02:00
|
|
|
import {env} from 'node:process';
|
2026-02-21 01:26:47 +01:00
|
|
|
import {defineConfig, devices} from '@playwright/test';
|
2026-04-01 20:15:02 +02:00
|
|
|
|
2026-03-31 15:59:25 +02:00
|
|
|
const timeoutFactor = Number(env.GITEA_TEST_E2E_TIMEOUT_FACTOR) || 1;
|
|
|
|
|
const timeout = 5000 * timeoutFactor;
|
2022-09-02 15:18:23 -04:00
|
|
|
|
2026-02-21 01:26:47 +01:00
|
|
|
export default defineConfig({
|
2026-04-03 19:20:44 +02:00
|
|
|
workers: '50%',
|
|
|
|
|
fullyParallel: true,
|
2022-09-02 15:18:23 -04:00
|
|
|
testDir: './tests/e2e/',
|
2026-02-21 01:26:47 +01:00
|
|
|
outputDir: './tests/e2e-output/',
|
|
|
|
|
testMatch: /.*\.test\.ts/,
|
2024-06-28 18:15:51 +02:00
|
|
|
forbidOnly: Boolean(env.CI),
|
2026-02-21 01:26:47 +01:00
|
|
|
reporter: 'list',
|
2026-03-31 15:59:25 +02:00
|
|
|
timeout: 2 * timeout,
|
2026-02-21 01:26:47 +01:00
|
|
|
expect: {
|
2026-03-31 15:59:25 +02:00
|
|
|
timeout,
|
2026-02-21 01:26:47 +01:00
|
|
|
},
|
2022-09-02 15:18:23 -04:00
|
|
|
use: {
|
2026-03-31 23:50:45 +02:00
|
|
|
baseURL: env.GITEA_TEST_E2E_URL?.replace?.(/\/$/, ''),
|
2022-09-02 15:18:23 -04:00
|
|
|
locale: 'en-US',
|
2026-03-31 15:59:25 +02:00
|
|
|
actionTimeout: timeout,
|
|
|
|
|
navigationTimeout: 2 * timeout,
|
2022-09-02 15:18:23 -04:00
|
|
|
},
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
name: 'chromium',
|
|
|
|
|
use: {
|
|
|
|
|
...devices['Desktop Chrome'],
|
2026-02-21 01:26:47 +01:00
|
|
|
permissions: ['clipboard-read', 'clipboard-write'],
|
2022-09-02 15:18:23 -04:00
|
|
|
},
|
|
|
|
|
},
|
2026-04-03 19:20:44 +02:00
|
|
|
{
|
2026-02-21 01:26:47 +01:00
|
|
|
name: 'firefox',
|
2022-09-02 15:18:23 -04:00
|
|
|
use: {
|
2026-02-21 01:26:47 +01:00
|
|
|
...devices['Desktop Firefox'],
|
2022-09-02 15:18:23 -04:00
|
|
|
},
|
2026-04-03 19:20:44 +02:00
|
|
|
},
|
2022-09-02 15:18:23 -04:00
|
|
|
],
|
2026-02-21 01:26:47 +01:00
|
|
|
});
|