-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
38 lines (36 loc) · 1.38 KB
/
Copy pathplaywright.config.ts
File metadata and controls
38 lines (36 loc) · 1.38 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
import { defineConfig } from '@playwright/test';
// Multiple agent worktrees run this suite concurrently. A pinned port with
// reuseExistingServer silently attaches a run to whichever worktree brought
// the server up first, corrupting evidence. Override PW_PORT per worktree;
// an overridden port never reuses an existing server.
const port = Number(process.env.PW_PORT ?? 4357);
const portOverridden = process.env.PW_PORT !== undefined;
export default defineConfig({
testDir: './tests/e2e',
globalSetup: './tests/e2e/global-setup.ts',
fullyParallel: false,
workers: 1,
retries: process.env.CI ? 1 : 0,
reporter: 'list',
use: {
baseURL: `http://localhost:${port}`,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
webServer: {
command: `npm run build && ASTRO_DEV_BACKGROUND=1 npm run dev --workspace astro-visual-editor-demo -- --host localhost --port ${port} --force`,
url: `http://localhost:${port}`,
timeout: 60_000,
reuseExistingServer: portOverridden ? false : !process.env.CI,
},
projects: [
{ name: 'chromium', use: { browserName: 'chromium' } },
// Safari's engine handles contenteditable focus/selection differently
// enough that the riskiest interaction gets its own WebKit run.
{
name: 'webkit-inline',
use: { browserName: 'webkit' },
grep: /double-click edits text in place/u,
},
],
});