Files
euchre_camp/playwright.config.ts
T
david 28fecdfaad refactor: remove all SQLite code, standardize on PostgreSQL
- Remove database provider switching logic from prisma.ts and auth.ts
- Hardcode PostgreSQL as the only supported database
- Remove switch-database.js and use-dev-db.js scripts
- Remove Python utility scripts that used sqlite3 directly
- Update justfile to remove SQLite test targets
- Update package.json to remove db:switch script
- Update Dockerfile.ci-base to default to PostgreSQL
- Update .env.example to remove SQLite mention
- Update playwright.config.ts comments
- Update .gitignore to remove SQLite file patterns

This eliminates the root cause of test failures: the dev server and test
Prisma client were using different databases (PostgreSQL vs SQLite).
2026-05-02 04:09:37 -07:00

75 lines
2.0 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
timeout: 30000,
expect: {
timeout: 5000
},
// Run tests sequentially to avoid database conflicts
fullyParallel: false,
// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !!process.env.CI,
// Retry on CI only.
retries: process.env.CI ? 2 : 0,
// Always run with 1 worker to avoid database conflicts
workers: 1,
// Reporter to use
reporter: 'html',
// Global setup and teardown
globalSetup: require.resolve('./e2e/global.setup'),
// Use base URL for relative navigation
use: {
baseURL: 'http://localhost:3000',
// Collect trace when retrying the failed test.
trace: 'on-first-retry',
// Capture screenshot only on failure
screenshot: 'only-on-failure',
},
// Configure projects
projects: [
// Setup project - runs before all other projects
{
name: 'setup',
testMatch: /global\.setup\.ts/,
},
// Main Chromium project with regular user authentication
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Use prepared auth state for regular user tests
storageState: 'playwright/.auth/user.json',
},
dependencies: ['setup'],
},
// Admin user project
{
name: 'chromium-admin',
use: {
...devices['Desktop Chrome'],
// Use prepared auth state for admin tests
storageState: 'playwright/.auth/admin.json',
},
dependencies: ['setup'],
},
// Unauthenticated project - for tests that don't require login
{
name: 'chromium-unauth',
use: {
...devices['Desktop Chrome'],
// No authentication state
storageState: undefined,
},
dependencies: ['setup'],
},
],
// Run your local dev server before starting the tests
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
timeout: 120000,
reuseExistingServer: !process.env.CI,
},
});