Shuffle/e2e/playwright.config.ts
cschlaefke aa421b12b0
Some checks failed
CI / flutter (pull_request) Successful in 1m15s
CI / web-build (pull_request) Successful in 53s
CI / supabase (pull_request) Successful in 3s
CI / supabase-tests (pull_request) Successful in 30s
CI / e2e (pull_request) Failing after 3m56s
test(auth): address review findings for e2e
Refs #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 10:55:27 +01:00

54 lines
1.7 KiB
TypeScript

import { defineConfig, devices, type Project } from '@playwright/test';
import { env } from './support/auth-config';
const webUrl = env.webUrl;
/**
* Projekte (Spec #1 § 7):
* - api GoTrue ueber Kong + Mailpit-Helfer
* - web gebaute Flutter-Web-App (`app/build/web`, statisch auf Port 3000)
* - throttle Drosselung (Krit. 7) gegen den Extra-Container, nur mit THROTTLE_GOTRUE_URL
* - spike SMTP-Spike (Issue #37), nur mit SPIKE_GOTRUE_URL, nicht blockierend
*/
const projects: Project[] = [
{ name: 'api', testDir: './tests/api', use: {} },
{
name: 'web',
testDir: './tests/web',
use: {
...devices['Desktop Chrome'],
baseURL: webUrl,
// Englische Texte (app_en.arb); die App waehlt die Sprache nach dem Browser.
locale: 'en-US',
// Der Flutter-Service-Worker wuerde alte Builds cachen.
serviceWorkers: 'block',
},
},
];
if (process.env.THROTTLE_GOTRUE_URL) {
projects.push({ name: 'throttle', testDir: './tests/throttle', use: {} });
}
if (process.env.SPIKE_GOTRUE_URL) {
projects.push({ name: 'spike', testDir: './tests/spike', use: {}, retries: 0 });
}
export default defineConfig({
timeout: 60_000,
expect: { timeout: 10_000 },
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? 2 : 4,
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : [['list']],
use: { trace: 'retain-on-failure' },
projects,
// SPA-Fallback (`-s`), sonst liefert /auth/confirm?... 404.
webServer: {
command: 'npx serve -s ../app/build/web -l 3000 --no-clipboard',
url: webUrl,
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
});