Files
gridpilot.gg/playwright.website.config.ts
2025-12-26 20:54:20 +01:00

66 lines
1.6 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,
// Fail fast - stop on first error
maxFailures: 1,
// Timeout: Pages should load quickly
timeout: 30_000,
// Base URL for the website
use: {
baseURL: process.env.DOCKER_SMOKE ? 'http://localhost:3100' : '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
// - Default: start Next dev server locally
// - Docker smoke: website is started via docker-compose, so skip webServer
webServer: process.env.DOCKER_SMOKE
? undefined
: {
command: 'npm run dev -w @gridpilot/website',
url: 'http://localhost:3000',
timeout: 120_000,
reuseExistingServer: !process.env.CI,
},
// Browser projects
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});