54 lines
1.7 KiB
TypeScript
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,
|
|
},
|
|
});
|