mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-21 13:20:33 +08:00
- Use --env-file=.dev.vars only locally (CI injects env vars directly) - Increase dialog close timeouts from 5s to 10s for CF Workers runtime - Replace fragile class-based action button selectors with row-scoped role queries Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test'
|
|
|
|
const isCF = process.env.E2E_RUNTIME === 'cf'
|
|
const envFile = process.env.CI ? '' : '--env-file=.dev.vars'
|
|
|
|
const nodeServers = [
|
|
{
|
|
command: `node ${envFile} node_modules/.bin/tsx watch server/entry-node.ts`,
|
|
port: 8222,
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
{
|
|
command: `node ${envFile} node_modules/.bin/vite --mode node`,
|
|
port: 5173,
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
]
|
|
|
|
const cfServers = [
|
|
{
|
|
command: 'vite dev',
|
|
port: 5173,
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
]
|
|
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
timeout: 30000,
|
|
retries: process.env.CI ? 2 : 0,
|
|
reporter: process.env.CI ? 'github' : 'list',
|
|
use: {
|
|
baseURL: 'http://localhost:5173',
|
|
headless: true,
|
|
trace: 'on-first-retry',
|
|
},
|
|
projects: [
|
|
{ name: 'desktop', use: { ...devices['Desktop Chrome'] } },
|
|
{
|
|
name: 'tablet',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
viewport: { width: 768, height: 1024 },
|
|
},
|
|
},
|
|
{
|
|
name: 'mobile',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
viewport: { width: 390, height: 844 },
|
|
isMobile: true,
|
|
},
|
|
},
|
|
],
|
|
webServer: isCF ? cfServers : nodeServers,
|
|
})
|