-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathplaywright-ct.config.ts
More file actions
67 lines (66 loc) · 2.16 KB
/
playwright-ct.config.ts
File metadata and controls
67 lines (66 loc) · 2.16 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 { fileURLToPath } from 'node:url';
import { defineConfig, devices } from '@playwright/experimental-ct-react';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
testDir: '.',
testMatch: ['**/packages/main/src/components/**/test/*.spec.tsx', '**/playwright/test/**/*.spec.tsx'],
testIgnore: ['**/*.cy.tsx', '**/*.cy.ts', '**/*.stories.tsx', '**/*.mdx'],
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: process.env.CI ? '100%' : undefined,
// https://github.com/microsoft/playwright/issues/14511#issuecomment-1552589959
reporter: process.env.CI
? [
['list'],
['github'],
[
'monocart-reporter',
{
name: 'Playwright Coverage Report',
outputFile: 'temp/playwright-coverage/report.html',
coverage: {
sourceFilter: (sourcePath: string) =>
(sourcePath.includes('packages/main/src/components/SelectDialog') ||
sourcePath.includes('packages/main/src/components/Splitter')) &&
!sourcePath.includes('node_modules') &&
!sourcePath.includes('/test/'),
reports: ['lcovonly'],
outputDir: 'temp/playwright-coverage',
},
},
],
]
: 'html',
timeout: 10_000,
expect: { timeout: 4000 },
use: {
trace: 'on-first-retry',
ctViteConfig: {
plugins: [
react(),
tsconfigPaths({
projects: [fileURLToPath(new URL('tsconfig.base.json', import.meta.url))],
}),
],
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
exclude: ['**/*.cy.tsx', '**/*.cy.ts', '**/*.stories.tsx'],
},
build: {
target: 'esnext',
rollupOptions: {
external: [/\.cy\.tsx$/, /\.cy\.ts$/, /\.stories\.tsx$/],
},
},
},
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
],
});