-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
64 lines (49 loc) · 1.45 KB
/
playwright.config.ts
File metadata and controls
64 lines (49 loc) · 1.45 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
import { defineConfig } from '@playwright/test'
/**
* Playwright configuration for Electron e2e testing.
* See https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
// Look for test files in the specs directory
testDir: './tests/e2e/specs',
// Global timeout for each test
timeout: 60000,
// Assertion timeout
expect: {
timeout: 10000
},
// Electron apps should run tests sequentially to avoid conflicts
fullyParallel: false,
workers: 1,
// Fail the build on CI if you accidentally left test.only in the source code
forbidOnly: !!process.env.CI,
// Retry on CI only
retries: process.env.CI ? 2 : 0,
// Reporter configuration
reporter: [['html', { outputFolder: 'playwright-report' }], ['list']],
// Global setup and teardown
globalSetup: './tests/e2e/global-setup.ts',
globalTeardown: './tests/e2e/global-teardown.ts',
// Output directory for test artifacts
outputDir: './test-results',
// Shared settings for all tests
use: {
// Collect trace when retrying the failed test
trace: 'retain-on-failure',
// Take screenshot only on failure
screenshot: 'only-on-failure',
// Record video only on failure
video: 'retain-on-failure',
// Action timeout
actionTimeout: 15000,
// Navigation timeout
navigationTimeout: 30000
},
// Single project for Electron testing
projects: [
{
name: 'electron',
testMatch: '**/*.spec.ts'
}
]
})