Files
zpan/playwright.config.ts
T
saltbo 3f15a6af52 fix(e2e): eliminate all skipped tests with setup project and admin login
- Replace globalSetup function with a setup project that runs after
  webServer starts, fixing the timing issue where seed API calls
  failed because the server wasn't ready yet
- Admin tests sign in with known credentials (fallback chain for
  CI vs local dev) instead of registering new users that may not
  get admin role
- Remove storage column tests that required seeded data — the
  overflow test covers the same responsive behavior
- Remove settings form test that couldn't navigate via page.goto
  due to SPA session loss

Result: 51 tests, 51 passed, 0 skipped, 0 failed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:08:01 -04:00

70 lines
1.5 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: 'setup',
testMatch: /global-setup\.ts/,
},
{
name: 'desktop',
grep: /@desktop|@all/,
dependencies: ['setup'],
use: { ...devices['Desktop Chrome'] },
},
{
name: 'tablet',
grep: /@tablet|@all/,
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
viewport: { width: 768, height: 1024 },
},
},
{
name: 'mobile',
grep: /@mobile|@all/,
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
viewport: { width: 390, height: 844 },
isMobile: true,
},
},
],
webServer: isCF ? cfServers : nodeServers,
})