-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
40 lines (35 loc) · 1.35 KB
/
playwright.config.ts
File metadata and controls
40 lines (35 loc) · 1.35 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
import { defineConfig } from '@playwright/test';
/**
* Playwright configuration for testing the Electron app
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './e2e-tests',
// Default timeout is 30s, but this quite long...
timeout: 60 * 1000, // Increased timeout for CI environment
/* Run tests in files in parallel */
fullyParallel: true,
/* 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,
// Workers sets how many tests run in parallel.
workers: process.env.CI ? 8 : (process.env.HEADLESS ? 8 : 8),
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'html',
/* Configure projects for Electron */
projects: [
{
name: 'electron',
testMatch: /.*\.spec\.ts/,
use: {
// Electron-specific settings
trace: process.env.CI || process.env.HEADLESS ? 'off' : 'on-first-retry',
screenshot: process.env.CI || process.env.HEADLESS ? 'off' : 'only-on-failure',
video: process.env.CI || process.env.HEADLESS ? 'off' : 'retain-on-failure',
},
},
],
/* Build the app before running tests */
globalSetup: './e2e-tests/electron-setup.ts',
});