File size: 1,326 Bytes
afd56bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { defineConfig, devices } from '@playwright/test';

/**
 * Konfiguracja Playwright E2E dla GrantForge AI.
 * Testy pokrywają krytyczną ścieżkę: login → projekt → generator → eksport.
 */
export default defineConfig({
    testDir: './e2e',
    fullyParallel: false, // Sequential — testy zależą od stanu (projekt → sekcje)
    forbidOnly: !!process.env.CI,
    retries: process.env.CI ? 2 : 0,
    workers: 1,
    timeout: 60_000,     // 60s per test (LLM może być wolny)
    expect: { timeout: 15_000 },

    reporter: [
        ['list'],
        ['html', { outputFolder: 'playwright-report', open: 'never' }],
    ],

    use: {
        baseURL: process.env.E2E_BASE_URL || 'http://localhost:5173',
        trace: 'on-first-retry',
        screenshot: 'only-on-failure',
        video: 'on-first-retry',
    },

    projects: [
        {
            name: 'chromium',
            use: { ...devices['Desktop Chrome'] },
        },
        // Odkomentuj jeśli chcesz testy wieloprzeglądarkowe
        // { name: 'firefox', use: { ...devices['Desktop Firefox'] } },
    ],

    // Uruchom dev serwer przed testami
    webServer: {
      command: 'npm run dev',
      url: 'http://localhost:5173',
      reuseExistingServer: !process.env.CI,
      env: {
        VITE_E2E: 'true',
      },
    },
});