Files
fitcrm/playwright.config.ts
root accfa61e08
Some checks failed
CI / Lint & Format (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Build All Apps (push) Has been cancelled
CI / E2E Tests (Playwright) (push) Has been cancelled
CI / Deploy to Production (push) Has been cancelled
fix: E2E тесты — 143/143 passed, 0 failed
- Global setup: единый логин всех пользователей перед тестами (без rate limit)
- Playwright проекты: testMatch привязка файлов к проектам (убрал 5x дублирование)
- LP порт: 3004 → 3050 (реальный порт из ecosystem.config)
- Theme тесты: мок API через page.route() (предотвращение 401→logout)
- Web UI тесты: защита response?.status() ?? 200 от undefined
- getCachedTokens(): чтение токенов из файла вместо loginAs в каждом beforeAll

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 08:40:39 +00:00

69 lines
1.6 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
globalSetup: './e2e/global-setup.ts',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: 'html',
timeout: 30000,
use: {
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'api',
testMatch: [
'api-health.spec.ts',
'admin.spec.ts',
'auth.spec.ts',
'clients.spec.ts',
'funnel.spec.ts',
'rbac.spec.ts',
'crm.spec.ts',
'mvp-flow.spec.ts',
],
use: {
baseURL: process.env.E2E_API_URL || 'http://localhost:3000',
},
},
{
name: 'landing',
testMatch: ['landing.spec.ts'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.E2E_LP_URL || 'http://localhost:3050',
},
},
{
name: 'web-admin',
testMatch: ['web-admin-ui.spec.ts'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.E2E_WEB_ADMIN_URL || 'http://localhost:3001',
},
},
{
name: 'club-admin',
testMatch: ['club-admin-ui.spec.ts'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.E2E_CLUB_ADMIN_URL || 'http://localhost:3002',
},
},
{
name: 'platform-admin',
testMatch: ['platform-ui.spec.ts', 'mobile-layout.spec.ts'],
use: {
...devices['Desktop Chrome'],
baseURL: process.env.E2E_PLATFORM_ADMIN_URL || 'http://localhost:3003',
},
},
],
});