test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Configuration Playwright pour la suite E2E complète de VEZA.
|
|
|
|
|
*
|
|
|
|
|
* Usage :
|
|
|
|
|
* npm run e2e → Chromium seul, parallèle (dev rapide)
|
|
|
|
|
* npm run e2e:all → Tous les navigateurs (pré-commit)
|
|
|
|
|
* npm run e2e:critical → Tests @critical uniquement
|
|
|
|
|
* PLAYWRIGHT_WORKERS=1 npm run e2e → Séquentiel (debug rate-limit)
|
|
|
|
|
*
|
|
|
|
|
* Variables d'environnement :
|
|
|
|
|
* PLAYWRIGHT_BASE_URL — URL du frontend (défaut: http://localhost:5173)
|
|
|
|
|
* PORT — Port du dev server Vite (défaut: 5173)
|
|
|
|
|
* PLAYWRIGHT_WORKERS — Nombre de workers (défaut: 3)
|
|
|
|
|
* PLAYWRIGHT_ALL — "1" pour tous les navigateurs (défaut: chromium seul)
|
|
|
|
|
* CI — Active les retries, reporters lourds, tous les browsers
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const isCI = !!process.env.CI;
|
|
|
|
|
const allBrowsers = isCI || process.env.PLAYWRIGHT_ALL === '1';
|
|
|
|
|
const workerCount = process.env.PLAYWRIGHT_WORKERS
|
|
|
|
|
? parseInt(process.env.PLAYWRIGHT_WORKERS, 10)
|
|
|
|
|
: isCI
|
|
|
|
|
? 2
|
|
|
|
|
: 4; // 4 workers en local pour éviter ERR_INSUFFICIENT_RESOURCES
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
testDir: '.',
|
|
|
|
|
testMatch: '**/*.spec.ts',
|
|
|
|
|
testIgnore: ['**/node_modules/**'],
|
|
|
|
|
|
|
|
|
|
/* ── Parallélisme ──────────────────────────────────────────────── */
|
|
|
|
|
fullyParallel: true,
|
|
|
|
|
workers: workerCount,
|
|
|
|
|
|
|
|
|
|
/* ── Timeouts ──────────────────────────────────────────────────── */
|
|
|
|
|
timeout: 30_000, // 30s par défaut (était 60s)
|
2026-04-04 18:26:52 +00:00
|
|
|
expect: { timeout: 10_000 }, // 10s pour les assertions — React SPA needs time to hydrate
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
/* ── CI ────────────────────────────────────────────────────────── */
|
|
|
|
|
forbidOnly: isCI,
|
|
|
|
|
retries: isCI ? 2 : 0,
|
|
|
|
|
|
|
|
|
|
/* ── Reporters ─────────────────────────────────────────────────── */
|
|
|
|
|
reporter: isCI
|
|
|
|
|
? [
|
|
|
|
|
['list'],
|
|
|
|
|
['json', { outputFile: './test-results/results.json' }],
|
|
|
|
|
['html', { outputFolder: './playwright-report', open: 'never' }],
|
|
|
|
|
['github'],
|
|
|
|
|
]
|
|
|
|
|
: [
|
|
|
|
|
['list'],
|
|
|
|
|
['json', { outputFile: './test-results/results.json' }],
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
/* ── Global setup/teardown ─────────────────────────────────────── */
|
|
|
|
|
globalSetup: process.env.PLAYWRIGHT_SKIP_GLOBAL_SETUP ? undefined : './global-setup.ts',
|
|
|
|
|
globalTeardown: './global-teardown.ts',
|
|
|
|
|
|
|
|
|
|
/* ── Options partagées ─────────────────────────────────────────── */
|
|
|
|
|
use: {
|
fix: stabilize frontend — 98 TS errors to 0, align API endpoints, optimize bundle
- Fix 98 TypeScript errors across 37 files:
- Service layer double-unwrapping (subscriptionService, distributionService, gearService)
- Self-referencing variables in SearchPageResults
- FeedView/ExploreView .posts→.items alignment
- useQueueSync Zustand subscribe API
- AdminAuditLogsView missing interface fields
- Toast proxy type, interceptor type narrowing
- 22 unused imports/variables removed
- 5 storybook mock data fixes
- Align frontend API calls with backend endpoints:
- Analytics: useAnalyticsView now calls /creator/analytics/dashboard (was /analytics)
- Chat: chatService uses /conversations (was mock data), WS URL from backend token
- Dashboard StatsSection: uses real /dashboard API data (was hardcoded zeros)
- Settings: suppress 2FA toast error when endpoint unavailable
- Fix marketplace products: seed uses 'active' status (was 'published')
- Enrich seed: admin follows all creators (feed has content)
- Optimize bundle: vendor catch-all 793KB→318KB gzip (-60%)
Split into vendor-charts, vendor-emoji, vendor-swagger, vendor-media, etc.
- Clean repo: remove ~100 orphaned screenshots, audit reports, logs from root
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:18:49 +00:00
|
|
|
baseURL: process.env.PLAYWRIGHT_BASE_URL || `http://127.0.0.1:${process.env.PORT || '5173'}`,
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
|
|
|
|
|
/* Traces/screenshots/vidéo — désactivés en local pour la perf */
|
|
|
|
|
trace: isCI ? 'on-first-retry' : 'off',
|
|
|
|
|
screenshot: isCI ? 'only-on-failure' : 'off',
|
|
|
|
|
video: isCI ? 'retain-on-failure' : 'off',
|
|
|
|
|
|
|
|
|
|
actionTimeout: 8_000,
|
|
|
|
|
navigationTimeout: 12_000,
|
|
|
|
|
locale: 'en-US',
|
|
|
|
|
|
|
|
|
|
/* Réutiliser le contexte navigateur entre tests du même fichier */
|
|
|
|
|
launchOptions: {
|
|
|
|
|
args: [
|
|
|
|
|
'--disable-gpu', // Pas besoin de GPU pour les tests
|
|
|
|
|
'--disable-dev-shm-usage', // Évite les crashes mémoire partagée
|
|
|
|
|
'--no-sandbox', // Plus léger
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
projects: [
|
|
|
|
|
/* ── Desktop Chrome — TOUJOURS actif ─────────────────────────── */
|
|
|
|
|
{
|
|
|
|
|
name: 'chromium',
|
|
|
|
|
use: { ...devices['Desktop Chrome'] },
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* ── Firefox — seulement en CI ou avec PLAYWRIGHT_ALL=1 ──────── */
|
|
|
|
|
...(allBrowsers
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
name: 'firefox',
|
|
|
|
|
use: { ...devices['Desktop Firefox'] },
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: []),
|
|
|
|
|
|
|
|
|
|
/* ── Safari — seulement en CI ou avec PLAYWRIGHT_ALL=1 ───────── */
|
|
|
|
|
...(allBrowsers
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
name: 'webkit',
|
|
|
|
|
use: { ...devices['Desktop Safari'] },
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: []),
|
|
|
|
|
|
|
|
|
|
/* ── Mobile Chrome — tests @mobile uniquement ────────────────── */
|
|
|
|
|
...(allBrowsers
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
name: 'mobile-chrome',
|
|
|
|
|
use: { ...devices['Pixel 5'] },
|
|
|
|
|
grep: /@mobile/,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: []),
|
|
|
|
|
|
|
|
|
|
/* ── Mobile Safari — tests @mobile uniquement ────────────────── */
|
|
|
|
|
...(allBrowsers
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
name: 'mobile-safari',
|
|
|
|
|
use: { ...devices['iPhone 12'] },
|
|
|
|
|
grep: /@mobile/,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: []),
|
|
|
|
|
],
|
|
|
|
|
|
fix: stabilize frontend — 98 TS errors to 0, align API endpoints, optimize bundle
- Fix 98 TypeScript errors across 37 files:
- Service layer double-unwrapping (subscriptionService, distributionService, gearService)
- Self-referencing variables in SearchPageResults
- FeedView/ExploreView .posts→.items alignment
- useQueueSync Zustand subscribe API
- AdminAuditLogsView missing interface fields
- Toast proxy type, interceptor type narrowing
- 22 unused imports/variables removed
- 5 storybook mock data fixes
- Align frontend API calls with backend endpoints:
- Analytics: useAnalyticsView now calls /creator/analytics/dashboard (was /analytics)
- Chat: chatService uses /conversations (was mock data), WS URL from backend token
- Dashboard StatsSection: uses real /dashboard API data (was hardcoded zeros)
- Settings: suppress 2FA toast error when endpoint unavailable
- Fix marketplace products: seed uses 'active' status (was 'published')
- Enrich seed: admin follows all creators (feed has content)
- Optimize bundle: vendor catch-all 793KB→318KB gzip (-60%)
Split into vendor-charts, vendor-emoji, vendor-swagger, vendor-media, etc.
- Clean repo: remove ~100 orphaned screenshots, audit reports, logs from root
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:18:49 +00:00
|
|
|
/* ── Auto-start backend + frontend ────────────────────────────── */
|
|
|
|
|
webServer: [
|
|
|
|
|
{
|
|
|
|
|
command: 'go run cmd/api/main.go',
|
|
|
|
|
cwd: '../../veza-backend-api',
|
|
|
|
|
port: 18080,
|
|
|
|
|
reuseExistingServer: true,
|
|
|
|
|
timeout: 30_000,
|
|
|
|
|
env: {
|
|
|
|
|
APP_ENV: 'test',
|
|
|
|
|
DISABLE_RATE_LIMIT_FOR_TESTS: 'true',
|
2026-04-04 13:41:48 +00:00
|
|
|
ACCOUNT_LOCKOUT_EXEMPT_EMAILS: 'user@veza.music,artist@veza.music,admin@veza.music,mod@veza.music,new@veza.music',
|
2026-04-05 06:51:46 +00:00
|
|
|
RATE_LIMIT_LIMIT: '10000',
|
|
|
|
|
RATE_LIMIT_WINDOW: '60',
|
fix: stabilize frontend — 98 TS errors to 0, align API endpoints, optimize bundle
- Fix 98 TypeScript errors across 37 files:
- Service layer double-unwrapping (subscriptionService, distributionService, gearService)
- Self-referencing variables in SearchPageResults
- FeedView/ExploreView .posts→.items alignment
- useQueueSync Zustand subscribe API
- AdminAuditLogsView missing interface fields
- Toast proxy type, interceptor type narrowing
- 22 unused imports/variables removed
- 5 storybook mock data fixes
- Align frontend API calls with backend endpoints:
- Analytics: useAnalyticsView now calls /creator/analytics/dashboard (was /analytics)
- Chat: chatService uses /conversations (was mock data), WS URL from backend token
- Dashboard StatsSection: uses real /dashboard API data (was hardcoded zeros)
- Settings: suppress 2FA toast error when endpoint unavailable
- Fix marketplace products: seed uses 'active' status (was 'published')
- Enrich seed: admin follows all creators (feed has content)
- Optimize bundle: vendor catch-all 793KB→318KB gzip (-60%)
Split into vendor-charts, vendor-emoji, vendor-swagger, vendor-media, etc.
- Clean repo: remove ~100 orphaned screenshots, audit reports, logs from root
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:18:49 +00:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
command: 'npm run dev -- --host 127.0.0.1',
|
|
|
|
|
cwd: '../../apps/web',
|
|
|
|
|
port: parseInt(process.env.PORT || '5173', 10),
|
|
|
|
|
reuseExistingServer: true,
|
|
|
|
|
timeout: 30_000,
|
|
|
|
|
},
|
|
|
|
|
],
|
test: add comprehensive e2e test suite (34 spec files)
New tests/e2e/ suite covering:
- Auth, navigation, player, tracks, playlists
- Search, discover, social, marketplace, chat
- Accessibility, API, workflows, edge cases
- Routes coverage, forms validation, modals
- Empty states, responsive, network errors
- Error boundary, performance, visual regression
- Cross-browser, profile, smoke, upload
- Storybook, deep pages, visual bugs
- Includes fixtures, helpers, global setup/teardown
- Playwright config and coverage map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:22 +00:00
|
|
|
});
|