2026-05-28 12:55:10 +03:00
|
|
|
|
import {
|
|
|
|
|
|
defineConfig,
|
|
|
|
|
|
devices,
|
|
|
|
|
|
} from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* E2E config. Tests run against the production build via `vite preview` on port 4173.
|
|
|
|
|
|
* Locally: all three browser engines run in parallel.
|
|
|
|
|
|
* CI: chromium only, workers=1 — the runner has 6GB RAM and `yarn build` already
|
|
|
|
|
|
* spikes 1–2GB, so we keep the E2E peak bounded.
|
|
|
|
|
|
*/
|
|
|
|
|
|
const isCI = !!process.env.CI;
|
2025-12-26 14:26:37 +03:00
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-05-28 12:55:10 +03:00
|
|
|
|
testDir: 'e2e',
|
|
|
|
|
|
testMatch: /.*\.test\.ts$/,
|
|
|
|
|
|
|
|
|
|
|
|
fullyParallel: true,
|
|
|
|
|
|
forbidOnly: isCI,
|
|
|
|
|
|
retries: isCI ? 2 : 0,
|
|
|
|
|
|
workers: isCI ? 1 : undefined,
|
|
|
|
|
|
|
|
|
|
|
|
reporter: isCI
|
|
|
|
|
|
? [['html', { open: 'never' }], ['github']]
|
|
|
|
|
|
: [['html', { open: 'on-failure' }], ['list']],
|
|
|
|
|
|
|
|
|
|
|
|
use: {
|
|
|
|
|
|
baseURL: 'http://localhost:4173',
|
|
|
|
|
|
trace: 'on-first-retry',
|
|
|
|
|
|
screenshot: 'only-on-failure',
|
|
|
|
|
|
video: 'retain-on-failure',
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
projects: isCI
|
|
|
|
|
|
? [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }]
|
|
|
|
|
|
: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'chromium',
|
|
|
|
|
|
use: {
|
|
|
|
|
|
...devices['Desktop Chrome'],
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'firefox',
|
|
|
|
|
|
use: { ...devices['Desktop Firefox'] },
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2026-01-08 13:14:04 +03:00
|
|
|
|
webServer: {
|
|
|
|
|
|
command: 'yarn build && yarn preview',
|
|
|
|
|
|
port: 4173,
|
2026-05-28 12:55:10 +03:00
|
|
|
|
reuseExistingServer: !isCI,
|
|
|
|
|
|
timeout: 120_000,
|
2026-01-08 13:14:04 +03:00
|
|
|
|
},
|
2025-12-26 14:26:37 +03:00
|
|
|
|
});
|