-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.js
More file actions
75 lines (56 loc) · 1.67 KB
/
Copy pathplaywright.config.js
File metadata and controls
75 lines (56 loc) · 1.67 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
/**
* Playwright Configuration for E2E Testing
*
* Configures Playwright for testing the Electron app.
* Uses built app for realistic E2E scenarios.
*/
import { defineConfig } from '@playwright/test';
export default defineConfig({
// Test directory
testDir: './tests/e2e',
// Test file pattern
testMatch: '**/*.spec.js',
// Timeout for each test
timeout: 30000,
// Timeout for expect assertions
expect: {
timeout: 5000,
},
// Fail fast - stop on first failure during local development
fullyParallel: false,
// Forbid test.only in CI
forbidOnly: !!process.env.CI,
// Retry failed tests (helpful for flaky Electron startup)
retries: process.env.CI ? 2 : 0,
// Single worker for Electron (can't run multiple app instances)
workers: 1,
// Reporter configuration
reporter: process.env.CI
? [['github'], ['html', { open: 'never' }]]
: [['list'], ['html', { open: 'on-failure' }]],
// Output directory for test artifacts
outputDir: './tests/e2e/test-results',
// Preserve test output for debugging
preserveOutput: 'failures-only',
globalSetup: './tests/e2e/global-setup.js',
// Use custom Electron test fixtures (no browser projects needed)
use: {
// Capture screenshot on failure
screenshot: 'only-on-failure',
// Record video on failure
video: 'retain-on-failure',
// Collect trace on failure for debugging
trace: 'retain-on-failure',
// Action timeout
actionTimeout: 10000,
// Navigation timeout
navigationTimeout: 15000,
},
// No browser projects - Electron tests use custom fixtures
projects: [
{
name: 'electron',
testMatch: '**/*.spec.js',
},
],
});