Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
70 lines (69 loc) · 2.3 KB
/
Copy pathplaywright.config.ts
File metadata and controls
70 lines (69 loc) · 2.3 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
import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './tests',
use: {
viewport: {
width: 1280,
height: 720,
},
},
retries: 0,
timeout: 60000,
// Most spec files still read/write the shared e2e/slides.md fixture
// against the single `legacy`-project dev server (see
// tests/autofit-text.spec.ts's beforeAll/afterAll for the convention).
// Running files in parallel workers races on that file, so this stays
// forced to strictly serial execution -- even though `isolated`-project
// files no longer share any state, `workers` is a global Playwright
// setting, not per-project, so it can't be raised until every remaining
// shared-state file is migrated onto tests/fixtures.ts's per-worker
// Slidev instances (see tests/fixtures.ts and CLAUDE.md's e2e notes).
workers: 1,
projects: [
{
name: 'legacy',
testMatch: [
'code-highlight-callouts.spec.ts',
'image-paste.spec.ts',
'image-position.spec.ts',
'layout-editor.spec.ts',
'slide-title-carryover.spec.ts',
'text-click-to-edit.spec.ts',
'vite-consumer-root-resolution.spec.ts',
],
use: {
...devices['Desktop Chrome'],
baseURL: 'http://localhost:3030',
},
},
{
name: 'isolated',
// These files boot their own worker-scoped Slidev dev server via
// tests/fixtures.ts instead of relying on the static webServer below,
// so they need no baseURL here -- the fixture supplies one per worker.
testMatch: [
'autofit-text.spec.ts',
'code-snippet-import.spec.ts',
'code-source-links.spec.ts',
'slide-geometry.spec.ts',
'slide-callouts.spec.ts',
'slide-callouts-diagrams.spec.ts',
'slide-image-references.spec.ts',
'callout-click-steps.spec.ts',
'click-model-ground-truth.spec.ts',
'callout-step-ranges.spec.ts',
'callout-arrow-style.spec.ts',
'geometry-elements.spec.ts',
'geometry-inspect.spec.ts',
'vscode-geometry-live-link.spec.ts',
],
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npx slidev --no-open --port 3030 e2e/slides.md',
port: 3030,
reuseExistingServer: true,
timeout: 30000,
},
})