Prevents middleware Edge runtime from failing on eval-based dev bundles when NODE_ENV is set to a non-standard value in the environment. Co-authored-by: dennis <dennis@konkol.net>
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
/**
|
|
* Playwright configuration for E2E testing
|
|
* Tests critical paths, hydration, emails, and more
|
|
*/
|
|
export default defineConfig({
|
|
testDir: './e2e',
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: 'html',
|
|
|
|
use: {
|
|
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000',
|
|
trace: 'on-first-retry',
|
|
screenshot: 'only-on-failure',
|
|
video: 'retain-on-failure',
|
|
},
|
|
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
{
|
|
name: 'firefox',
|
|
use: { ...devices['Desktop Firefox'] },
|
|
},
|
|
{
|
|
name: 'webkit',
|
|
use: { ...devices['Desktop Safari'] },
|
|
},
|
|
// Mobile testing
|
|
{
|
|
name: 'Mobile Chrome',
|
|
use: { ...devices['Pixel 5'] },
|
|
},
|
|
{
|
|
name: 'Mobile Safari',
|
|
use: { ...devices['iPhone 12'] },
|
|
},
|
|
],
|
|
|
|
webServer: {
|
|
// Use plain Next.js dev server for E2E (no Docker dependency)
|
|
// Force NODE_ENV=development to avoid Edge runtime eval issues in middleware bundle
|
|
command: 'NODE_ENV=development npm run dev:next',
|
|
url: 'http://localhost:3000',
|
|
reuseExistingServer: true, // Always reuse if server is running
|
|
timeout: 120 * 1000,
|
|
stdout: 'ignore',
|
|
stderr: 'pipe',
|
|
},
|
|
});
|