-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
74 lines (58 loc) · 1.7 KB
/
playwright.config.ts
File metadata and controls
74 lines (58 loc) · 1.7 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
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './src/tests',
// Run tests in parallel for efficiency
fullyParallel: true,
// Fail the build on CI if test.only is left in
forbidOnly: !!process.env.CI,
// No retries during flaky detection - we want raw pass/fail data
retries: 0,
// More workers = faster execution
workers: process.env.CI ? 1 : 1,
// Timeout for each test
timeout: 30000,
// Global test timeout
globalTimeout: 1800000,
// Reporter configuration with CTRF
reporter: [
['list'], // Console output for visibility
[
'playwright-ctrf-json-reporter',
{
// CTRF specific options
minimal: false, // Full details for analysis
testType: 'e2e', // Categorize as end-to-end tests
// Custom fields for flaky detection
customFields: {
project: 'flaky-detector',
environment: process.env.CI ? 'ci' : 'local',
runId: process.env.RUN_ID || Date.now().toString()
}
}
],
['html', { outputFolder: 'reports/html', open: 'never' }]
],
use: {
// Base URL for testing
baseURL: 'https://coffee-e2e.vercel.app',
// Collect trace on failure for debugging
trace: 'retain-on-failure',
// Screenshot on failure
screenshot: 'only-on-failure',
// Video on failure
video: 'retain-on-failure',
},
// Configure browsers
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Add custom test id attribute for flaky detection
testIdAttribute: 'data-testid'
},
},
],
// Store test results
outputDir: './test-results',
});