Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

playwright.config.ts

38 lines1012 Bytes

1import { defineConfig, devices } from '@playwright/test'
2​
3export default defineConfig({
4 testDir: './tests',
5 fullyParallel: true,
6 forbidOnly: !!process.env.CI,
7 retries: process.env.CI ? 2 : 0,
8 workers: 4,
9 reporter: process.env.CI
10 ? [['html', { open: 'never' }], ['list']]
11 : [['list']],
12 timeout: 30_000,
13 expect: {
14 timeout: 15_000,
15 },
16 use: {
17 baseURL: 'http://localhost:3010',
18 video: process.env.CI ? 'retain-on-failure' : 'off',
19 screenshot: 'only-on-failure',
20 trace: 'on-first-retry',
21 },
22 projects: [
23 {
24 name: 'chromium',
25 use: { ...devices['Desktop Chrome'] },
26 },
27 ],
28 // aimock started in globalSetup, shared across all workers on port 4010.
29 // Tests send X-Test-Id headers for per-test sequenceIndex isolation.
30 globalSetup: './global-setup.ts',
31 globalTeardown: './global-teardown.ts',
32 webServer: {
33 command: 'pnpm run dev',
34 url: 'http://localhost:3010',
35 reuseExistingServer: !process.env.CI,
36 timeout: 120_000,
37 },
38})