Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
67 lines (66 loc) · 1.54 KB
/
Copy pathplaywright.config.ts
File metadata and controls
67 lines (66 loc) · 1.54 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
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 0, // No retries - fix flakes instead of masking them
workers: process.env.CI ? 2 : undefined,
reporter: process.env.CI ? 'github' : 'html',
use: {
baseURL: process.env.CI ? 'http://localhost:4173' : 'http://localhost:5173',
trace: 'retain-on-failure',
contextOptions: {
clearCookies: true,
},
screenshot: 'only-on-failure',
},
projects: [
// Desktop browsers
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1280, height: 720 },
},
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
viewport: { width: 1280, height: 720 },
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
viewport: { width: 1280, height: 720 },
},
},
// Mobile viewports for responsive testing
{
name: 'mobile-chrome',
use: {
...devices['Pixel 5'],
},
},
{
name: 'mobile-safari',
use: {
...devices['iPhone 12'],
},
},
// Tablet viewport
{
name: 'tablet',
use: {
...devices['iPad (gen 7)'],
},
},
],
webServer: {
command: process.env.CI ? 'pnpm run preview' : 'pnpm run dev',
url: process.env.CI ? 'http://localhost:4173' : 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
},
});