Files
gridpilot.gg/playwright.website.config.ts
2026-01-03 02:42:47 +01:00

68 lines
1.7 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright configuration for website smoke tests
*
* Purpose: Verify all website pages load without runtime errors
* Scope: Page rendering, console errors, React hydration
*
* Critical Detection:
* - Console errors during page load
* - React hydration mismatches
* - Navigation failures
* - Missing content
*/
export default defineConfig({
testDir: './tests/smoke',
testMatch: ['**/website-pages.test.ts'],
testIgnore: ['**/electron-build.smoke.test.ts'],
// Serial execution for consistent results
fullyParallel: false,
workers: 1,
// Continue on errors to see all failures
maxFailures: undefined,
// Timeout: Pages should load quickly
timeout: 30_000,
// Base URL for the website
use: {
baseURL: 'http://localhost:3000',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
trace: 'retain-on-failure',
},
// Reporter: verbose for debugging
reporter: [
['list'],
['html', { open: 'never' }]
],
// No retry - smoke tests must pass on first run
retries: 0,
// Web server configuration
// Always start Next dev server locally (works on all architectures)
// API calls will be proxied to Docker API at localhost:3101
webServer: {
command: 'npm run dev -w @gridpilot/website',
url: 'http://localhost:3000',
timeout: 120_000,
reuseExistingServer: !process.env.CI,
env: {
NEXT_PUBLIC_API_BASE_URL: 'http://localhost:3101',
API_BASE_URL: 'http://localhost:3101',
},
},
// Browser projects
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});