Reviewed-on: #5 Co-authored-by: pedro-bento <mail@pbento.pt> Co-committed-by: pedro-bento <mail@pbento.pt>
53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
// Browser E2E config. Two projects:
|
|
// - `mock` (default): every network edge is intercepted, no retries, one
|
|
// worker. This is the lane that must stay green in CI.
|
|
// - `real`: drives the real backend (uvicorn + stub pipeline). Kept separate
|
|
// so the mocked lane never depends on Python.
|
|
/* global process */
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
import { fileURLToPath } from 'node:url';
|
|
import path from 'node:path';
|
|
|
|
const dashboardDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
|
|
export default defineConfig({
|
|
testDir: './specs',
|
|
// No retries anywhere: a flaky test is a bug, not a coin flip.
|
|
retries: 0,
|
|
// One worker keeps the shared preview server and the deterministic fixtures
|
|
// predictable.
|
|
workers: 1,
|
|
fullyParallel: false,
|
|
timeout: 30_000,
|
|
expect: { timeout: 5_000 },
|
|
reporter: [['list']],
|
|
outputDir: './.test-results',
|
|
globalSetup: './fixtures/global-setup.js',
|
|
use: {
|
|
baseURL: 'http://127.0.0.1:4173',
|
|
trace: 'retain-on-failure',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'mock',
|
|
testIgnore: /real-backend\.spec\.js/,
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
{
|
|
name: 'real',
|
|
testMatch: /real-backend\.spec\.js/,
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
],
|
|
webServer: {
|
|
command: 'npm run build && npx vite preview --port 4173 --strictPort --host 127.0.0.1',
|
|
cwd: dashboardDir,
|
|
url: 'http://127.0.0.1:4173',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120_000,
|
|
stdout: 'ignore',
|
|
stderr: 'pipe',
|
|
},
|
|
});
|