forked from toeverything/blocksuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
39 lines (38 loc) · 1.42 KB
/
playwright.config.ts
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
/// <reference types="node" />
import type { PlaywrightWorkerOptions } from '@playwright/test';
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: 'tests',
fullyParallel: true,
webServer: {
command: 'pnpm dev',
port: 5173,
// command: process.env.CI ? 'pnpm preview' : 'pnpm dev',
// port: process.env.CI ? 4173 : 5173,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE ?? '',
},
},
use: {
browserName:
(process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ??
'chromium',
viewport: { width: 960, height: 900 },
// Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer
// You can open traces locally(`npx playwright show-trace trace.zip`)
// or in your browser on [Playwright Trace Viewer](https://trace.playwright.dev/).
trace: 'on-first-retry',
// Record video only when retrying a test for the first time.
video: 'on-first-retry',
// Timeout for each action
actionTimeout: 5_000,
permissions: ['clipboard-read', 'clipboard-write'],
},
workers: '80%',
retries: process.env.CI ? 3 : 0,
// 'github' for GitHub Actions CI to generate annotations, plus a concise 'dot'
// default 'list' when running locally
// See https://playwright.dev/docs/test-reporters#github-actions-annotations
reporter: process.env.CI ? 'github' : 'list',
});