-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.js
More file actions
111 lines (99 loc) · 2.62 KB
/
Copy pathplaywright.config.js
File metadata and controls
111 lines (99 loc) · 2.62 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import { defineConfig, devices } from '@playwright/test';
/**
* Playwright Configuration for PC CampApp
* Tests Production Build (build/) auf http://localhost:5174
*
* Testet:
* - Übersetzungen (Translation System) - BEIDE Sprachen (DE + EN)
* - PWA-Funktionalität (Service Worker, Offline, Manifest)
* - UI/UX (Navigation, Responsive Design, Accessibility)
* - Cache-Busting (Gehashte Assets)
*/
export default defineConfig({
testDir: './tests',
// Globales Timeout
timeout: 30 * 1000,
expect: {
timeout: 5000
},
// Parallele Test-Ausführung
fullyParallel: false,
// Fail fast on CI
forbidOnly: !!process.env.CI,
// Retries
retries: process.env.CI ? 2 : 0,
// Reporter
reporter: [
['line'],
['html', { outputFolder: 'playwright-report', open: 'never' }]
],
// Gemeinsame Einstellungen für alle Projekte
use: {
// Base URL - Production Build auf Port 5174
baseURL: process.env.BASE_URL || 'http://localhost:5174',
// Screenshot nur bei Fehlern
screenshot: 'only-on-failure',
// Video nur bei ersten Retry
video: 'retain-on-failure',
// Trace bei Fehlern
trace: 'on-first-retry',
},
// Test-Projekte für verschiedene Sprachen
projects: [
{
name: 'chromium-de',
testMatch: /translations\.spec\.js/,
use: {
...devices['Desktop Chrome'],
locale: 'de-DE',
},
metadata: {
locale: 'de'
},
globalSetup: './scripts/setup-locale-de.js',
},
{
name: 'chromium-en',
testMatch: /translations\.spec\.js/,
use: {
...devices['Desktop Chrome'],
locale: 'en-US',
},
metadata: {
locale: 'en'
},
globalSetup: './scripts/setup-locale-en.js',
},
{
name: 'chromium',
testIgnore: /translations\.spec\.js/,
use: { ...devices['Desktop Chrome'] },
},
// Andere Browser temporär deaktiviert für schnelleres Testing
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
// // Mobile Tests
// {
// name: 'mobile-chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'mobile-safari',
// use: { ...devices['iPhone 12'] },
// },
],
// Production Server (optional - nur wenn nicht bereits läuft)
// In lokaler Umgebung wird Server via make test-prod gestartet
webServer: process.env.CI ? {
command: 'make dev-prod-start',
port: 5174,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
} : undefined,
});